Skip to content

Commit

Permalink
docs: add docs for merge_queue
Browse files Browse the repository at this point in the history
  • Loading branch information
MXfive committed Sep 6, 2024
1 parent e959a02 commit 770e580
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 16 deletions.
4 changes: 2 additions & 2 deletions github/resource_github_repository_ruleset.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func resourceGithubRepositoryRuleset() *schema.Resource {
"grouping_strategy": {
Type: schema.TypeString,
Required: true,
Description: "When set to ALLGREEN, the merge commit created by merge queue for each PR in the group must pass all required checks to merge. When set to HEADGREEN, only the commit at the head of the merge group, i.e. the commit containing changes from all of the PRs in the group, must pass its required checks to merge. Can be one of: ALLGREEN, HEADGREEN",
Description: "When set to ALLGREEN, the merge commit created by merge queue for each PR in the group must pass all required checks to merge. When set to HEADGREEN, only the commit at the head of the merge group, i.e. the commit containing changes from all of the PRs in the group, must pass its required checks to merge. Can be one of: ALLGREEN, HEADGREEN.",
},
"max_entries_to_build": {
Type: schema.TypeInt,
Expand All @@ -282,7 +282,7 @@ func resourceGithubRepositoryRuleset() *schema.Resource {
"merge_method": {
Type: schema.TypeString,
Required: true,
Description: "Method to use when merging changes from queued pull requests. Can be one of: MERGE, SQUASH, REBASE",
Description: "Method to use when merging changes from queued pull requests. Can be one of: MERGE, SQUASH, REBASE.",
},
"min_entries_to_merge": {
Type: schema.TypeInt,
Expand Down
18 changes: 18 additions & 0 deletions website/docs/r/organization_ruleset.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ The `rules` block supports the following:

* `pull_request` - (Optional) (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see [below for nested schema](#rules.pull_request))

* `merge_queue` - (Optional) (Block List, Max: 1) Merges must be performed via a merge queue.

* `required_linear_history` - (Optional) (Boolean) Prevent merge commits from being pushed to matching branches.

* `required_signatures` - (Optional) (Boolean) Commits pushed to matching branches must have verified signatures.
Expand Down Expand Up @@ -135,6 +137,22 @@ The `rules` block supports the following:

* `negate` - (Optional) (Boolean) If true, the rule will fail if the pattern matches.

#### rules.merge_queue ####

* `check_response_timeout_minutes` - (Required) (Number)Maximum time for a required status check to report a conclusion. After this much time has elapsed, checks that have not reported a conclusion will be assumed to have failed.

* `grouping_strategy` - (Required) (String)When set to ALLGREEN, the merge commit created by merge queue for each PR in the group must pass all required checks to merge. When set to HEADGREEN, only the commit at the head of the merge group, i.e. the commit containing changes from all of the PRs in the group, must pass its required checks to merge. Can be one of: ALLGREEN, HEADGREEN.

* `max_entries_to_build` - (Required) (Number) Limit the number of queued pull requests requesting checks and workflow runs at the same time.

* `max_entries_to_merge` - (Required) (Number) Limit the number of queued pull requests requesting checks and workflow runs at the same time.

* `merge_method` - (Required) (String) Method to use when merging changes from queued pull requests. Can be one of: MERGE, SQUASH, REBASE.

* `min_entries_to_merge` - (Required) (Number) The minimum number of PRs that will be merged together in a group.

* `min_entries_to_merge_wait_minutes` - (Required) (Number) The time merge queue should wait after the first PR is added to the queue for the minimum group size to be met. After this time has elapsed, the minimum group size will be ignored and a smaller group will be merged.

#### rules.pull_request ####

* `dismiss_stale_reviews_on_push` - (Optional) (Boolean) New, reviewable commits pushed will dismiss previous pull request review approvals. Defaults to `false`.
Expand Down
34 changes: 20 additions & 14 deletions website/docs/r/repository_ruleset.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ resource "github_repository_ruleset" "example" {
required_deployment_environments = ["test"]
}
}
}
```
Expand All @@ -74,7 +74,6 @@ resource "github_repository_ruleset" "example" {

The `rules` block supports the following:


* `branch_name_pattern` - (Optional) (Block List, Max: 1) Parameters to be used for the branch_name_pattern rule. This rule only applies to repositories within an enterprise, it cannot be applied to repositories owned by individuals or regular organizations. Conflicts with `tag_name_pattern` as it only applied to rulesets with target `branch`. (see [below for nested schema](#rules.branch_name_pattern))

* `commit_author_email_pattern` - (Optional) (Block List, Max: 1) Parameters to be used for the commit_author_email_pattern rule. This rule only applies to repositories within an enterprise, it cannot be applied to repositories owned by individuals or regular organizations. (see [below for nested schema](#rules.commit_author_email_pattern))
Expand All @@ -89,6 +88,8 @@ The `rules` block supports the following:

* `non_fast_forward` - (Optional) (Boolean) Prevent users with push access from force pushing to branches.

* `merge_queue` - (Optional) (Block List, Max: 1) Merges must be performed via a merge queue.

* `pull_request` - (Optional) (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see [below for nested schema](#rules.pull_request))

* `required_deployments` - (Optional) (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see [below for nested schema](#rules.required_deployments))
Expand All @@ -102,7 +103,7 @@ The `rules` block supports the following:
* `tag_name_pattern` - (Optional) (Block List, Max: 1) Parameters to be used for the tag_name_pattern rule. This rule only applies to repositories within an enterprise, it cannot be applied to repositories owned by individuals or regular organizations. Conflicts with `branch_name_pattern` as it only applied to rulesets with target `tag`. (see [below for nested schema](#rules.tag_name_pattern))

* `update` - (Optional) (Boolean) Only allow users with bypass permission to update matching refs.

* `update_allows_fetch_and_merge` - (Optional) (Boolean) Branch can pull changes from its upstream repository. This is only applicable to forked repositories. Requires `update` to be set to `true`. Note: behaviour is affected by a known bug on the GitHub side which may cause issues when using this parameter.

#### rules.branch_name_pattern ####
Expand All @@ -115,7 +116,6 @@ The `rules` block supports the following:

* `negate` - (Optional) (Boolean) If true, the rule will fail if the pattern matches.


#### rules.commit_author_email_pattern ####

* `operator` - (Required) (String) The operator to use for matching. Can be one of: `starts_with`, `ends_with`, `contains`, `regex`.
Expand All @@ -126,7 +126,6 @@ The `rules` block supports the following:

* `negate` - (Optional) (Boolean) If true, the rule will fail if the pattern matches.


#### rules.commit_message_pattern ####

* `operator` - (Required) (String) The operator to use for matching. Can be one of: `starts_with`, `ends_with`, `contains`, `regex`.
Expand All @@ -137,7 +136,6 @@ The `rules` block supports the following:

* `negate` - (Optional) (Boolean) If true, the rule will fail if the pattern matches.


#### rules.committer_email_pattern ####

* `operator` - (Required) (String) The operator to use for matching. Can be one of: `starts_with`, `ends_with`, `contains`, `regex`.
Expand All @@ -148,6 +146,21 @@ The `rules` block supports the following:

* `negate` - (Optional) (Boolean) If true, the rule will fail if the pattern matches.

#### rules.merge_queue ####

* `check_response_timeout_minutes` - (Required) (Number)Maximum time for a required status check to report a conclusion. After this much time has elapsed, checks that have not reported a conclusion will be assumed to have failed.

* `grouping_strategy` - (Required) (String)When set to ALLGREEN, the merge commit created by merge queue for each PR in the group must pass all required checks to merge. When set to HEADGREEN, only the commit at the head of the merge group, i.e. the commit containing changes from all of the PRs in the group, must pass its required checks to merge. Can be one of: ALLGREEN, HEADGREEN.

* `max_entries_to_build` - (Required) (Number) Limit the number of queued pull requests requesting checks and workflow runs at the same time.

* `max_entries_to_merge` - (Required) (Number) Limit the number of queued pull requests requesting checks and workflow runs at the same time.

* `merge_method` - (Required) (String) Method to use when merging changes from queued pull requests. Can be one of: MERGE, SQUASH, REBASE.

* `min_entries_to_merge` - (Required) (Number) The minimum number of PRs that will be merged together in a group.

* `min_entries_to_merge_wait_minutes` - (Required) (Number) The time merge queue should wait after the first PR is added to the queue for the minimum group size to be met. After this time has elapsed, the minimum group size will be ignored and a smaller group will be merged.

#### rules.pull_request ####

Expand All @@ -161,12 +174,10 @@ The `rules` block supports the following:

* `required_review_thread_resolution` - (Optional) (Boolean) All conversations on code must be resolved before a pull request can be merged. Defaults to `false`.


#### rules.required_deployments ####

* `required_deployment_environments` - (Required) (List of String) The environments that must be successfully deployed to before branches can be merged.


#### rules.required_status_checks ####

* `required_check` - (Required) (Block Set, Min: 1) Status checks that are required. Several can be defined. (see [below for nested schema](#rules.required_status_checks.required_check))
Expand All @@ -179,8 +190,6 @@ The `rules` block supports the following:

* `integration_id` - (Optional) (Number) The optional integration ID that this status check must originate from.



#### rules.tag_name_pattern ####

* `operator` - (Required) (String) The operator to use for matching. Can be one of: `starts_with`, `ends_with`, `contains`, `regex`.
Expand All @@ -192,7 +201,6 @@ The `rules` block supports the following:
* `negate` - (Optional) (Boolean) If true, the rule will fail if the pattern matches.



#### bypass_actors ####

* `actor_id` - (Required) (Number) The ID of the actor that can bypass a ruleset.
Expand All @@ -202,13 +210,13 @@ The `rules` block supports the following:
* `bypass_mode` - (Optional) (String) When the specified actor can bypass the ruleset. pull_request means that an actor can only bypass rules on pull requests. Can be one of: `always`, `pull_request`.

~> Note: at the time of writing this, the following actor types correspond to the following actor IDs:

* `OrganizationAdmin` -> `1`
* `RepositoryRole` (This is the actor type, the following are the base repository roles and their associated IDs.)
* `maintain` -> `2`
* `write` -> `4`
* `admin` -> `5`


#### conditions ####

* `ref_name` - (Required) (Block List, Min: 1, Max: 1) (see [below for nested schema](#conditions.ref_name))
Expand All @@ -223,14 +231,12 @@ The `rules` block supports the following:

The following additional attributes are exported:


* `etag` (String)

* `node_id` (String) GraphQL global node id for use with v4 API.

* `ruleset_id` (Number) GitHub ID for the ruleset.


## Import

GitHub Repository Rulesets can be imported using the GitHub repository name and ruleset ID e.g.
Expand Down

0 comments on commit 770e580

Please sign in to comment.