Skip to content

Commit 845532d

Browse files
committed
feat: add default values for merge_queue on rulesets
1 parent 735da67 commit 845532d

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

github/resource_github_repository_ruleset.go

+14-7
Original file line numberDiff line numberDiff line change
@@ -262,44 +262,51 @@ func resourceGithubRepositoryRuleset() *schema.Resource {
262262
"check_response_timeout_minutes": {
263263
Type: schema.TypeInt,
264264
Optional: true,
265+
Default: 60,
265266
ValidateDiagFunc: toDiagFunc(validation.IntBetween(0, 360), "check_response_timeout_minutes"),
266-
Description: "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.",
267+
Description: "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. Defaults to `60`.",
267268
},
268269
"grouping_strategy": {
269270
Type: schema.TypeString,
270271
Optional: true,
272+
Default: "ALLGREEN",
271273
ValidateDiagFunc: toDiagFunc(validation.StringInSlice([]string{"ALLGREEN", "HEADGREEN"}, false), "grouping_strategy"),
272-
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.",
274+
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. Defaults to `ALLGREEN`.",
273275
},
274276
"max_entries_to_build": {
275277
Type: schema.TypeInt,
276278
Optional: true,
279+
Default: 5,
277280
ValidateDiagFunc: toDiagFunc(validation.IntBetween(0, 100), "max_entries_to_merge"),
278-
Description: "Limit the number of queued pull requests requesting checks and workflow runs at the same time.",
281+
Description: "Limit the number of queued pull requests requesting checks and workflow runs at the same time. Defaults to `5`.",
279282
},
280283
"max_entries_to_merge": {
281284
Type: schema.TypeInt,
282285
Optional: true,
286+
Default: 5,
283287
ValidateDiagFunc: toDiagFunc(validation.IntBetween(0, 100), "max_entries_to_merge"),
284-
Description: "The maximum number of PRs that will be merged together in a group.",
288+
Description: "The maximum number of PRs that will be merged together in a group. Defaults to `5`.",
285289
},
286290
"merge_method": {
287291
Type: schema.TypeString,
288292
Optional: true,
293+
Default: "MERGE",
289294
ValidateDiagFunc: toDiagFunc(validation.StringInSlice([]string{"MERGE", "SQUASH", "REBASE"}, false), "merge_method"),
290-
Description: "Method to use when merging changes from queued pull requests. Can be one of: MERGE, SQUASH, REBASE.",
295+
Description: "Method to use when merging changes from queued pull requests. Can be one of: MERGE, SQUASH, REBASE. Defaults to `MERGE`.",
291296
},
292297
"min_entries_to_merge": {
293298
Type: schema.TypeInt,
294299
Optional: true,
300+
Default: 1,
295301
ValidateDiagFunc: toDiagFunc(validation.IntBetween(0, 100), "min_entries_to_merge"),
296-
Description: "The minimum number of PRs that will be merged together in a group.",
302+
Description: "The minimum number of PRs that will be merged together in a group. Defaults to `1`.",
297303
},
298304
"min_entries_to_merge_wait_minutes": {
299305
Type: schema.TypeInt,
300306
Optional: true,
307+
Default: 5,
301308
ValidateDiagFunc: toDiagFunc(validation.IntBetween(0, 360), "min_entries_to_merge_wait_minutes"),
302-
Description: "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.",
309+
Description: "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. Defaults to `5`.",
303310
},
304311
},
305312
},

website/docs/r/repository_ruleset.html.markdown

+7-7
Original file line numberDiff line numberDiff line change
@@ -148,19 +148,19 @@ The `rules` block supports the following:
148148

149149
#### rules.merge_queue ####
150150

151-
* `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.
151+
* `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. Defaults to `60`.
152152

153-
* `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.
153+
* `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. Defaults to `ALLGREEN`.
154154

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

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

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

161-
* `min_entries_to_merge` - (Required) (Number) The minimum number of PRs that will be merged together in a group.
161+
* `min_entries_to_merge` - (Required) (Number) The minimum number of PRs that will be merged together in a group. Defaults to `1`.
162162

163-
* `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.
163+
* `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. Defaults to `5`.
164164

165165
#### rules.pull_request ####
166166

0 commit comments

Comments
 (0)