fix(stack): normalize --branch by stripping prefix and change ID suffix#1124
Conversation
|
This pull request is part of a stack:
|
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 👀 Review RequirementsWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 ReviewsWonderful, this rule succeeded.
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
9c0cedb to
8283aec
Compare
e3e2952 to
7b916b5
Compare
8283aec to
28ab25b
Compare
5d97975 to
fe99c6c
Compare
28ab25b to
b1037ab
Compare
b1037ab to
07ee4d1
Compare
|
@JulianMaurin this pull request is now in conflict 😩 |
07ee4d1 to
ec16796
Compare
There was a problem hiding this comment.
Pull request overview
Enables mergify stack checkout --branch to accept full head ref strings by normalizing the input branch (stripping configured prefix and Change-Id suffix) before building the GitHub search query.
Changes:
- Add Change-Id suffix regex constant and reuse it across stack modules.
- Normalize
--branchinstack_checkout()by removing/I<40-hex>suffix and optional configured prefix. - Add parametrized test coverage for branch normalization behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| mergify_cli/tests/stack/test_checkout.py | Adds tests asserting --branch normalization affects the GitHub search query as expected |
| mergify_cli/stack/push.py | Reuses shared Change-Id suffix regex when detecting local “generated” branches |
| mergify_cli/stack/checkout.py | Implements branch normalization before computing stack_branch |
| mergify_cli/stack/changes.py | Introduces shared Change-Id pattern constants/regexes (including suffix regex) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@JulianMaurin this pull request is now in conflict 😩 |
ec16796 to
14e4449
Compare
Allow `stack checkout --branch` to accept a full head ref name (e.g. `devs/user/MRGFY-6797/Ibb431d...`) by automatically stripping the branch prefix and change ID suffix before building the search query. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Change-Id: Ibd331d1dd37808970e75cbcda26f36ff64a51b32
14e4449 to
45ff546
Compare
Merge Queue Status
This pull request spent 3 minutes 8 seconds in the queue, including 2 minutes 54 seconds running CI. Required conditions to merge
|
Allow
stack checkout --branchto accept a full head ref name(e.g.
devs/user/MRGFY-6797/Ibb431d...) by automatically strippingthe branch prefix and change ID suffix before building the search query.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com