verifiers

package
v0.0.0-...-fb8dd36 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Time to wait before re-running old jobs for fresh results.
	TryJobStaleTimeoutSecs = 24 * 60 * 60

	BuildBucketDefaultSkiaProject  = "skia"
	BuildBucketInternalSkiaProject = "skia-internal"

	BuildBucketDefaultSkiaBucket  = "skia.primary"
	BuildBucketInternalSkiaBucket = "skia.internal"
	BuildBucketStagingSkiaBucket  = "skia.testing"

	CancelBuildsMsg = "SkCQ is cleaning up try jobs from older patchsets"

	// The maximum number of different try jobs that will be retried before the
	// verifier returns failure.
	MaxFailedTryJobsToRetry = 2

	// When SkCQ retries try jobs it uses the following tag name.
	RetryTagName = "skcq_retry"
)

Variables

This section is empty.

Functions

func GetAllowedVoters

func GetAllowedVoters(ci *gerrit.ChangeInfo, allow allowed.Allow, labelName string, labelValue int) []string

GetAllowedVoters is a utility function that looks through the labels on a gerrit change to gather the email addresses of voters who voted the specified labelValue and who are in the allow group.

func GetStatusStringsFromVerifierStatuses

func GetStatusStringsFromVerifierStatuses(verifierStatuses []*types.VerifierStatus) (failureMsgs, waitingMsgs, successMsgs []string)

GetStatusStringsFromVerifierStatuses is a utility method to return user readable failure/waiting/success strings from VerifierStatuses

func NewAuthorsVerifier

func NewAuthorsVerifier(cr codereview.CodeReview, authorsFileContent string) (types.Verifier, error)

NewAuthorsVerifier returns an instance of AuthorsVerifier.

func NewCommitFooterVerifier

func NewCommitFooterVerifier(footersMap map[string]string) (types.Verifier, error)

NewCommitFooterVerifier returns an instance of CommitFooterVerifier.

func NewSubmittableVerifier

func NewSubmittableVerifier() (types.Verifier, error)

NewSubmittableVerifier returns an instance of SubmittableVerifier.

func NewSubmittedTogetherVerifier

func NewSubmittedTogetherVerifier(ctx context.Context, vm types.VerifiersManager, togetherChanges []*gerrit.ChangeInfo, httpClient *http.Client, cr codereview.CodeReview, ci *gerrit.ChangeInfo, footersMap map[string]string, canModifyCfgsOnTheFly allowed.Allow) (types.Verifier, error)

NewSubmittedTogetherVerifier returns an instance of SubmittedTogetherVerifier.

func NewThrottlerVerifier

func NewThrottlerVerifier(throttlerCfg *config.ThrottlerCfg, throttlerManager types.ThrottlerManager) (types.Verifier, error)

NewThrottlerVerifier returns an instance of ThrottlerVerifier.

func NewTreeStatusVerifier

func NewTreeStatusVerifier(httpClient *http.Client, treeStatusURL string, footersMap map[string]string) (types.Verifier, error)

NewTreeStatusVerifier returns an instance of TreeStatusVerifier.

func NewTryJobsVerifier

func NewTryJobsVerifier(httpClient *http.Client, cr codereview.CodeReview, tasksCfg *specs.TasksCfg, footersMap map[string]string, visibilityType config.VisibilityType) (types.Verifier, error)

NewTryJobsVerifier returns an instance of TryJobsVerifier.

func NewWIPVerifier

func NewWIPVerifier() (types.Verifier, error)

NewWIPVerifier returns an instance of WIPVerifier.

Types

type AuthorsVerifier

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

AuthorsVerifier implements the types.Verifier interface.

func (*AuthorsVerifier) Cleanup

func (wv *AuthorsVerifier) Cleanup(ctx context.Context, ci *gerrit.ChangeInfo, cleanupPatchsetID int64)

Cleanup implements the types.Verifier interface.

func (*AuthorsVerifier) Name

func (wv *AuthorsVerifier) Name() string

Name implements the types.Verifier interface.

func (*AuthorsVerifier) Verify

func (wv *AuthorsVerifier) Verify(ctx context.Context, ci *gerrit.ChangeInfo, startTime int64) (state types.VerifierState, reason string, err error)

Verify implements the types.Verifier interface.

type CommitFooterVerifier

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

CommitFooterVerifier implements the types.Verifier interface.

func (*CommitFooterVerifier) Cleanup

func (cv *CommitFooterVerifier) Cleanup(ctx context.Context, ci *gerrit.ChangeInfo, cleanupPatchsetID int64)

Cleanup implements the types.Verifier interface.

func (*CommitFooterVerifier) Name

func (cv *CommitFooterVerifier) Name() string

Name implements the types.Verifier interface.

func (*CommitFooterVerifier) Verify

func (cv *CommitFooterVerifier) Verify(ctx context.Context, ci *gerrit.ChangeInfo, startTime int64) (state types.VerifierState, reason string, err error)

Verify implements the types.Verifier interface.

type SkCQVerifiersManager

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

SkCQVerifiersManager implements VerifiersManager.

func NewSkCQVerifiersManager

func NewSkCQVerifiersManager(throttlerManager types.ThrottlerManager, httpClient, criaClient *http.Client, cr codereview.CodeReview, canModifyCfgsOnTheFly allowed.Allow) *SkCQVerifiersManager

NewSkCQVerifiersManager returns an instance of SkCQVerifiersManager.

func (*SkCQVerifiersManager) GetVerifiers

func (vm *SkCQVerifiersManager) GetVerifiers(ctx context.Context, cfg *config.SkCQCfg, ci *gerrit.ChangeInfo, isSubmittedTogetherChange bool, configReader config.ConfigReader) ([]types.Verifier, []string, error)

GetVerifiers implements the VerifierManager interface.

func (*SkCQVerifiersManager) RunVerifiers

func (vm *SkCQVerifiersManager) RunVerifiers(ctx context.Context, ci *gerrit.ChangeInfo, verifiers []types.Verifier, startTime int64) []*types.VerifierStatus

RunVerifiers implements the VerifierManager interface.

type SubmittableVerifier

type SubmittableVerifier struct{}

SubmittableVerifier implements the types.Verifier interface.

func (*SubmittableVerifier) Cleanup

func (sv *SubmittableVerifier) Cleanup(ctx context.Context, ci *gerrit.ChangeInfo, cleanupPatchsetID int64)

Cleanup implements the types.Verifier interface.

func (*SubmittableVerifier) Name

func (sv *SubmittableVerifier) Name() string

Name implements the types.Verifier interface.

func (*SubmittableVerifier) Verify

func (sv *SubmittableVerifier) Verify(ctx context.Context, ci *gerrit.ChangeInfo, startTime int64) (state types.VerifierState, reason string, err error)

Verify implements the types.Verifier interface.

type SubmittedTogetherVerifier

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

SubmittedTogetherVerifier implements the types.Verifier interface.

func (*SubmittedTogetherVerifier) Cleanup

func (stv *SubmittedTogetherVerifier) Cleanup(ctx context.Context, ci *gerrit.ChangeInfo, cleanupPatchsetID int64)

Cleanup implements the types.Verifier interface.

func (*SubmittedTogetherVerifier) Name

func (stv *SubmittedTogetherVerifier) Name() string

Name implements the types.Verifier interface.

func (*SubmittedTogetherVerifier) Verify

func (stv *SubmittedTogetherVerifier) Verify(ctx context.Context, ci *gerrit.ChangeInfo, startTime int64) (state types.VerifierState, reason string, err error)

Verify implements the types.Verifier interface.

type ThrottlerVerifier

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

ThrottlerVerifier implements the types.Verifier interface.

func (*ThrottlerVerifier) Cleanup

func (tv *ThrottlerVerifier) Cleanup(ctx context.Context, ci *gerrit.ChangeInfo, cleanupPatchsetID int64)

Cleanup implements the types.Verifier interface.

func (*ThrottlerVerifier) Name

func (tv *ThrottlerVerifier) Name() string

Name implements the types.Verifier interface.

func (*ThrottlerVerifier) Verify

func (tv *ThrottlerVerifier) Verify(ctx context.Context, ci *gerrit.ChangeInfo, startTime int64) (state types.VerifierState, reason string, err error)

Verify implements the types.Verifier interface.

type TreeStatus

type TreeStatus struct {
	Message      string `json:"message" datastore:"message"`
	GeneralState string `json:"general_state" datastore:"general_state,omitempty"`
}

type TreeStatusVerifier

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

TreeStatusVerifier implements the types.Verifier interface.

func (*TreeStatusVerifier) Cleanup

func (cv *TreeStatusVerifier) Cleanup(ctx context.Context, ci *gerrit.ChangeInfo, cleanupPatchsetID int64)

Cleanup implements the types.Verifier interface.

func (*TreeStatusVerifier) Name

func (tv *TreeStatusVerifier) Name() string

Name implements the types.Verifier interface.

func (*TreeStatusVerifier) Verify

func (tv *TreeStatusVerifier) Verify(ctx context.Context, ci *gerrit.ChangeInfo, startTime int64) (state types.VerifierState, reason string, err error)

Verify implements the types.Verifier interface.

type TryJobsVerifier

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

TryJobsVerifier implements the types.Verifier interface.

func (*TryJobsVerifier) Cleanup

func (tv *TryJobsVerifier) Cleanup(ctx context.Context, ci *gerrit.ChangeInfo, cleanupPatchsetID int64)

Cleanup implements the types.Verifier interface.

func (*TryJobsVerifier) Name

func (tv *TryJobsVerifier) Name() string

Name implements the types.Verifier interface.

func (*TryJobsVerifier) Verify

func (tv *TryJobsVerifier) Verify(ctx context.Context, ci *gerrit.ChangeInfo, startTime int64) (state types.VerifierState, reason string, err error)

Verify implements the types.Verifier interface.

type WIPVerifier

type WIPVerifier struct{}

WIPVerifier implements the types.Verifier interface.

func (*WIPVerifier) Cleanup

func (wv *WIPVerifier) Cleanup(ctx context.Context, ci *gerrit.ChangeInfo, cleanupPatchsetID int64)

Cleanup implements the types.Verifier interface.

func (*WIPVerifier) Name

func (wv *WIPVerifier) Name() string

Name implements the types.Verifier interface.

func (*WIPVerifier) Verify

func (wv *WIPVerifier) Verify(ctx context.Context, ci *gerrit.ChangeInfo, startTime int64) (state types.VerifierState, reason string, err error)

Verify implements the types.Verifier interface.

Jump to

Keyboard shortcuts

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