PR timeline renders "deleted the branch <default>" after a stacked-PR base auto-retarget, although the default branch was never deleted #198570
Replies: 1 comment
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🏷️ Discussion Type
Bug
Body
What happened
In a private repo I had two stacked pull requests:
feature-2→ basedevelopmentfeature-3→ basefeature-2(stacked on PR A)PR A was merged into
developmentwith "Automatically delete head branches" enabled, sofeature-2was auto-deleted. GitHub then auto-retargeted PR B's base fromfeature-2todevelopment(automatic_base_change_succeeded) and auto-closed PR B. I reopened it.PR B's timeline then shows an event reading " deleted the branch development" — implying the default/protected branch
developmentwas deleted.Root cause (from the timeline API)
The underlying event is
base_ref_deleted, and that event object carries NO ref/branch field at all (keys: actor, commit_id, commit_url, created_at, event, id, node_id, performed_via_github_app). The sequence, one second apart:05:43:59Z base_ref_deleted (real deletion: the OLD base / feature branch)
05:44:00Z automatic_base_change_succeeded (base retargeted feature-2 -> development)
05:44:00Z closed
Because base_ref_deleted stores no historical ref, the UI renders "deleted the branch X" using the PR's CURRENT base ref — which the auto-retarget had just changed to
development. So the label names a branch that was never deleted. The branch actually deleted was the old base (feature branch).Why it's a problem
developmentis the default, protected branch. A "deleted" event for it is alarming and triggered a needless incident check. The bug: base_ref_deleted is rendered against the live base ref instead of the historical deleted ref.Expected
Name the branch actually deleted (the old base), or describe the auto-retarget without a "deleted the branch " line for a branch that still exists. Never claim a branch was deleted when it's still present.
Reproduction
Evidence the base branch was NOT deleted
Only the old-base feature branch was deleted by the auto-delete cleanup.
Beta Was this translation helpful? Give feedback.
All reactions