detector

package
v0.0.0-...-fed2c98 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectMissingDocs

func DetectMissingDocs(schemaDiff diff.SchemaDiff, repoPath string) (map[string]MissingDocDetails, error)

DetectMissingDocs detect new fields that are missing docs given the schema diffs. Return a map of resource names to missing doc info.

func DetectMissingDocsForDatasource

func DetectMissingDocsForDatasource(schemaDiff diff.SchemaDiff, repoPath string) (map[string]MissingDocDetails, error)

func DetectMissingTests

func DetectMissingTests(schemaDiff diff.SchemaDiff, allTests []*reader.Test) (map[string]*MissingTestInfo, error)

Detect missing tests for the given resource changes map in the given slice of tests. Return a map of resource names to missing test info about that resource.

Types

type Field

type Field struct {
	// Added is true when the field is newly added between oldProvider and newProvider.
	Added bool
	// Changed is true when the field type has changed between oldProvider and newProvider.
	Changed bool
	// Tested is true when a test has been found that includes the field.
	Tested bool
}

type FieldSet

type FieldSet map[string]struct{}

type MissingDocDetails

type MissingDocDetails struct {
	Name     string
	FilePath string
	Fields   []string
}

MissingDocDetails denotes the doc file path and the fields that are not shown up in the corresponding doc.

type MissingTestInfo

type MissingTestInfo struct {
	UntestedFields []string
	SuggestedTest  string
	Tests          []string
}

type ResourceChanges

type ResourceChanges map[string]*Field

ResourceChanges is a nested map with field names as keys and Field objects as bottom-level values. Fields are assumed not to be covered until detected in a test.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL