Documentation
¶
Overview ¶
Package patch models an intent to patch test code in a particular state. It is distinct from a version because a version has tasks, whereas a patch merely represents an intent.
Index ¶
- Constants
- Variables
- func ByGithash(githash string) db.Q
- func ByGithubPRAndCreatedBefore(t time.Time, owner, repo string, prNumber int) db.Q
- func ById(id mgobson.ObjectId) db.Q
- func ByProjectAndCommitQueue(project string, filterCommitQueue bool) db.Q
- func ByStringId(id string) db.Q
- func ByStringIds(ids []string) db.Q
- func ByUserAndCommitQueue(user string, filterCommitQueue bool) db.Q
- func ByUserPaginated(user string, ts time.Time, limit int) db.Q
- func ByVersion(version string) db.Q
- func ByVersions(versions []string) db.Q
- func ConsolidatePatchesForUser(ctx context.Context, oldAuthor string, newUsr *user.DBUser) error
- func FetchPatchContents(ctx context.Context, patchfileID string) (string, error)
- func FindProjectForPatch(ctx context.Context, patchID mgobson.ObjectId) (string, error)
- func FindUnprocessedGithubIntents(ctx context.Context) ([]*githubIntent, error)
- func GetChildrenOrSiblingsReadiness(ctx context.Context, childrenOrSiblings []string) (string, error)
- func GetCollectiveStatusFromPatchStatuses(statuses []string) string
- func GetFinalizedChildPatchIdsForPatch(ctx context.Context, patchID string) ([]string, error)
- func GetGithubContextForChildPatch(projectIdentifier string, parentPatch, childPatch *Patch) (string, error)
- func IsValidId(id string) bool
- func MostRecentPatchByUserAndProject(user, project string) db.Q
- func NewId(id string) mgobson.ObjectId
- func PatchesByProject(projectId string, ts time.Time, limit int) db.Q
- func Remove(ctx context.Context, query db.Q) error
- func ResolveVariantTasks(vts []VariantTasks) (bvs []string, tasks []string)
- func TryMarkStarted(ctx context.Context, versionId string, startTime time.Time) error
- func UpdateAll(ctx context.Context, query any, update any) (info *adb.ChangeInfo, err error)
- func UpdateOne(ctx context.Context, query any, update any) error
- type ByPatchNameStatusesMergeQueuePaginatedOptions
- type CLIIntentParams
- type DisplayTask
- type GitMetadata
- type Intent
- func FindIntent(ctx context.Context, id, intentType string) (Intent, error)
- func GetIntent(intentType string) (Intent, bool)
- func NewCliIntent(params CLIIntentParams) (Intent, error)
- func NewGithubIntent(ctx context.Context, ...) (Intent, error)
- func NewGithubMergeIntent(msgDeliveryID string, caller string, mg *github.MergeGroupEvent) (Intent, error)
- func NewTriggerIntent(opts TriggerIntentOptions) Intent
- type LocalModuleInclude
- type ModulePatch
- type Parameter
- type Patch
- func ByPatchNameStatusesMergeQueuePaginated(ctx context.Context, opts ByPatchNameStatusesMergeQueuePaginatedOptions) ([]Patch, int, error)
- func Find(ctx context.Context, query db.Q) ([]Patch, error)
- func FindLatestGithubPRPatch(ctx context.Context, owner, repo string, prNumber int) (*Patch, error)
- func FindOne(ctx context.Context, query db.Q) (*Patch, error)
- func FindOneId(ctx context.Context, id string) (*Patch, error)
- func (p *Patch) ClearPatchData()
- func (p *Patch) CollectiveStatus(ctx context.Context) (string, error)
- func (p *Patch) ConfigChanged(remotePath string) bool
- func (p *Patch) FetchPatchFiles(ctx context.Context) error
- func (p *Patch) FilesChanged() []string
- func (p *Patch) FindModule(moduleName string) *ModulePatch
- func (p *Patch) GetFamilyInformation(ctx context.Context) (bool, *Patch, error)
- func (p *Patch) GetPatchFamily(ctx context.Context) ([]string, *Patch, error)
- func (p *Patch) GetPatchIndex(parentPatch *Patch) (int, error)
- func (p *Patch) GetRequester() string
- func (p *Patch) GetURL(uiHost string) string
- func (p *Patch) HasValidGitInfo() bool
- func (p *Patch) Insert(ctx context.Context) error
- func (p *Patch) IsChild() bool
- func (p *Patch) IsFinished() bool
- func (p *Patch) IsGithubPRPatch() bool
- func (p *Patch) IsMergeQueuePatch() bool
- func (p *Patch) IsParent() bool
- func (p *Patch) MarshalBSON() ([]byte, error)
- func (p *Patch) RemoveModulePatch(ctx context.Context, moduleName string) error
- func (p *Patch) SetActivation(ctx context.Context, activated bool) error
- func (p *Patch) SetChildPatches(ctx context.Context) error
- func (p *Patch) SetDescription(ctx context.Context, desc string) error
- func (p *Patch) SetDownstreamParameters(ctx context.Context, parameters []Parameter) error
- func (p *Patch) SetFinalized(ctx context.Context, versionId string) error
- func (p *Patch) SetIsReconfigured(ctx context.Context, isReconfigured bool) error
- func (p *Patch) SetParameters(ctx context.Context, parameters []Parameter) error
- func (p *Patch) SetParametersFromParent(ctx context.Context) (*Patch, error)
- func (p *Patch) SetPatchVisibility(ctx context.Context, hidden bool) error
- func (p *Patch) SetTriggerAliases(ctx context.Context) error
- func (p *Patch) SetVariantsTasks(ctx context.Context, variantsTasks []VariantTasks) error
- func (p *Patch) ShouldPatchFileWithDiff(path string) bool
- func (p *Patch) UnmarshalBSON(in []byte) error
- func (p *Patch) UpdateGithashProjectAndTasks(ctx context.Context) error
- func (p *Patch) UpdateModulePatch(ctx context.Context, modulePatch ModulePatch) error
- func (p *Patch) UpdateRepeatPatchId(ctx context.Context, patchId string) error
- func (p *Patch) UpdateStatus(ctx context.Context, newStatus string) (modified bool, err error)
- func (p *Patch) UpdateVariantsTasks(variantsTasks []VariantTasks)
- type PatchSet
- type PatchTriggerDefinition
- type PatchesByCreateTime
- type TaskSpecifier
- type TriggerInfo
- type TriggerIntent
- func (t *TriggerIntent) GetAlias() string
- func (t *TriggerIntent) GetCalledBy() string
- func (t *TriggerIntent) GetType() string
- func (t *TriggerIntent) ID() string
- func (t *TriggerIntent) Insert(ctx context.Context) error
- func (t *TriggerIntent) IsProcessed() bool
- func (t *TriggerIntent) NewPatch() *Patch
- func (g *TriggerIntent) RepeatFailedTasksAndVariants() (string, bool)
- func (t *TriggerIntent) RepeatPreviousPatchDefinition() (string, bool)
- func (t *TriggerIntent) RequesterIdentity() string
- func (t *TriggerIntent) SetProcessed(ctx context.Context) error
- func (t *TriggerIntent) ShouldFinalizePatch() bool
- type TriggerIntentOptions
- type VariantTasks
Constants ¶
const ( Collection = "patches" GridFSPrefix = "patchfiles" )
const ( // IntentCollection is the database collection that stores patch intents. IntentCollection = "patch_intents" // GithubIntentType represents patch intents created for GitHub. GithubIntentType = "github" )
const ( AutomatedCaller = "auto" ManualCaller = "manual" AllCallers = "" )
CalledBy can be either auto or manual.
const CliIntentType = "cli"
const (
// GithubMergeIntentType is an intent to create a version for a GitHub merge group.
GithubMergeIntentType = "github_merge"
)
const SizeLimit = 1024 * 1024 * 100
SizeLimit is a hard limit on patch size.
const TriggerIntentType = "trigger"
Variables ¶
var ( IdKey = bsonutil.MustHaveTag(Patch{}, "Id") DescriptionKey = bsonutil.MustHaveTag(Patch{}, "Description") ProjectKey = bsonutil.MustHaveTag(Patch{}, "Project") GithashKey = bsonutil.MustHaveTag(Patch{}, "Githash") AuthorKey = bsonutil.MustHaveTag(Patch{}, "Author") NumberKey = bsonutil.MustHaveTag(Patch{}, "PatchNumber") VersionKey = bsonutil.MustHaveTag(Patch{}, "Version") StatusKey = bsonutil.MustHaveTag(Patch{}, "Status") CreateTimeKey = bsonutil.MustHaveTag(Patch{}, "CreateTime") StartTimeKey = bsonutil.MustHaveTag(Patch{}, "StartTime") FinishTimeKey = bsonutil.MustHaveTag(Patch{}, "FinishTime") BuildVariantsKey = bsonutil.MustHaveTag(Patch{}, "BuildVariants") TasksKey = bsonutil.MustHaveTag(Patch{}, "Tasks") VariantsTasksKey = bsonutil.MustHaveTag(Patch{}, "VariantsTasks") PatchesKey = bsonutil.MustHaveTag(Patch{}, "Patches") ParametersKey = bsonutil.MustHaveTag(Patch{}, "Parameters") ActivatedKey = bsonutil.MustHaveTag(Patch{}, "Activated") IsReconfiguredKey = bsonutil.MustHaveTag(Patch{}, "IsReconfigured") ProjectStorageMethodKey = bsonutil.MustHaveTag(Patch{}, "ProjectStorageMethod") PatchedProjectConfigKey = bsonutil.MustHaveTag(Patch{}, "PatchedProjectConfig") AliasKey = bsonutil.MustHaveTag(Patch{}, "Alias") MergePatchKey = bsonutil.MustHaveTag(Patch{}, "MergePatch") TriggersKey = bsonutil.MustHaveTag(Patch{}, "Triggers") HiddenKey = bsonutil.MustHaveTag(Patch{}, "Hidden") // BSON fields for the module patch struct ModulePatchNameKey = bsonutil.MustHaveTag(ModulePatch{}, "ModuleName") ModulePatchGithashKey = bsonutil.MustHaveTag(ModulePatch{}, "Githash") ModulePatchSetKey = bsonutil.MustHaveTag(ModulePatch{}, "PatchSet") // BSON fields for the patch set struct PatchSetPatchKey = bsonutil.MustHaveTag(PatchSet{}, "Patch") PatchSetSummaryKey = bsonutil.MustHaveTag(PatchSet{}, "Summary") // BSON fields for the patch trigger struct TriggerInfoAliasesKey = bsonutil.MustHaveTag(TriggerInfo{}, "Aliases") TriggerInfoParentPatchKey = bsonutil.MustHaveTag(TriggerInfo{}, "ParentPatch") TriggerInfoChildPatchesKey = bsonutil.MustHaveTag(TriggerInfo{}, "ChildPatches") TriggerInfoDownstreamParametersKey = bsonutil.MustHaveTag(TriggerInfo{}, "DownstreamParameters") )
BSON fields for the patches
var ExcludePatchDiff = bson.M{ bsonutil.GetDottedKeyName(PatchesKey, ModulePatchSetKey, PatchSetPatchKey): 0, }
ExcludePatchDiff is a projection that excludes diff data, helping load times.
Functions ¶
func ByGithubPRAndCreatedBefore ¶
ByGithubPRAndCreatedBefore finds all patches that were created for a GitHub PR before the given timestamp.
func ByProjectAndCommitQueue ¶
ByProject produces a query that returns projects with the given identifier.
func ByStringId ¶
func ByStringIds ¶
func ByUserAndCommitQueue ¶
ByUser produces a query that returns patches by the given user.
func ByUserPaginated ¶
ByUserPaginated produces a query that returns patches by the given user before/after the input time, sorted by creation time and limited
func ByVersions ¶
ByVersion produces a query that returns the patch for a given version.
func ConsolidatePatchesForUser ¶
ConsolidatePatchesForUser updates all patches authored by oldAuthor to be authored by newAuthor, and if any patches have been authored by the new author already, update the patch numbers to come after the new author.
func FetchPatchContents ¶
func FindProjectForPatch ¶
func FindUnprocessedGithubIntents ¶
FindUnprocessedGithubIntents finds all patch intents that have not yet been processed.
func GetCollectiveStatusFromPatchStatuses ¶
GetCollectiveStatusFromPatchStatuses answers the question of what the patch status should be when the patch status and the status of its children are different, given a list of statuses.
func GetFinalizedChildPatchIdsForPatch ¶
GetFinalizedChildPatchIdsForPatch returns patchIds for any finalized children of the given patch.
func GetGithubContextForChildPatch ¶
func GetGithubContextForChildPatch(projectIdentifier string, parentPatch, childPatch *Patch) (string, error)
GetGithubContextForChildPatch returns the github context for the given child patch, to be used in github statuses.
func MostRecentPatchByUserAndProject ¶
MostRecentPatchByUserAndProject returns the latest patch made by the user for the project.
func PatchesByProject ¶
PatchesByProject builds a query for patches that match the given project's id.
func ResolveVariantTasks ¶
func ResolveVariantTasks(vts []VariantTasks) (bvs []string, tasks []string)
ResolveVariantTasks returns a set of all build variants and a set of all tasks that will run based on the given VariantTasks, filtering out any duplicates.
func TryMarkStarted ¶
TryMarkStarted attempts to mark a patch as started if it isn't already marked as such
Types ¶
type CLIIntentParams ¶
type CLIIntentParams struct {
User string
Path string
Project string
BaseGitHash string
Module string
PatchContent string
Description string
Finalize bool
GitInfo *GitMetadata
Parameters []Parameter
Variants []string
Tasks []string
RegexVariants []string
RegexTasks []string
RegexTestSelectionVariants []string
RegexTestSelectionExcludedVariants []string
RegexTestSelectionTasks []string
RegexTestSelectionExcludedTasks []string
Alias string
TriggerAliases []string
RepeatDefinition bool
RepeatFailed bool
RepeatPatchId string
LocalModuleIncludes []LocalModuleInclude
}
type DisplayTask ¶
type GitMetadata ¶
type Intent ¶
type Intent interface {
// ID returns a unique identifier for the patch. Should
// correspond to the _id for the patch in database.
ID() string
// Insert inserts a patch intent in the database.
Insert(ctx context.Context) error
// SetProcessed should be called by an amboy queue after creating a patch from an intent.
SetProcessed(ctx context.Context) error
// IsProcessed returns whether a patch exists for this intent.
IsProcessed() bool
// GetType returns the patch intent, e.g., GithubIntentType.
GetType() string
// NewPatch creates a patch from the intent
NewPatch() *Patch
// Finalize indicates whether or not the patch created from this
// intent should be finalized
ShouldFinalizePatch() bool
// RepeatPreviousPatchDefinition returns true if we should use the same tasks/variants as a previous patch.
// Returns patch ID if specified, otherwise we use the latest patch.
RepeatPreviousPatchDefinition() (string, bool)
// RepeatFailedTasksAndVariants returns true if we should use the failed tasks/variants from a previous patch.
// Returns patch ID if specified, otherwise we use the latest patch.
RepeatFailedTasksAndVariants() (string, bool)
// GetAlias defines the variants and tasks this intent should run on.
GetAlias() string
// RequesterIdentity supplies a valid requester type, that is recorded
// in patches, versions, builds, and tasks to denote the origin of the
// patch
RequesterIdentity() string
// GetCalledBy indicates whether the intent was created automatically
// by Evergreen or manually by the user.
GetCalledBy() string
}
Intent represents an intent to create a patch build and is processed by an amboy queue.
func FindIntent ¶
FindIntent returns an intent of the specified type from the database
func NewCliIntent ¶
func NewCliIntent(params CLIIntentParams) (Intent, error)
func NewGithubIntent ¶
func NewGithubIntent(ctx context.Context, msgDeliveryID, patchOwner, calledBy, alias, mergeBase string, pr *github.PullRequest) (Intent, error)
NewGithubIntent creates an Intent from a google/go-github PullRequestEvent, or returns an error if the some part of the struct is invalid
func NewGithubMergeIntent ¶
func NewGithubMergeIntent(msgDeliveryID string, caller string, mg *github.MergeGroupEvent) (Intent, error)
NewGithubIntent creates an Intent from a google/go-github MergeGroup.
func NewTriggerIntent ¶
func NewTriggerIntent(opts TriggerIntentOptions) Intent
type LocalModuleInclude ¶
type LocalModuleInclude struct {
FileName string `yaml:"filename,omitempty" bson:"filename,omitempty" json:"filename,omitempty"`
Module string `yaml:"module,omitempty" bson:"module,omitempty" json:"module,omitempty"`
// FileContent is only used for local module includes for CLI patches
FileContent []byte `yaml:"file_content,omitempty" bson:"file_content,omitempty" json:"file_content,omitempty"`
}
type ModulePatch ¶
type ModulePatch struct {
ModuleName string `bson:"name"`
Githash string `bson:"githash"`
PatchSet PatchSet `bson:"patch_set"`
}
ModulePatch stores request details for a patch
type Parameter ¶
type Parameter struct {
Key string `yaml:"key" bson:"key"`
Value string `yaml:"value" bson:"value"`
}
Parameter defines a key/value pair to be used as an expansion.
type Patch ¶
type Patch struct {
Id mgobson.ObjectId `bson:"_id,omitempty"`
Description string `bson:"desc"`
Path string `bson:"path,omitempty"`
Githash string `bson:"githash"`
Hidden bool `bson:"hidden"`
PatchNumber int `bson:"patch_number"`
Author string `bson:"author"`
Version string `bson:"version"`
Status string `bson:"status"`
CreateTime time.Time `bson:"create_time"`
StartTime time.Time `bson:"start_time"`
FinishTime time.Time `bson:"finish_time"`
BuildVariants []string `bson:"build_variants"`
RegexBuildVariants []string `bson:"regex_build_variants"`
RegexTestSelectionBuildVariants []string `bson:"regex_test_selection_build_variants,omitempty"`
RegexTestSelectionExcludedBuildVariants []string `bson:"regex_test_selection_excluded_build_variants,omitempty"`
Tasks []string `bson:"tasks"`
RegexTestSelectionTasks []string `bson:"regex_test_selection_tasks,omitempty"`
RegexTestSelectionExcludedTasks []string `bson:"regex_test_selection_excluded_tasks,omitempty"`
RegexTasks []string `bson:"regex_tasks"`
VariantsTasks []VariantTasks `bson:"variants_tasks"`
Patches []ModulePatch `bson:"patches"`
Parameters []Parameter `bson:"parameters,omitempty"`
// Activated indicates whether or not the patch is finalized (i.e.
// tasks/variants are now scheduled to run). If true, the patch has been
// finalized.
Activated bool `bson:"activated"`
// IsReconfigured indicates whether this patch was finalized with an initial
// set of tasks, then later reconfigured to add more tasks to run.
// This doesn't take into account if existing tasks were
// scheduled/unscheduled, it's only considered reconfigured if new tasks
// were created after the patch was finalized.
IsReconfigured bool `bson:"is_reconfigured,omitempty"`
// Project contains the project ID for the patch. The bson tag here is `branch` due to legacy usage.
Project string `bson:"branch"`
// Branch contains the branch that the project tracks. The tag `branch_name` is
// used to avoid conflict with legacy usage of the Project field.
Branch string `bson:"branch_name" json:"branch_name,omitempty"`
// ProjectStorageMethod describes how the parser project is stored for this
// patch before it's finalized. This field is only set while the patch is
// unfinalized and is cleared once the patch has been finalized.
ProjectStorageMethod evergreen.ParserProjectStorageMethod `bson:"project_storage_method,omitempty"`
PatchedProjectConfig string `bson:"patched_project_config"`
Alias string `bson:"alias"`
Triggers TriggerInfo `bson:"triggers"`
MergePatch string `bson:"merge_patch"`
GithubPatchData thirdparty.GithubPatch `bson:"github_patch_data,omitempty"`
GithubMergeData thirdparty.GithubMergeGroup `bson:"github_merge_data,omitempty"`
GitInfo *GitMetadata `bson:"git_info,omitempty"`
// DisplayNewUI is only used when roundtripping the patch via the CLI
DisplayNewUI bool `bson:"display_new_ui,omitempty"`
// MergeStatus is only used in gitServePatch to send the status of this
// patch on the commit queue to the agent
MergeStatus string `json:"merge_status"`
// MergedFrom is populated with the patch id of the existing patch
// the merged patch is based off of, if applicable.
MergedFrom string `bson:"merged_from,omitempty"`
// LocalModuleIncludes is only used for CLI patches to store local module changes.
LocalModuleIncludes []LocalModuleInclude `bson:"local_module_includes,omitempty"`
// ReferenceManifestID stores the ID of the manifest that this patch is based on.
// It is used to determine the module revisions for this patch during creation.
// This could potentially reference an invalid manifest, and should not error
// when the manifest is not found.
// Not stored in the database since it is only needed during patch creation.
ReferenceManifestID string `bson:"-"`
}
Patch stores all details related to a patch request
func FindLatestGithubPRPatch ¶
FindLatestGithubPRPatch returns the latest PR patch for the given PR, if there is one.
func (*Patch) ClearPatchData ¶
func (p *Patch) ClearPatchData()
ClearPatchData removes any inline patch data stored in this patch object for patches that have an associated id in gridfs, so that it can be stored properly.
func (*Patch) CollectiveStatus ¶
CollectiveStatus returns the aggregate display status of all tasks and child patches. If this is meant for display on the UI, we should also consider the display status aborted. NOTE that the result of this should not be compared against version statuses, because this can return display statuses.
func (*Patch) ConfigChanged ¶
ConfigChanged looks through the parts of the patch and returns true if the passed in remotePath is in the the name of the changed files that are part of the patch
func (*Patch) FetchPatchFiles ¶
FetchPatchFiles dereferences externally-stored patch diffs by fetching them from gridfs and placing their contents into the patch object.
func (*Patch) FilesChanged ¶
func (*Patch) FindModule ¶
func (p *Patch) FindModule(moduleName string) *ModulePatch
func (*Patch) GetFamilyInformation ¶
func (*Patch) GetPatchFamily ¶
func (*Patch) GetRequester ¶
func (*Patch) HasValidGitInfo ¶
func (*Patch) IsFinished ¶
IsFinished returns whether or not the patch has finished based on its status.
func (*Patch) IsGithubPRPatch ¶
func (*Patch) IsMergeQueuePatch ¶
IsMergeQueuePatch returns true if the the patch is part of GitHub's merge queue.
func (*Patch) MarshalBSON ¶
func (*Patch) RemoveModulePatch ¶
RemoveModulePatch removes a module that's part of a patch request
func (*Patch) SetActivation ¶
SetActivation sets the patch to the desired activation state without modifying the activation status of the possibly corresponding version.
func (*Patch) SetChildPatches ¶
SetChildPatches appends the IDs of downstream patches to the db
func (*Patch) SetDescription ¶
SetDescription sets a patch's description in the database
func (*Patch) SetDownstreamParameters ¶
func (*Patch) SetFinalized ¶
SetFinalized marks the patch as finalized.
func (*Patch) SetIsReconfigured ¶
SetIsReconfigured sets whether the patch was reconfigured after it was already finalized.
func (*Patch) SetParameters ¶
func (*Patch) SetParametersFromParent ¶
func (*Patch) SetPatchVisibility ¶
SetPatchVisibility set the patch visibility to the desired state. This is used to hide patches that the user does not need to see.
func (*Patch) SetTriggerAliases ¶
SetTriggerAliases appends the names of invoked trigger aliases to the DB
func (*Patch) SetVariantsTasks ¶
func (p *Patch) SetVariantsTasks(ctx context.Context, variantsTasks []VariantTasks) error
SetVariantsTasks updates the variant/tasks pairs in the database. Also updates the Tasks and Variants fields to maintain backwards compatibility between the old and new fields.
func (*Patch) ShouldPatchFileWithDiff ¶
ShouldPatchFileWithDiff returns true if the patch should read with diff (i.e. is not a PR patch) and the config has changed.
func (*Patch) UnmarshalBSON ¶
func (*Patch) UpdateGithashProjectAndTasks ¶
func (*Patch) UpdateModulePatch ¶
func (p *Patch) UpdateModulePatch(ctx context.Context, modulePatch ModulePatch) error
UpdateModulePatch adds or updates a module within a patch.
func (*Patch) UpdateRepeatPatchId ¶
UpdateRepeatPatchId updates the repeat patch Id value to be used for subsequent pr patches
func (*Patch) UpdateStatus ¶
func (*Patch) UpdateVariantsTasks ¶
func (p *Patch) UpdateVariantsTasks(variantsTasks []VariantTasks)
UpdateVariantsTasks updates the patch's Tasks and BuildVariants fields to match with the set in the given list of VariantTasks. This is to ensure schema backwards compatibility for T shaped patches. This mutates the patch in memory but does not update it in the database; for that, use SetVariantsTasks.
type PatchSet ¶
type PatchSet struct {
Patch string `bson:"patch,omitempty"`
PatchFileId string `bson:"patch_file_id,omitempty"`
CommitMessages []string `bson:"commit_messages,omitempty"`
Summary []thirdparty.Summary `bson:"summary"`
}
PatchSet stores information about the actual patch
type PatchTriggerDefinition ¶
type PatchTriggerDefinition struct {
Alias string `bson:"alias" json:"alias"`
ChildProject string `bson:"child_project" json:"child_project"`
TaskSpecifiers []TaskSpecifier `bson:"task_specifiers" json:"task_specifiers"`
// The parent status that the child patch should run on: failure, success, or *
Status string `bson:"status,omitempty" json:"status,omitempty"`
ParentAsModule string `bson:"parent_as_module,omitempty" json:"parent_as_module,omitempty"`
// The revision to base the downstream patch off of
DownstreamRevision string `bson:"downstream_revision,omitempty" json:"downstream_revision,omitempty"`
}
type PatchesByCreateTime ¶
type PatchesByCreateTime []Patch
func (PatchesByCreateTime) Len ¶
func (p PatchesByCreateTime) Len() int
func (PatchesByCreateTime) Less ¶
func (p PatchesByCreateTime) Less(i, j int) bool
func (PatchesByCreateTime) Swap ¶
func (p PatchesByCreateTime) Swap(i, j int)
type TaskSpecifier ¶
type TriggerInfo ¶
type TriggerInfo struct {
Aliases []string `bson:"aliases,omitempty"`
ParentPatch string `bson:"parent_patch,omitempty"`
ParentProjectID string `bson:"parent_project_id,omitempty"`
DownstreamRevision string `bson:"downstream_revision,omitempty"`
SameBranchAsParent bool `bson:"same_branch_as_parent"`
ChildPatches []string `bson:"child_patches,omitempty"`
DownstreamParameters []Parameter `bson:"downstream_parameters,omitempty"`
}
type TriggerIntent ¶
type TriggerIntent struct {
Id string `bson:"_id"`
Requester string `bson:"requester"`
Author string `bson:"author"`
ProjectID string `bson:"project_id"`
ParentID string `bson:"parent_id"`
ParentProjectID string `bson:"parent_project"`
ParentAsModule string `bson:"parent_as_module"`
// The parent status that the child patch should run on
ParentStatus string `bson:"parent_status"`
Definitions []PatchTriggerDefinition `bson:"definitions"`
// The revision to base the downstream patch off of
DownstreamRevision string `bson:"downstream_revision"`
Processed bool `bson:"processed"`
}
func (*TriggerIntent) GetAlias ¶
func (t *TriggerIntent) GetAlias() string
func (*TriggerIntent) GetCalledBy ¶
func (t *TriggerIntent) GetCalledBy() string
func (*TriggerIntent) GetType ¶
func (t *TriggerIntent) GetType() string
GetType returns the patch intent, e.g., GithubIntentType.
func (*TriggerIntent) ID ¶
func (t *TriggerIntent) ID() string
func (*TriggerIntent) IsProcessed ¶
func (t *TriggerIntent) IsProcessed() bool
func (*TriggerIntent) NewPatch ¶
func (t *TriggerIntent) NewPatch() *Patch
func (*TriggerIntent) RepeatFailedTasksAndVariants ¶
func (g *TriggerIntent) RepeatFailedTasksAndVariants() (string, bool)
func (*TriggerIntent) RepeatPreviousPatchDefinition ¶
func (t *TriggerIntent) RepeatPreviousPatchDefinition() (string, bool)
func (*TriggerIntent) RequesterIdentity ¶
func (t *TriggerIntent) RequesterIdentity() string
func (*TriggerIntent) SetProcessed ¶
func (t *TriggerIntent) SetProcessed(ctx context.Context) error
func (*TriggerIntent) ShouldFinalizePatch ¶
func (t *TriggerIntent) ShouldFinalizePatch() bool
type TriggerIntentOptions ¶
type VariantTasks ¶
type VariantTasks struct {
Variant string `bson:"variant"`
Tasks []string `bson:"tasks"`
DisplayTasks []DisplayTask `bson:"displaytasks"`
}
VariantTasks contains the variant name and the set of tasks to be scheduled for that variant
func MergeVariantsTasks ¶
func MergeVariantsTasks(vts1, vts2 []VariantTasks) []VariantTasks
MergeVariantsTasks merges two slices of VariantsTasks into a single set.