Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Branch ¶
type Branch struct {
Policy
}
Branch holds protection policy overrides for a particular branch.
type Config ¶
type Config struct { Policy // ProtectTested determines if branch protection rules are set for all repos // that Prow has registered jobs for, regardless of if those repos are in the // branch protection config. ProtectTested bool `json:"protect-tested-repos,omitempty"` // Orgs holds branch protection options for orgs by name Orgs map[string]Org `json:"orgs,omitempty"` // AllowDisabledPolicies allows a child to disable all protection even if the // branch has inherited protection options from a parent. AllowDisabledPolicies bool `json:"allow_disabled_policies,omitempty"` // AllowDisabledJobPolicies allows a branch to choose to opt out of branch protection // even if Prow has registered required jobs for that branch. AllowDisabledJobPolicies bool `json:"allow_disabled_job_policies,omitempty"` }
Config specifies the global branch protection policy
type ContextPolicy ¶
type ContextPolicy struct { // Contexts appends required contexts that must be green to merge Contexts []string `json:"contexts,omitempty"` // Strict overrides whether new commits in the base branch require updating the PR if set Strict *bool `json:"strict,omitempty"` }
ContextPolicy configures required github contexts. When merging policies, contexts are appended to context list from parent. Strict determines whether merging to the branch invalidates existing contexts.
type Org ¶
Org holds the default protection policy for an entire org, as well as any repo overrides.
type Policy ¶
type Policy struct { // Protect overrides whether branch protection is enabled if set. Protect *bool `json:"protect,omitempty"` // RequiredStatusChecks configures github contexts RequiredStatusChecks *ContextPolicy `json:"required_status_checks,omitempty"` // Admins overrides whether protections apply to admins if set. Admins *bool `json:"enforce_admins,omitempty"` // Restrictions limits who can merge Restrictions *Restrictions `json:"restrictions,omitempty"` // RequiredPullRequestReviews specifies github approval/review criteria. RequiredPullRequestReviews *ReviewPolicy `json:"required_pull_request_reviews,omitempty"` // Exclude specifies a set of regular expressions which identify branches // that should be excluded from the protection policy Exclude []string `json:"exclude,omitempty"` }
Policy for the config/org/repo/branch. When merging policies, a nil value results in inheriting the parent policy.
type Repo ¶
Repo holds protection policy overrides for all branches in a repo, as well as specific branch overrides.
type Restrictions ¶
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:"dismissal_restrictions,omitempty"` // DismissStale overrides whether new commits automatically dismiss old reviews if set DismissStale *bool `json:"dismiss_stale_reviews,omitempty"` // RequireOwners overrides whether CODEOWNERS must approve PRs if set RequireOwners *bool `json:"require_code_owner_reviews,omitempty"` // Approvals overrides the number of approvals required if set (set to 0 to disable) Approvals *int `json:"required_approving_review_count,omitempty"` }
ReviewPolicy specifies github 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.