-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Output stack graph to PR bodies #264
Conversation
…odule Move stack utils to separate module
…scription Support writing stack to PR description
Write out stack on sync
Exclude branches on other trees
Current Aviator status
This PR was closed without merging. If you still want to merge this PR, re-open it.
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
FlexReview SummaryBased on the code complexity and the author's expertise score, these are the suggested reviewers:
See the list of alternate reviewers in the detailed breakdown below. Detailed BreakdownAuthor’s expertise score for the modified files:
† Indicates that the file doesn't need an expert review. (?) See full breakdown of the reviewers on the Aviator webapp. |
Oops - not ready for review yet. Goal is to bring this CLI on par with https://github.com/ejoffe/spr, https://github.com/facebook/sapling, https://github.com/VirtusLab/git-machete, etc. if that's something the maintainers are interested in. |
@oleg-codaio thanks for putting this together 🙏 I think it'll be easier if you break this down into smaller changes for review. After all we are working on stacked PRs :) Let me know if you need any help. |
Sounds good! I can send out smaller PRs once I've had a chance to address some issues and dogfood the feature more. However, do stacked PRs work properly across forks? I don't think there's a way to submit (at least not now) PRs using |
You are right, it won't work well with forked repo. Feel free to continue on this change or separate out if you find a logical way to segment. We can take a look when you are ready. |
Yep. It's hard to replicate what current |
Sounds good! One other thing - instead of having the stack at the bottom of the PR, we could also have it on the top in a collapsable Any preference on one or the other, or providing an option for the user to pick their preference? |
It's fine in any cases. Please pick one. If there's a FR for choosing another way, we can add a configuration for the style. |
@@ -78,7 +78,7 @@ var commitAmendCmd = &cobra.Command{ | |||
// Even if it's not configured, there's no need to fetch/push | |||
state.Config.NoFetch = true | |||
state.Config.NoPush = true | |||
err = actions.SyncStack(ctx, repo, client, tx, branchesToSync, state) | |||
err = actions.SyncStack(ctx, repo, client, tx, branchesToSync, state, actions.WithLocalOnly()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split this out into #266.
No functional changes. Move `buildTree()` and other helper functions to a new `stackutils` module, and export `BuildStackTree()` from there. We'll later reuse `buildStackTree()` there to construct the tree of nodes needed for the stack to be written to PR bodies. See #264 for context.
As part of adding support for including the stack in PR bodies (see #264), we'll need to extend templating support to handle more than one section: ``` <!-- av pr stack begin --> { stack here } <!-- av pr stack end --> Here is the main PR body description. ``` The current `ParsePRMetadata()` implementation is efficient, but makes it hard to support another section. This PR updates `ParsePRMetadata` and `AddPRMetadata` to instead make use of substrings and `strings.Builder`. Performance isn't really a concern here - these PR bodies aren't that big and we spend a lot more time interacting with the `git` CLI anyway.
Closing; most of the changes have been merged in and this is the final one: #271 |
When creating/updating/syncing stacks, also include the latest stack of changes in each pull request description. This essentially replicates the
av stack tree
visualization in PRs:This is off by default and can be enabled via
pullRequest.writeStack
(for those not yet using a merge queue).Work in progress
av stack sync
to include the current stack in all open PR descriptionsav pr create
to include the current stackav pr create
doesn't include itself until re-syncav stack submit
doesn't include the stack