Skip to content

Comments

ci: add Mergify merge queue config#135

Merged
nobodyiam merged 1 commit intoapolloconfig:mainfrom
nobodyiam:codex/add-mergify-config
Feb 19, 2026
Merged

ci: add Mergify merge queue config#135
nobodyiam merged 1 commit intoapolloconfig:mainfrom
nobodyiam:codex/add-mergify-config

Conversation

@nobodyiam
Copy link
Member

@nobodyiam nobodyiam commented Feb 19, 2026

What's the purpose of this PR

Add a .mergify.yml for apollo-java so PR merge queue behavior is consistent with apolloconfig/apollo, while adapting conditions to this repository's main branch and current CI job names.

Which issue(s) this PR fixes:

Fixes #N/A (repository infrastructure improvement, no linked issue)

Brief changelog

  • add .mergify.yml with single-commit (rebase) and multi-commit (squash) queue rules
  • require successful checks for current apollo-java workflows/jobs (compile-matrix JDK matrix, integration/compat jobs, license, CLAssistant)
  • add conflict notification comment rule for open PRs

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Read the Contributing Guide before making this pull request.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit tests to verify the code.
  • Run mvn clean test to make sure this pull request doesn't break anything.
  • Update the CHANGES log.

Summary by CodeRabbit

  • Chores
    • Configured automated merge queue management to optimize pull request processing and enforce consistent merge strategies based on commit requirements.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
Mergify Configuration
.mergify.yml
Adds merge queue setup with max_parallel_checks=1, defines two queue rules (single-commit with rebase merge and multi-commit with squash merge), and a pull_request_rule to notify authors when conflicts exist.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Hops of joy, the merge queue springs,
With Mergify's automated wings,
Single commits rebase clean,
Multi squash, a tidy scene,
Conflicts warned, the flow now sings! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: add Mergify merge queue config' accurately describes the main change—adding Mergify configuration for merge queue management. It is concise, specific, and clearly summarizes the primary modification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.96%. Comparing base (d4b76f8) to head (5d7f53b).
⚠️ Report is 25 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.mergify.yml (1)

73-79: Duplicate conflict comments may be posted on repeated Mergify evaluations.

The comment action in Mergify's pull_request_rules does not deduplicate by default — it posts a new comment on every evaluation cycle where conflict and -closed are 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.

@nobodyiam nobodyiam merged commit c89320a into apolloconfig:main Feb 19, 2026
17 checks passed
@nobodyiam nobodyiam deleted the codex/add-mergify-config branch February 19, 2026 09:14
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant