Repository navigation
ci(mergify): allow multi-segment branch names for dependabot - #456
Conversation
Update the branch naming regex to accept additional path segments (e.g. dependabot/cargo/pyo3-0.28.1) so dependabot PRs are not auto-closed. Signed-off-by: Chang Su <chang.s.su@oracle.com>
Summary of ChangesHello @CatherineSue, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue where Mergify's branch naming convention was too restrictive, preventing automated Dependabot pull requests from being processed. By adjusting the regular expression in the Mergify configuration, the system can now correctly identify and accept branches with multiple path segments, ensuring that dependency updates from Dependabot are no longer inadvertently blocked. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughRenames a Mergify rule and tightens its scope; relaxes the branch-name regex to allow one-or-more sub-path segments; adds a repository-specific condition; updates user-facing messages and examples to note allowed sub-paths and that non-conforming PRs will be auto-closed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
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)
Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the branch naming convention regex in the Mergify configuration to support multi-segment branch names, which is necessary for Dependabot branches. The change correctly extends the regex to allow for additional segments, aligning with the guideline for permissive branch naming conventions. I've suggested a minor simplification to the regex to make it more concise and readable by using a + quantifier instead of repeating a pattern. Overall, the change is correct and well-tested.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/mergify.yml (1)
3-22: 🧹 Nitpick | 🔵 TrivialUpdate user-facing guidance to reflect multi-segment branches.
The regex now accepts additional
/segmentparts, but the description and messages still imply exactly two segments. This can confuse users whose multi-segment branches are now valid.Proposed wording update
- description: Branch must follow <type>/<description> or <username>/<description> format + description: Branch must follow <type>/<description> or <username>/<description> format (description may include additional /segments) @@ - Please use one of the following formats: - - `<type>/<description>` — e.g. `feat/add-auth`, `fix/null-pointer` - - `<username>/<description>` — e.g. `changsu/fix-routing` + Please use one of the following formats: + - `<type>/<description>` — e.g. `feat/add-auth`, `fix/null-pointer`, `feat/api/auth` + - `<username>/<description>` — e.g. `changsu/fix-routing`, `dependabot/cargo/pyo3-0.28.1` @@ - Branch `{{head}}` does not match the required pattern: `<type>/<description>` or `<username>/<description>`. + Branch `{{head}}` does not match the required pattern: `<type>/<description>` or `<username>/<description>` (description may include `/`).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/mergify.yml around lines 3 - 22, Update the user-facing text that currently implies exactly two segments to reflect that the branch pattern allows multiple slash-separated segments: modify the description, the comment.message examples, and the post_check.summary to state that branches must be in the form `<type>/<description...>` or `<username>/<description...>` (i.e., one or more segments after the first slash), update examples to include multi-segment branches like `feat/auth/add-2fa` or `changsu/fix/routing/edge-case`, and keep the allowed types list and the conditions regex unchanged; change the explanatory note to clarify that multi-segment branches are valid.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In @.github/mergify.yml:
- Around line 3-22: Update the user-facing text that currently implies exactly
two segments to reflect that the branch pattern allows multiple slash-separated
segments: modify the description, the comment.message examples, and the
post_check.summary to state that branches must be in the form
`<type>/<description...>` or `<username>/<description...>` (i.e., one or more
segments after the first slash), update examples to include multi-segment
branches like `feat/auth/add-2fa` or `changsu/fix/routing/edge-case`, and keep
the allowed types list and the conditions regex unchanged; change the
explanatory note to clarify that multi-segment branches are valid.
5b79dcb to
a4941ed
Compare
…names Split the branch naming rule into two: internal branches are still auto-closed, while fork PRs only receive a friendly comment suggesting the convention without blocking the contribution. Signed-off-by: Chang Su <chang.s.su@oracle.com>
a4941ed to
57b115d
Compare
Description
Problem
Dependabot PRs (e.g.
dependabot/cargo/pyo3-0.28.1) use multi-segment branch names with more than one/, which the current branch naming regex rejects and auto-closes.Solution
Update the regex to allow additional path segments by appending
(/[a-z0-9._-]+)*.Changes
^[a-z0-9]([a-z0-9._-]*[a-z0-9])?/[a-z0-9._-]+$to^[a-z0-9]([a-z0-9._-]*[a-z0-9])?/[a-z0-9._-]+(/[a-z0-9._-]+)*$Test Plan
dependabot/cargo/jsonwebtoken-10.3,dependabot/cargo/toml-1.0,dependabot/cargo/rustc-hash-2.1,dependabot/cargo/pyo3-0.28.1feat/add-auth,fix/null-pointer,changsu/fix-routingmain,mybranch,FEAT/something,feat/Checklist
cargo +nightly fmtpassescargo clippy --all-targets --all-features -- -D warningspassesSummary by CodeRabbit