ci: fix merge queue ruleset payload#5050
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5050 +/- ##
=========================================
Coverage 42.80% 42.81%
- Complexity 2205 2206 +1
=========================================
Files 1045 1045
Lines 40119 40119
Branches 4239 4239
=========================================
+ Hits 17172 17176 +4
+ Misses 21879 21877 -2
+ Partials 1068 1066 -2
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Additional investigation on the remaining
|
|
Follow-up validation update: I retested the ruleset API on Results:
Conclusion: the updated #5050 payload supports |
What changes were proposed in this PR?
This PR is a follow-up to #5036 to keep enabling GitHub merge queue while making the ruleset payload accepted by the GitHub repository rulesets API after ASF Infra reported validation errors for the rules array.
Merge queue support:
merge_queuerule in.asf.yaml; this PR does not remove or disable merge queue.Merge Queue.ALLGREEN, and a 30-minute check response timeout.Payload compatibility changes:
source_typeandsourcefrom the raw ruleset payload because they are response fields and are not needed in the create request body.allowed_merge_methods: [squash]to thepull_requestrule so the pull request rule explicitly matches the repository merge policy.do_not_enforce_on_createfrom therequired_status_checksrule to keep the payload aligned with the asfyaml raw ruleset example.integration_id: -1from required status checks because direct GitHub API validation rejected-1as an invalid integration id, while omitting the field is accepted.Validation notes:
merge_queue, which appears to be because merge queue is only available for organization-owned repositories.Texera/Udonusing theYicong-Huangadmin account.merge_queueruleset was created successfully onTexera/Udonand deleted immediately afterward.Merge Queue, was also created successfully as a disabled ruleset onTexera/Udonand deleted immediately afterward.merge_queuein an org-owned repository context.Any related issues, documentation, discussions?
Related to #4553 and follow-up to #5036.
How was this PR tested?
Ran local configuration checks:
ruby -e 'require "yaml"; cfg=YAML.load_file(".asf.yaml"); rs=cfg.dig("github", "rulesets").find { |r| r["name"] == "Merge Queue" }; abort "missing ruleset" unless rs; abort "unexpected source fields" if rs.key?("source_type") || rs.key?("source"); pr=rs["rules"].find { |r| r["type"] == "pull_request" }; abort "missing allowed_merge_methods" unless pr.dig("parameters", "allowed_merge_methods") == ["squash"]; status=rs["rules"].find { |r| r["type"] == "required_status_checks" }; abort "unexpected do_not_enforce_on_create" if status["parameters"].key?("do_not_enforce_on_create"); abort "unexpected integration_id" if status["parameters"]["required_status_checks"].any? { |c| c.key?("integration_id") }; puts "ruleset sanity ok"' git diff --checkAlso validated against the GitHub repository rulesets API on
Texera/Udon:merge_queueruleset.Merge Queue.No automated runtime tests were added because this PR only changes repository configuration.
Was this PR authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex (GPT-5)