Skip to content

fix(mergify): exempt release-plz PRs from CI merge protection#121

Merged
unclesp1d3r merged 2 commits into
mainfrom
fix/release-plz-merge-protection
Mar 1, 2026
Merged

fix(mergify): exempt release-plz PRs from CI merge protection#121
unclesp1d3r merged 2 commits into
mainfrom
fix/release-plz-merge-protection

Conversation

@unclesp1d3r
Copy link
Copy Markdown
Member

Summary

  • Exempt release-plz PRs (head ~= ^release-plz-) from the "CI must pass" merge protection
  • Release-plz force-pushes when updating existing PRs, and GITHUB_TOKEN-triggered pushes suppress workflow events, so CI never runs on the new HEAD — causing the merge protection to hang indefinitely (see PR chore: release v0.2.0 #111)
  • Release-plz PRs only bump versions and changelogs; the code was already tested on main. CI still runs in the merge queue as a final safety net.

Test plan

  • Verify PR chore: release v0.2.0 #111 is no longer blocked by Mergify Merge Protections after this lands
  • Verify non-release-plz PRs still require CI to pass

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings March 1, 2026 21:21
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 1, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 1, 2026

Caution

Review failed

Failed to post review comments

Summary by CodeRabbit

  • Chores
    • Updated merge protection rules to improve handling of automated release processes, with exemptions for release automation PRs.

Walkthrough

This PR modifies the .mergify.yml merge protection configuration, adjusting the regex pattern for conventional commit validation by changing backslash escaping, and adding an explicit exemption for release-plz PRs in the CI requirement protection due to their version-bumping behavior.

Changes

Cohort / File(s) Summary
Conventional Commit Regex Pattern
.mergify.yml
Modified the success_conditions regex for conventional commits, changing from double-escaped to single-escaped backslashes in the pattern.
Release-plz PR Exemption
.mergify.yml
Expanded the "CI must pass" protection description and added explicit condition to skip CI validation when PR head matches release-plz prefix, since these PRs bump versions/changelogs and may trigger force-pushes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 A hop, a skip, escapes take flight,
Single backslashes dancing right!
Release-plz hops through without a care,
CI checks wave from everywhere! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: exempting release-plz PRs from CI merge protection in Mergify configuration.
Description check ✅ Passed The description is directly related to the changeset, explaining the motivation and impact of exempting release-plz PRs from CI requirements.
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
  • Commit unit tests in branch fix/release-plz-merge-protection

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

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Mar 1, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 Enforce conventional commit

This rule is failing.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\\(.+\\))?!?:

🟢 📃 Configuration Change Requirements

Wonderful, this rule succeeded.

Mergify configuration change

  • check-success = Configuration changed

🟢 CI must pass

Wonderful, this rule succeeded.

All CI checks must pass. This protection prevents manual merges that bypass the merge queue.

  • check-success = coverage
  • check-success = quality
  • check-success = test
  • check-success = test-cross-platform (macos-latest, macOS)
  • check-success = test-cross-platform (ubuntu-22.04, Linux)
  • check-success = test-cross-platform (ubuntu-latest, Linux)
  • check-success = test-cross-platform (windows-latest, Windows)

🟢 Do not merge outdated PRs

Wonderful, this rule succeeded.

Make sure PRs are within 10 commits of the base branch before merging

  • #commits-behind <= 10

@dosubot
Copy link
Copy Markdown
Contributor

dosubot Bot commented Mar 1, 2026

Related Documentation

Checked 50 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Mar 1, 2026

🧪 CI Insights

Here's what we observed from your CI run for 67319c8.

🟢 All jobs passed!

But CI Insights is watching 👀

@coderabbitai coderabbitai Bot added testing Test infrastructure and coverage size:S This PR changes 10-29 lines, ignoring generated files. labels Mar 1, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Mar 1, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates Mergify merge protections to avoid release-plz PRs getting stuck due to GITHUB_TOKEN force-push behavior suppressing CI workflow runs, while still relying on the merge queue as the final CI gate.

