check

package
v0.55.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 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 (
	FixFormattingAction = "fix-formatting"
	ActionTimeout       = 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,
	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, indentation int) *MetadataWalker

func (*MetadataWalker) FormatMetadata

func (v *MetadataWalker) FormatMetadata() error

func (*MetadataWalker) ValidateMetadata

func (v *MetadataWalker) ValidateMetadata() error

func (*MetadataWalker) WithRootDir

func (v *MetadataWalker) WithRootDir(newRoot string) *MetadataWalker

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