Documentation ¶
Index ¶
- type Approve
- type BranchProtectionContextPolicy
- type Brancher
- type ContextPolicy
- type DefaultOwnersDirBlacklist
- type ExternalPlugin
- type GarbageCollection
- type GlobalProtectionPolicy
- type Heart
- type JobBase
- type Lgtm
- type Merger
- type Owners
- type Postsubmit
- type Postsubmits
- type Presubmit
- type Presubmits
- type ProtectionPolicies
- type ProtectionPolicy
- type ProwConfig
- type PullRequestMergeType
- type Query
- type RegexpChangeMatcher
- type ReplaceableMapOfStringContextPolicy
- type ReplaceableMapOfStringString
- type ReplaceableSliceOfExternalPlugins
- type ReplaceableSliceOfStrings
- type RepoContextPolicy
- type Restrictions
- type ReviewPolicy
- type Reviewers
- type Scheduler
- type SchedulerAgent
- type SchedulerLeaf
- type Trigger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Approve ¶
type Approve struct { // IssueRequired indicates if an associated issue is required for approval in // the specified repos. IssueRequired *bool `json:"issueRequired,omitempty"` // RequireSelfApproval requires PR authors to explicitly approve their PRs. // Otherwise the plugin assumes the author of the PR approves the changes in the PR. RequireSelfApproval *bool `json:"requireSelfApproval,omitempty"` // LgtmActsAsApprove indicates that the lgtm command should be used to // indicate approval LgtmActsAsApprove *bool `json:"lgtmActsAsApprove,omitempty"` // IgnoreReviewState causes the approve plugin to ignore the GitHub review state. Otherwise: // * an APPROVE github review is equivalent to leaving an "/approve" message. // * A REQUEST_CHANGES github review is equivalent to leaving an /approve cancel" message. IgnoreReviewState *bool `json:"ignoreReviewState,omitempty"` }
Approve specifies a configuration for a single approve.
The configuration for the approve plugin is defined as a list of these structures.
type BranchProtectionContextPolicy ¶
type BranchProtectionContextPolicy struct { // Contexts appends required contexts that must be green to merge Contexts *ReplaceableSliceOfStrings `json:"contexts,omitempty"` // Strict overrides whether new commits in the base branch require updating the PR if set Strict *bool `json:"strict,omitempty"` }
BranchProtectionContextPolicy configures required git provider contexts. Strict determines whether merging to the branch invalidates existing contexts.
type Brancher ¶
type Brancher struct { // Do not run against these branches. Default is no branches. SkipBranches *ReplaceableSliceOfStrings `json:"skipBranches,omitempty"` // Only run against these branches. Default is all branches. Branches *ReplaceableSliceOfStrings `json:"branches,omitempty"` }
Brancher is for shared code between jobs that only run against certain branches. An empty brancher runs against all branches.
type ContextPolicy ¶
type ContextPolicy struct { // whether to consider unknown contexts optional (skip) or required. SkipUnknownContexts *bool `json:"skipUnknownContexts,omitempty"` RequiredContexts *ReplaceableSliceOfStrings `json:"requiredContexts,omitempty"` RequiredIfPresentContexts *ReplaceableSliceOfStrings `json:"requiredIfPresentContexts"` OptionalContexts *ReplaceableSliceOfStrings `json:"optionalContexts,omitempty"` // Infer required and optional jobs from Branch Protection configuration FromBranchProtection *bool `json:"fromBranchProtection,omitempty"` }
ContextPolicy configures options about how to handle various contexts.
type DefaultOwnersDirBlacklist ¶
type DefaultOwnersDirBlacklist struct { // Blacklist configures a default blacklist for repos (or orgs) not // specifically configured Blacklist []string `json:"default"` }
DefaultOwnersDirBlacklist is the default blacklist
type ExternalPlugin ¶
type ExternalPlugin struct { // Name of the plugin. Name *string `json:"name"` // Endpoint is the location of the external plugin. Defaults to // the name of the plugin, ie. "http://{{name}}". Endpoint *string `json:"endpoint,omitempty"` // ReplaceableSliceOfStrings are the events that need to be demuxed by the hook // server to the external plugin. If no events are specified, // everything is sent. Events *ReplaceableSliceOfStrings `json:"events,omitempty"` }
ExternalPlugin holds configuration for registering an external plugin.
type GarbageCollection ¶
type GarbageCollection struct { // Interval is how often a Garbage Collection will be performed. Defaults to one hour. Interval time.Duration `json:"-"` // PipelineAge is how old a Pipeline can be before it is garbage-collected. // Defaults to one week. PipelineAge time.Duration `json:"-"` // PodAge is how old a Pod can be before it is garbage-collected. // Defaults to one day. PodAge time.Duration `json:"-"` }
GarbageCollection defines the configuration for cleaning up pipeline related resources
type GlobalProtectionPolicy ¶
type GlobalProtectionPolicy struct { *ProtectionPolicy ProtectTested *bool `json:"protectTested,omitempty"` }
GlobalProtectionPolicy defines the default branch protection policy for the scheduler
type Heart ¶
type Heart struct { // Adorees is a list of GitHub logins for members // for whom we will add emojis to comments Adorees []string `json:"adorees,omitempty"` // CommentRegexp is the regular expression for comments // made by adorees that the plugin adds emojis to. // If not specified, the plugin will not add emojis to // any comments. // Compiles into CommentRe during config load. CommentRegexp string `json:"commentregexp,omitempty"` }
Heart contains the configuration for adding emojis
type JobBase ¶
type JobBase struct { // The name of the job. Must match regex [A-Za-z0-9-._]+ // e.g. pull-test-infra-bazel-build Name *string `json:"name"` // ReplaceableMapOfStringString are added to jobs and pods created for this job. Labels *ReplaceableMapOfStringString `json:"labels,omitempty"` // MaximumConcurrency of this job, 0 implies no limit. MaxConcurrency *int `json:"maxConcurrency,omitempty"` // Agent that will take care of running this job. Agent *string `json:"agent"` // Cluster is the alias of the cluster to run this job in. // (Default: kube.DefaultClusterAlias) Cluster *string `json:"cluster,omitempty"` // Namespace is the namespace in which pods schedule. // empty: results in scheduler.DefaultNamespace Namespace *string `json:"namespace,omitempty"` }
JobBase contains attributes common to all job types
type Lgtm ¶
type Lgtm struct { // ReviewActsAsLgtm indicates that a Github review of "approve" or "request changes" // acts as adding or removing the lgtm label ReviewActsAsLgtm *bool `json:"reviewActsAsLgtm,omitempty"` // StoreTreeHash indicates if tree_hash should be stored inside a comment to detect // squashed commits before removing lgtm labels StoreTreeHash *bool `json:"storeTreeHash,omitempty"` // WARNING: This disables the security mechanism that prevents a malicious member (or // compromised GitHub account) from merging arbitrary code. Use with caution. // // StickyLgtmTeam specifies the Github team whose members are trusted with sticky LGTM, // which eliminates the need to re-lgtm minor fixes/updates. StickyLgtmTeam *string `json:"trustedTeamForStickyLgtm,omitempty"` }
Lgtm specifies a configuration for a single lgtm. The configuration for the lgtm plugin is defined as a list of these structures.
type Merger ¶
type Merger struct { // SyncPeriod specifies how often Merger will sync jobs with Github. Defaults to 1m. SyncPeriod *time.Duration `json:"-"` // StatusUpdatePeriod StatusUpdatePeriod *time.Duration `json:"-"` // URL for status contexts. TargetURL *string `json:"targetUrl,omitempty"` // PRStatusBaseURL is the base URL for the PR status page. // This is used to link to a merge requirements overview // in the status context. PRStatusBaseURL *string `json:"prStatusBaseUrl,omitempty"` // BlockerLabel is an optional label that is used to identify merge blocking // Git Provider issues. // Leave this blank to disable this feature and save 1 API token per sync loop. BlockerLabel *string `json:"blockerLabel,omitempty"` // SquashLabel is an optional label that is used to identify PRs that should // always be squash merged. // Leave this blank to disable this feature. SquashLabel *string `json:"squashLabel,omitempty"` // MaxGoroutines is the maximum number of goroutines spawned inside the // controller to handle org/repo:branch pools. Defaults to 20. Needs to be a // positive number. MaxGoroutines *int `json:"maxGoroutines,omitempty"` // Override the default method of merge. Valid options are squash, rebase, and merge. MergeType *string `json:"mergeMethod,omitempty"` // ContextOptions defines the default merge options. If not set it will infer // the required and optional contexts from the jobs configured and use the Git Provider // combined status; otherwise it may apply the branch protection setting or let user // define their own options in case branch protection is not used. ContextPolicy *ContextPolicy `json:"policy,omitempty"` }
Merger defines the options used to merge the PR
type Owners ¶
type Owners struct { // SkipCollaborators disables collaborator cross-checks and forces both // the approve and lgtm plugins to use solely OWNERS files for access // control in the provided repos. SkipCollaborators []string `json:"skip_collaborators,omitempty"` // LabelsBlackList holds a list of labels that should not be present in any // OWNERS file, preventing their automatic addition by the owners-label plugin. // This check is performed by the verify-owners plugin. LabelsBlackList []string `json:"labels_blacklist,omitempty"` }
Owners contains configuration related to handling OWNERS files.
type Postsubmit ¶
type Postsubmit struct { *JobBase *RegexpChangeMatcher *Brancher // Context is the name of the GitHub status context for the job. Context *string `json:"context"` // Report will comment and set status on GitHub. Report *bool `json:"report,omitempty"` }
Postsubmit runs on push events.
type Postsubmits ¶
type Postsubmits struct { // Items are the post submit configurations Items []*Postsubmit // Replace the existing items Replace bool }
Postsubmits is a list of Postsubmit job configurations that can optionally completely replace the Postsubmit job configurations in the parent scheduler
type Presubmit ¶
type Presubmit struct { *JobBase *Brancher *RegexpChangeMatcher // AlwaysRun automatically for every PR, or only when a comment triggers it. By default true. AlwaysRun *bool `json:"alwaysRun"` // Context is the name of the Git Provider status context for the job. Context *string `json:"context"` // Optional indicates that the job's status context should not be required for merge. By default false. Optional *bool `json:"optional,omitempty"` // Report enables reporting the job status on the git provider Report *bool `json:"report,omitempty"` // Trigger is the regular expression to trigger the job. // e.g. `@k8s-bot e2e test this` // RerunCommand must also be specified if this field is specified. // (Default: `(?m)^/test (?:.*? )?<job name>(?: .*?)?$`) Trigger *string `json:"trigger"` // The RerunCommand to give users. Must match Trigger. // Trigger must also be specified if this field is specified. // (Default: `/test <job name>`) RerunCommand *string `json:"rerunCommand"` // Override the default method of merge. Valid options are squash, rebase, and merge. MergeType *string `json:"mergeMethod,omitempty"` Query *Query `json:query,omitempty` Policy *ProtectionPolicies `json:"policy,omitempty"` // ContextOptions defines the merge options. If not set it will infer // the required and optional contexts from the jobs configured and use the Git Provider // combined status; otherwise it may apply the branch protection setting or let user // define their own options in case branch protection is not used. ContextPolicy *RepoContextPolicy `json:"context_options,omitempty"` }
Presubmit defines a job configuration for pull requests
type Presubmits ¶
type Presubmits struct { // Items are the Presubmit configurtations Items []*Presubmit // Replace the existing items Replace bool }
Presubmits is a list of Presubmit job configurations that can optionally completely replace the Presubmit job configurations in the parent scheduler
type ProtectionPolicies ¶
type ProtectionPolicies struct { *ProtectionPolicy Replace bool Items map[string]*ProtectionPolicy }
ProtectionPolicies defines the branch protection policies
type ProtectionPolicy ¶
type ProtectionPolicy struct { // Protect overrides whether branch protection is enabled if set. Protect *bool `json:"protect,omitempty"` // RequiredStatusChecks configures github contexts RequiredStatusChecks *BranchProtectionContextPolicy `json:"requiredStatusChecks,omitempty"` // Admins overrides whether protections apply to admins if set. Admins *bool `json:"enforceAdmins,omitempty"` // Restrictions limits who can merge Restrictions *Restrictions `json:"restrictions,omitempty"` // RequiredPullRequestReviews specifies approval/review criteria. RequiredPullRequestReviews *ReviewPolicy `json:"requiredPullRequestReviews,omitempty"` }
ProtectionPolicy for merging.
type ProwConfig ¶
type ProwConfig struct { Reviewers Reviewers `yaml:"blunderbuss,omitempty"` Owners Owners `json:"owners,omitempty"` // DefaultNamespace defines the namespace to run the jobs, by default the team namespace DefaultNamespace string `yaml:"jobNamespace,omitempty"` // TODO PushGateway DefaultOwnersDirBlacklist DefaultOwnersDirBlacklist `yaml:"defaultOwnersDirBlacklist,omitempty"` GarbageCollection GarbageCollection `yaml:"garbageCollection,omitempty"` Heart Heart `yaml:"heart,omitempty"` }
ProwConfig is the Scheduler config that relates explicitly to Prow
type PullRequestMergeType ¶
type PullRequestMergeType string
PullRequestMergeType enumerates the types of merges the Git Provider API can perform https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button
const ( MergeMerge PullRequestMergeType = "merge" MergeRebase PullRequestMergeType = "rebase" MergeSquash PullRequestMergeType = "squash" )
Possible types of merges for the Git Provider merge API
type Query ¶
type Query struct { ExcludedBranches *ReplaceableSliceOfStrings `json:"excludedBranches,omitempty"` IncludedBranches *ReplaceableSliceOfStrings `json:"includedBranches,omitempty"` Labels *ReplaceableSliceOfStrings `json:"labels,omitempty"` MissingLabels *ReplaceableSliceOfStrings `json:"missingLabels,omitempty"` Milestone *string `json:"milestone,omitempty"` ReviewApprovedRequired *bool `json:"reviewApprovedRequired,omitempty"` }
Query is turned into a Git Provider search query. See the docs for details: https://help.github.com/articles/searching-issues-and-pull-requests/
type RegexpChangeMatcher ¶
type RegexpChangeMatcher struct { // RunIfChanged defines a regex used to select which subset of file changes should trigger this job. // If any file in the changeset matches this regex, the job will be triggered RunIfChanged *string `json:"runIfChanged,omitempty"` }
RegexpChangeMatcher is for code shared between jobs that run only when certain files are changed.
type ReplaceableMapOfStringContextPolicy ¶
type ReplaceableMapOfStringContextPolicy struct { Replace bool `json:"replace,omitempty"` Items map[string]*ContextPolicy }
ReplaceableMapOfStringContextPolicy is a map of context policies that can optionally completely replace any context policies defined in the parent scheduler
type ReplaceableMapOfStringString ¶
type ReplaceableMapOfStringString struct { Items map[string]string // Replace the existing items Replace bool }
ReplaceableMapOfStringString is a map of strings that can optionally completely replace the map of strings in the parent scheduler
type ReplaceableSliceOfExternalPlugins ¶
type ReplaceableSliceOfExternalPlugins struct { Replace bool Items []*ExternalPlugin }
ReplaceableSliceOfExternalPlugins is a list of external plugins that can optionally completely replace the plugins in any parent Scheduler
type ReplaceableSliceOfStrings ¶
type ReplaceableSliceOfStrings struct { // Items is the string values Items []string `json:"items,omitempty"` // Replace the existing items Replace bool `json:"replace,omitempty"` }
ReplaceableSliceOfStrings is a slice of strings that can optionally completely replace the slice of strings defined in the parent scheduler
type RepoContextPolicy ¶
type RepoContextPolicy struct { *ContextPolicy Branches *ReplaceableMapOfStringContextPolicy `json:"branches,omitempty"` }
RepoContextPolicy overrides the policy for repo, and any branch overrides.
type Restrictions ¶
type Restrictions struct { Users *ReplaceableSliceOfStrings `json:"users"` Teams *ReplaceableSliceOfStrings `json:"teams"` }
Restrictions limits who can merge Users and Teams items are appended to parent lists.
type ReviewPolicy ¶
type ReviewPolicy struct { // Restrictions appends users/teams that are allowed to merge DismissalRestrictions *Restrictions `json:"dismissalRestrictions,omitempty"` // DismissStale overrides whether new commits automatically dismiss old reviews if set DismissStale *bool `json:"dismissStaleReviews,omitempty"` // RequireOwners overrides whether CODEOWNERS must approve PRs if set RequireOwners *bool `json:"requireCodeOwnerReviews,omitempty"` // Approvals overrides the number of approvals required if set (set to 0 to disable) Approvals *int `json:"requiredApprovingReviewCount,omitempty"` }
ReviewPolicy specifies git provider approval/review criteria. Any nil values inherit the policy from the parent, otherwise bool/ints are overridden. Non-empty lists are appended to parent lists.
type Reviewers ¶
type Reviewers struct { // ReviewerCount is the minimum number of reviewers to request // reviews from. Defaults to requesting reviews from 2 reviewers // if FileWeightCount is not set. ReviewerCount *int `json:"request_count,omitempty"` // MaxReviewerCount is the maximum number of reviewers to request // reviews from. Defaults to 0 meaning no limit. MaxReviewerCount int `json:"max_request_count,omitempty"` // FileWeightCount is the maximum number of reviewers to request // reviews from. Selects reviewers based on file weighting. // This and request_count are mutually exclusive options. FileWeightCount *int `json:"file_weight_count,omitempty"` // ExcludeApprovers controls whether approvers are considered to be // reviewers. By default, approvers are considered as reviewers if // insufficient reviewers are available. If ExcludeApprovers is true, // approvers will never be considered as reviewers. ExcludeApprovers bool `json:"exclude_approvers,omitempty"` }
Reviewers defines configuration for PR review
type Scheduler ¶
type Scheduler struct { ScehdulerAgent *SchedulerAgent `json:"schedulerAgent,omitempty"` Policy *GlobalProtectionPolicy `json:"policy,omitempty"` Presubmits *Presubmits `json:"presubmits,omitempty"` Postsubmits *Postsubmits `json:"postsubmits,omitempty"` Trigger *Trigger `json:"trigger,omitempty"` Approve *Approve `json:"approve,omitempty"` LGTM *Lgtm `json:"lgtm,omitempty"` ExternalPlugins *ReplaceableSliceOfExternalPlugins `json:"externalPlugins,omitempty"` Merger *Merger `json:"merger,omitempty"` // Plugins is a list of plugin names enabled for a repo Plugins *ReplaceableSliceOfStrings `json:"plugins,omitempty"` }
TODO Support Label plugin? TODO Support Size plugin? TODO Support Welcome plugin? TODO Support Blockade plugin? TODO Support Golint plugin? TODO Support RepoMilestone plugin? TODO Support RequireMatchingLabel plugin? TODO Support Blunderbuss plugin? TODO Support Config Updater Plugin? TODO Support Owners plugin? TODO Support Heart plugin? TODO Support requiresig plugin? TODO support sigmention plugin? TODO support slack plugin? Scheduler defines the pipeline scheduler (e.g. Prow) configuration
type SchedulerAgent ¶
type SchedulerAgent struct { // Agent defines the agent used to schedule jobs, by default Prow Agent *string `json:"agent"` }
SchedulerAgent defines the scheduler agent configuration
type SchedulerLeaf ¶
SchedulerLeaf is a wrapper around Scheduler that can also store the org and repo that the scheduler is defined for
type Trigger ¶
type Trigger struct { // TrustedOrg is the org whose members' PRs will be automatically built // for PRs to the above repos. The default is the PR's org. TrustedOrg *string `json:"trustedOrg,omitempty"` // JoinOrgURL is a link that redirects users to a location where they // should be able to read more about joining the organization in order // to become trusted members. Defaults to the Github link of TrustedOrg. JoinOrgURL *string `json:"joinOrgUrl,omitempty"` // OnlyOrgMembers requires PRs and/or /ok-to-test comments to come from org members. // By default, trigger also include repo collaborators. OnlyOrgMembers *bool `json:"onlyOrgMembers,omitempty"` // IgnoreOkToTest makes trigger ignore /ok-to-test comments. // This is a security mitigation to only allow testing from trusted users. IgnoreOkToTest *bool `json:"ignoreOkToTest,omitempty"` }
Trigger specifies a configuration for a single trigger.
The configuration for the trigger plugin is defined as a list of these structures.