Improve PR stacking with better branch naming and enqueue logic#44
Open
EliSchleifer wants to merge 4 commits intomainfrom
Open
Improve PR stacking with better branch naming and enqueue logic#44EliSchleifer wants to merge 4 commits intomainfrom
EliSchleifer wants to merge 4 commits intomainfrom
Conversation
Lower PRs in a stack target another PR's branch, so they can't merge on their own until the tip is resolved. Skip enqueuing them to avoid churning the merge queue with PRs that have no path to main.
When merge.trigger = comment and a generated stack has depth > 1, the tip PR now receives `/trunk stack --title "Stack of #A, #B, ..."` instead of the default merge comment. The title lists every PR in the stack in bottom-to-top order so reviewers and tooling can see the whole chain. Solo PRs (depth == 1) and non-Comment triggers are unaffected.
|
🚫 This pull request was requested to be canceled by Eli Schleifer (a GitHub user), so it was removed from the merge queue. See more details here.
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR enhances the PR stacking workflow by improving branch naming conventions, refining the enqueue logic for stacked PRs, and adding better tracking of PR numbers across stack operations.
Key Changes
Branch naming: Changed from
change/pr{number}-{words}tochange/{first-word}-{HHMM}format using local wall time, making branch names more readable and independent of PR numbershead_branch_from_first_word()andslug_for_branch_segment()helper functions with comprehensive slug normalizationImproved enqueue logic for stacks:
enqueue()to accept optionalstack_prsparameter/trunk stack --title "Stack of #A, #B, ..."instead of the default merge commentBetter PR number tracking:
get_last_pr()to fetch up to 5000 PRs and find the maximum number, rather than just taking the first resultPR title formatting:
[main] words)[stack 1/3] words) without the generated branch name, reducing noiseStack management improvements:
Import addition: Added
Localto chrono imports for local time formattingImplementation Details
stack_prsvector tracks PRs created in bottom-to-top order within each stackLocal::now().format("%H%M")for timestamp, making them human-readable and time-based rather than number-basedhttps://claude.ai/code/session_01MJFJjPjFSY9H4MsvDLU6hY