validator

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CheckRunName           = "only-valid-metadata-changes"
	FailedValidationTitle  = "Failed YAML validation"
	SuccessValidationTitle = "Passed YAML validation"
	ValidationTimeout      = 1 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckoutFunc

type CheckoutFunc func(ctx context.Context, authProvider repository.AuthProvider, repoUrl, sha string) (billy.Filesystem, error)

type Impl

type Impl struct {
	CustomConfiguration config.CustomConfiguration
	Repositories        service.Repositories
	Github              repository.Github
	AuthProvider        repository.AuthProvider
	CheckoutFunction    CheckoutFunc
	// contains filtered or unexported fields
}

func New

func New(
	configuration librepo.Configuration,
	repositories service.Repositories,
	github repository.Github,
	authProvider repository.AuthProvider,
) *Impl

func (*Impl) IsValidator

func (h *Impl) IsValidator() bool

func (*Impl) PerformValidationCheckRun

func (h *Impl) PerformValidationCheckRun(ctx context.Context, owner, repo, sha string) error

type ValidationResult

type ValidationResult struct {
	FileErrors map[string]error
	YamlErrors map[string]error
}

type ValidationWalker added in v0.49.0

type ValidationWalker struct {
	Annotations       []*gogithub.CheckRunAnnotation
	Errors            map[string]error
	IgnoredWithReason map[string]string
	// contains filtered or unexported fields
}

func NewValidationWalker added in v0.49.0

func NewValidationWalker(filesys billy.Filesystem) *ValidationWalker

func (*ValidationWalker) WalkerFunc added in v0.49.0

func (v *ValidationWalker) WalkerFunc(path string, info fs.FileInfo, err error) error

Jump to

Keyboard shortcuts

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