Changes:

  • Exempt release-plz-* PR branches from the “CI must pass” merge protection.
  • Expand the merge protection description to document the rationale for the exemption.

Comment thread .mergify.yml
on main), and GITHUB_TOKEN-triggered force-pushes suppress CI.
if:
- base = main
- "-head ~= ^release-plz-"
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

The CI-merge-protection exemption is based solely on the branch name (head ~= ^release-plz-). That makes it easy to unintentionally (or intentionally) bypass the “CI must pass” protection by naming a branch release-plz-*, even if the PR did not come from the release-plz automation. Consider tightening the exemption to also match the PR author (the bot account used by the release-plz workflow) and/or require a bot-applied label so only genuine release-plz PRs are exempt.

Suggested change
- "-head ~= ^release-plz-"
- or:
- "-head ~= ^release-plz-"
- "-author = release-plz[bot]"

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@unclesp1d3r unclesp1d3r self-assigned this Mar 1, 2026
dosubot Bot added a commit that referenced this pull request Mar 1, 2026
@dosubot dosubot Bot mentioned this pull request Mar 1, 2026
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. size:S This PR changes 10-29 lines, ignoring generated files. labels Mar 1, 2026
@coderabbitai coderabbitai Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 1, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Mar 1, 2026
unclesp1d3r added a commit that referenced this pull request Mar 1, 2026
Update documentation for
#121

_Generated by [Dosu](https://dosu.dev)_

Co-authored-by: dosubot[bot] <131922026+dosubot[bot]@users.noreply.github.com>
Co-authored-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>
Copilot AI review requested due to automatic review settings March 1, 2026 22:27
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. size:S This PR changes 10-29 lines, ignoring generated files. labels Mar 1, 2026
@coderabbitai coderabbitai Bot added the documentation Improvements or additions to documentation label Mar 1, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Mar 1, 2026
@unclesp1d3r unclesp1d3r closed this Mar 1, 2026
@unclesp1d3r unclesp1d3r reopened this Mar 1, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread docs/src/release-process.md Outdated
Release-plz force-pushes when updating existing PRs, and
GITHUB_TOKEN-triggered pushes suppress workflow events, so CI never
runs on the new HEAD. Since release-plz PRs only bump versions and
changelogs (code was already tested on main), exempting them from
the CI merge protection avoids the hang. CI still runs in the merge
queue as a final safety net.

Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>
…egex

The regex used \\\\( in YAML which after parsing becomes \\( in the
regex engine, matching a literal backslash before the parenthesis.
This caused scoped titles like "fix(mergify): ..." to fail validation.
Change to \\( so YAML produces \( which matches a literal parenthesis.

Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>
@unclesp1d3r unclesp1d3r force-pushed the fix/release-plz-merge-protection branch from 2eda662 to 67319c8 Compare March 1, 2026 23:00
@unclesp1d3r unclesp1d3r merged commit d33d6fe into main Mar 1, 2026
30 of 33 checks passed
@unclesp1d3r unclesp1d3r deleted the fix/release-plz-merge-protection branch March 1, 2026 23:06
@github-actions github-actions Bot mentioned this pull request Mar 1, 2026
This was referenced Mar 2, 2026
mergify Bot pushed a commit that referenced this pull request Mar 2, 2026
## 🤖 New release

* `libmagic-rs`: 0.2.0 -> 0.2.1 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

## [0.2.1] - 2026-03-02

### Bug Fixes

- **mergify**: Exempt release-plz PRs from CI merge protection
([#121](#121))

### Documentation

- **readme**: Use reference-style links for badges
([#128](#128))

### Miscellaneous Tasks

- **Mergify**: Configuration update
([#124](#124))
- **Mergify**: Configuration update
([#126](#126))
- **mergify**: Streamline auto-approval and merging rules for bots
<!-- generated by git-cliff -->
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size:S This PR changes 10-29 lines, ignoring generated files. testing Test infrastructure and coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants