Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions github/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,9 @@ type UpdateRuleParameters struct {

// MergeQueueRuleParameters represents the merge_queue rule parameters.
type MergeQueueRuleParameters struct {
ActorControlledMerging bool `json:"actor_controlled_merging,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is an optional parameter, as indicated by the inclusion of omitempty, then this should be a *bool instead of a bool.

CheckResponseTimeoutMinutes int `json:"check_response_timeout_minutes"`
CheckRunRetriesLimit int `json:"check_run_retries_limit,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. This should be *int instead of int.

GroupingStrategy MergeGroupingStrategy `json:"grouping_strategy"`
MaxEntriesToBuild int `json:"max_entries_to_build"`
MaxEntriesToMerge int `json:"max_entries_to_merge"`
Expand Down
4 changes: 3 additions & 1 deletion github/rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,9 @@ func TestRepositoryRule(t *testing.T) {
&RepositoryRule{
Type: RulesetRuleTypeMergeQueue,
Parameters: &MergeQueueRuleParameters{
ActorControlledMerging: true,
CheckResponseTimeoutMinutes: 5,
CheckRunRetriesLimit: 3,
GroupingStrategy: MergeGroupingStrategyAllGreen,
MaxEntriesToBuild: 10,
MaxEntriesToMerge: 20,
Expand All @@ -700,7 +702,7 @@ func TestRepositoryRule(t *testing.T) {
MinEntriesToMergeWaitMinutes: 15,
},
},
`{"type":"merge_queue","parameters":{"check_response_timeout_minutes":5,"grouping_strategy":"ALLGREEN","max_entries_to_build":10,"max_entries_to_merge":20,"merge_method":"SQUASH","min_entries_to_merge":1,"min_entries_to_merge_wait_minutes":15}}`,
`{"type":"merge_queue","parameters":{"actor_controlled_merging":true,"check_response_timeout_minutes":5,"check_run_retries_limit":3,"grouping_strategy":"ALLGREEN","max_entries_to_build":10,"max_entries_to_merge":20,"merge_method":"SQUASH","min_entries_to_merge":1,"min_entries_to_merge_wait_minutes":15}}`,
},
{
"required_deployments",
Expand Down
Loading