Skip to content

fix(stack): normalize --branch by stripping prefix and change ID suffix#1124

Merged
mergify[bot] merged 1 commit intomainfrom
devs/JulianMaurin/fix/stack-checkout-repository-default/Ibd331d1dd37808970e75cbcda26f36ff64a51b32
Apr 10, 2026
Merged

fix(stack): normalize --branch by stripping prefix and change ID suffix#1124
mergify[bot] merged 1 commit intomainfrom
devs/JulianMaurin/fix/stack-checkout-repository-default/Ibd331d1dd37808970e75cbcda26f36ff64a51b32

Conversation

@JulianMaurin
Copy link
Copy Markdown
Contributor

@JulianMaurin JulianMaurin commented Apr 10, 2026

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

@JulianMaurin
Copy link
Copy Markdown
Contributor Author

JulianMaurin commented Apr 10, 2026

This pull request is part of a stack:

  1. fix(stack): normalize --branch by stripping prefix and change ID suffix (#1124) 👈

@mergify mergify bot had a problem deploying to Mergify Merge Protections April 10, 2026 12:17 Failure
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 10, 2026

Merge Protections

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

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 👀 Review Requirements

Wonderful, this rule succeeded.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

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)(?:\(.+\))?:

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

@JulianMaurin JulianMaurin force-pushed the devs/JulianMaurin/fix/stack-checkout-repository-default/Ibd331d1dd37808970e75cbcda26f36ff64a51b32 branch from 9c0cedb to 8283aec Compare April 10, 2026 12:22
@JulianMaurin JulianMaurin force-pushed the devs/JulianMaurin/fix/stack-checkout-repository-default/Ia877c5731f169267d4285b8f5997f802f44298c9 branch from e3e2952 to 7b916b5 Compare April 10, 2026 12:22
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 10, 2026 12:22 Failure
@JulianMaurin JulianMaurin force-pushed the devs/JulianMaurin/fix/stack-checkout-repository-default/Ibd331d1dd37808970e75cbcda26f36ff64a51b32 branch from 8283aec to 28ab25b Compare April 10, 2026 12:26
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 10, 2026 12:26 Failure
@mergify mergify bot requested a review from a team April 10, 2026 12:28
@JulianMaurin JulianMaurin force-pushed the devs/JulianMaurin/fix/stack-checkout-repository-default/Ia877c5731f169267d4285b8f5997f802f44298c9 branch from 5d97975 to fe99c6c Compare April 10, 2026 12:31
@JulianMaurin JulianMaurin force-pushed the devs/JulianMaurin/fix/stack-checkout-repository-default/Ibd331d1dd37808970e75cbcda26f36ff64a51b32 branch from 28ab25b to b1037ab Compare April 10, 2026 12:31
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 10, 2026 12:31 Failure
@JulianMaurin JulianMaurin force-pushed the devs/JulianMaurin/fix/stack-checkout-repository-default/Ibd331d1dd37808970e75cbcda26f36ff64a51b32 branch from b1037ab to 07ee4d1 Compare April 10, 2026 12:38
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 10, 2026 12:39 Failure
Base automatically changed from devs/JulianMaurin/fix/stack-checkout-repository-default/Ia877c5731f169267d4285b8f5997f802f44298c9 to main April 10, 2026 13:40
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 10, 2026

@JulianMaurin this pull request is now in conflict 😩

@mergify mergify bot added the conflict label Apr 10, 2026
Copilot AI review requested due to automatic review settings April 10, 2026 13:54
@JulianMaurin JulianMaurin force-pushed the devs/JulianMaurin/fix/stack-checkout-repository-default/Ibd331d1dd37808970e75cbcda26f36ff64a51b32 branch from 07ee4d1 to ec16796 Compare April 10, 2026 13:54
@mergify mergify bot removed the conflict label Apr 10, 2026
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 10, 2026 13:55 Failure
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

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 --branch in stack_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 JulianMaurin marked this pull request as ready for review April 10, 2026 13:58
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 10, 2026

@JulianMaurin this pull request is now in conflict 😩

@mergify mergify bot added the conflict label Apr 10, 2026
@JulianMaurin JulianMaurin force-pushed the devs/JulianMaurin/fix/stack-checkout-repository-default/Ibd331d1dd37808970e75cbcda26f36ff64a51b32 branch from ec16796 to 14e4449 Compare April 10, 2026 14:22
@mergify mergify bot removed the conflict label Apr 10, 2026
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 10, 2026 14:23 Failure
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
@JulianMaurin JulianMaurin force-pushed the devs/JulianMaurin/fix/stack-checkout-repository-default/Ibd331d1dd37808970e75cbcda26f36ff64a51b32 branch from 14e4449 to 45ff546 Compare April 10, 2026 14:34
@mergify mergify bot deployed to Mergify Merge Protections April 10, 2026 14:34 Active
@mergify mergify bot requested a review from a team April 10, 2026 14:53
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 10, 2026

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

mergify bot added a commit that referenced this pull request Apr 10, 2026
@mergify mergify bot added the queued label Apr 10, 2026
@mergify mergify bot merged commit eb9ce79 into main Apr 10, 2026
11 checks passed
@mergify mergify bot deleted the devs/JulianMaurin/fix/stack-checkout-repository-default/Ibd331d1dd37808970e75cbcda26f36ff64a51b32 branch April 10, 2026 18:31
@mergify mergify bot removed the queued label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants