ci: add Mergify merge queue config#135
Conversation
📝 WalkthroughWalkthroughThis pull request adds a Mergify configuration file that defines automated merge queue rules for single-commit and multi-commit pull requests with different merge strategies, along with a notification rule for PR conflicts. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #135 +/- ##
============================================
+ Coverage 68.68% 70.96% +2.28%
- Complexity 1503 1632 +129
============================================
Files 212 224 +12
Lines 6396 6727 +331
Branches 647 679 +32
============================================
+ Hits 4393 4774 +381
+ Misses 1673 1601 -72
- Partials 330 352 +22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.mergify.yml (1)
73-79: Duplicate conflict comments may be posted on repeated Mergify evaluations.The
commentaction in Mergify'spull_request_rulesdoes not deduplicate by default — it posts a new comment on every evaluation cycle whereconflictand-closedare both true. If a PR stays conflicted across multiple pushes to the base branch, the author can receive multiple identical notifications.A common mitigation is to add a label-gate: set a label on first notification and gate on its absence, clearing it when the conflict resolves.
✏️ Suggested label-gated conflict notification
+pull_request_rules: + - name: label PR when conflicts are detected + conditions: + - "conflict" + - "-closed" + - "-label=conflict" + actions: + label: + add: + - conflict + comment: + message: "@{{author}} This pull request has conflicts with the target branch. Please resolve them and update the branch before merging." + + - name: remove conflict label when conflicts are resolved + conditions: + - "-conflict" + - "label=conflict" + actions: + label: + remove: + - conflict🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.mergify.yml around lines 73 - 79, The current Mergify rule "notify author when PR has conflicts" posts duplicate comments because it runs every evaluation; update the rule to gate on a label (e.g., "conflict-notified") being absent and, in the rule's actions, add that label when posting the comment (use add_label) so the comment is posted only once; also create a complementary rule that matches when the PR no longer has the "conflict" condition but does have the "conflict-notified" label and remove that label (use remove_label) so notifications can be sent again if conflicts reappear.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.mergify.yml:
- Around line 73-79: The current Mergify rule "notify author when PR has
conflicts" posts duplicate comments because it runs every evaluation; update the
rule to gate on a label (e.g., "conflict-notified") being absent and, in the
rule's actions, add that label when posting the comment (use add_label) so the
comment is posted only once; also create a complementary rule that matches when
the PR no longer has the "conflict" condition but does have the
"conflict-notified" label and remove that label (use remove_label) so
notifications can be sent again if conflicts reappear.
What's the purpose of this PR
Add a
.mergify.ymlforapollo-javaso PR merge queue behavior is consistent withapolloconfig/apollo, while adapting conditions to this repository'smainbranch and current CI job names.Which issue(s) this PR fixes:
Fixes #N/A (repository infrastructure improvement, no linked issue)
Brief changelog
.mergify.ymlwithsingle-commit(rebase) andmulti-commit(squash) queue rulesapollo-javaworkflows/jobs (compile-matrixJDK matrix, integration/compat jobs,license,CLAssistant)Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean testto make sure this pull request doesn't break anything.CHANGESlog.Summary by CodeRabbit