Skip to content

fix(stack): prevent push from deleting branches of similarly-named stacks#1027

Merged
mergify[bot] merged 1 commit intomainfrom
devs/sileht/wrong-delete-branch/Ia6735c769299e47991e5df91a596305d41fc49ec
Mar 13, 2026
Merged

fix(stack): prevent push from deleting branches of similarly-named stacks#1027
mergify[bot] merged 1 commit intomainfrom
devs/sileht/wrong-delete-branch/Ia6735c769299e47991e5df91a596305d41fc49ec

Conversation

@sileht
Copy link
Member

@sileht sileht commented Mar 13, 2026

Add trailing slash to GitHub search query head: filter to use exact
stack prefix matching. Without it, head:bybye prefix-matches both
bybye/... and bybye-v2/... branches, causing the orphan detection
to incorrectly delete branches and close PRs from other stacks.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

Copilot AI review requested due to automatic review settings March 13, 2026 07:08
@mergify mergify bot had a problem deploying to Mergify Merge Protections March 13, 2026 07:08 Failure
@mergify
Copy link
Contributor

mergify bot commented Mar 13, 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,})

@mergify
Copy link
Contributor

mergify bot commented Mar 13, 2026

🧪 CI Insights

Here's what we observed from your CI run for 0e36adb.

🟢 All jobs passed!

But CI Insights is watching 👀

@mergify mergify bot requested a review from a team March 13, 2026 07:10
Copy link

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

This PR addresses an important correctness issue in the stack push flow where GitHub’s head: search filter can prefix-match similarly named stacks (e.g., bybye/... vs bybye-v2/...), leading to incorrect orphan detection and unintended branch deletions/PR closures.

Changes:

  • Update the GitHub Search API query to use head:<stack_prefix>/ to narrow matches to the intended stack namespace.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sileht sileht marked this pull request as ready for review March 13, 2026 07:15
…acks

Add trailing slash to GitHub search query `head:` filter to use exact
stack prefix matching. Without it, `head:bybye` prefix-matches both
`bybye/...` and `bybye-v2/...` branches, causing the orphan detection
to incorrectly delete branches and close PRs from other stacks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change-Id: Ia6735c769299e47991e5df91a596305d41fc49ec
@sileht sileht force-pushed the devs/sileht/wrong-delete-branch/Ia6735c769299e47991e5df91a596305d41fc49ec branch from a9ebc7d to 0e36adb Compare March 13, 2026 07:32
@mergify mergify bot deployed to Mergify Merge Protections March 13, 2026 07:33 Active
@mergify mergify bot requested a review from a team March 13, 2026 08:35
@mergify mergify bot merged commit 87134d3 into main Mar 13, 2026
11 checks passed
@mergify
Copy link
Contributor

mergify bot commented Mar 13, 2026

Merge Queue Status

  • Entered queue2026-03-13 09:06 UTC · Rule: default
  • Checks passed · in-place
  • Merged2026-03-13 09:06 UTC · at 0e36adb7137bd1696f452838bcf6a1e531941319

This pull request spent 7 seconds in the queue, including 1 second running CI.

Required conditions to merge

@mergify mergify bot deleted the devs/sileht/wrong-delete-branch/Ia6735c769299e47991e5df91a596305d41fc49ec branch March 13, 2026 09:06
@mergify mergify bot added queued and removed queued labels Mar 13, 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