check

package
v0.60.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: MIT Imports: 28 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
)
View Source
const (
	FixAction     = "fix-all"
	ActionTimeout = 1 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckResult added in v0.57.0

type CheckResult struct {
	// contains filtered or unexported fields
}

type CheckoutFunc

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

type Config added in v0.57.0

type Config struct {
	// contains filtered or unexported fields
}

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,
	timestamp Timestamp,
) *Impl

func (*Impl) IsValidator

func (h *Impl) IsValidator() bool

func (*Impl) PerformRequestedAction

func (h *Impl) PerformRequestedAction(ctx context.Context, requestedAction string, checkRun *github.CheckRun, requestingUser *github.User) error

func (*Impl) PerformValidationCheckRun

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

type MetadataWalker

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

func MetadataYamlFileWalker

func MetadataYamlFileWalker(filesys billy.Filesystem, options ...Option) *MetadataWalker

func (*MetadataWalker) FixExemptions added in v0.60.0

func (v *MetadataWalker) FixExemptions() error

func (*MetadataWalker) FormatMetadata

func (v *MetadataWalker) FormatMetadata() error

func (*MetadataWalker) ValidateMetadata

func (v *MetadataWalker) ValidateMetadata() error

type MissingRequiredConditionExemption added in v0.60.0

type MissingRequiredConditionExemption struct {
	Name       string
	RefMatcher string
	Exemptions []string
}

type Option added in v0.57.0

type Option = func(config *Config)

func WithExpectedExemptions added in v0.60.0

func WithExpectedExemptions(expectedExemptions []config.CheckedExpectedExemption) Option

func WithExpectedRequiredConditions added in v0.57.0

func WithExpectedRequiredConditions(expectedReqConditions []config.CheckedRequiredConditions) Option

func WithIndentation added in v0.57.0

func WithIndentation(indentation int) Option

func WithMainlinePrProtection added in v0.57.0

func WithMainlinePrProtection(requireMainlinePrProtection bool) Option

func WithRootDir added in v0.57.0

func WithRootDir(rootDir string) Option

type Timestamp

type Timestamp interface {
	Now() time.Time
}

type ValidationResult

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

Jump to

Keyboard shortcuts

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