Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Aug 11, 2022

What changed

  • when a stack is partially merged, a stack sync call will now auto-rebase onto the trunk commit tc
    • if tc is the HEAD of trunk, then we simply reparent to trunk
    • if tc is not the HEAD of trunk, then we create a new branch with its HEAD at tc and reparent to that branch so that stacks continue to work as normal
  • added new client pull request functions that access the commit oid for both the standard MERGE case, as well as the FAST FORWARD case.
  • added new GetClient function that lazy inits the GitHub client with sync.Once - switched all functions to use this method but left the old NewClient method present if we need it for some reason.

Testing

Ran the following as a test:

  • locally created a stack with three branches stacked on each other: Screen Shot 2022-08-17 at 4 25 58 PM
  • ran stack submit to create PRs for the full stack: Screen Shot 2022-08-17 at 4 23 36 PM
  • ran /aviator stack merge on the second PR in the stack leaving the 3rd PR needing to be reparented: Screen Shot 2022-08-17 at 4 28 58 PM
  • locally ran stack sync and saw the 3rd PR in the stack get auto-rebased: Screen Shot 2022-08-17 at 4 34 52 PM
  • this also updated the local state: Screen Shot 2022-08-17 at 4 39 53 PM
  • ran git push --force-with-lease origin mq-test-619133-3 manually because this wasn't yet part of the auto-rebase process (although it now has been added as a step in the code)
  • ran stack submit and correctly see the PR updated to be on top of main: Screen Shot 2022-08-17 at 4 53 49 PM

Alec Stewart added 4 commits August 10, 2022 15:46
…trunk-commit parent-

branch current-branch'; added trunk commit information to the branch meta data so that we can more easily find when a PR has been merged in; also moved the skip sync logic on merged branch to always happen not just on no-fetch=false
… head of trunk then

we make a new trunk branch so that branch/stack behavior continues to work as expected
@ghost ghost requested review from doratzeng, jainankit and twavv August 11, 2022 06:18
…ously was not exhaustive (even if it actually was and it is really just that the compiler can't tell)
Copy link
Contributor

@twavv twavv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think reparenting is maybe not quite the right approach here (at least semantically). I think a "vanilla rebase" is going to be a simpler thing to do (at least conceptually). Happy to elaborate more if that's not totally clear.

Copy link
Contributor

@twavv twavv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Few minor comments. I assume you've tested this.

Alec Stewart added 2 commits August 17, 2022 17:24
…ate again - did operation out explicitly rather than calling function
@ghost ghost added the mergequeue label Aug 17, 2022
@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 17, 2022

Aviator status

Aviator will automatically update this comment as the status of the PR changes.

This PR was merged using Aviator.

@aviator-app aviator-app bot merged commit 68a958e into master Aug 17, 2022
@aviator-app aviator-app bot deleted the MER-1008-stack-sync-auto-rebase-after-merge branch August 17, 2022 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant