Skip to content
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

refactor(stack sync): Don't pass StackSyncFlags to actions.SyncStack #136

Merged

Conversation

twavv
Copy link
Contributor

@twavv twavv commented May 26, 2023

Just found this bug while doing some stuff locally.

@aviator-app
Copy link
Contributor

aviator-app bot commented May 26, 2023

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged using Aviator.


See the real-time status of this PR on the Aviator webapp.

@twavv twavv requested review from draftcode and ohcnivek May 26, 2023 15:27
@draftcode
Copy link
Contributor

If we do this, shouldn't we remove the individual fetches?

@twavv twavv force-pushed the travis/mer-2353-av-cli-stack-sync-should-fetch-first branch from 18fa0f1 to 4eb9951 Compare May 26, 2023 18:37
@twavv
Copy link
Contributor Author

twavv commented May 26, 2023

Oh hmmm... I think this actually is not the right fix. I think as part of @ohcnivek's refactor in #122, we no longer read the flags correctly in StackSync (we take it from the state instead of the flags). I can fix that though.

}
)

func WithSkipNextCommit() SyncStackOpt {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not 100% on this but I thought doing the functional option style was a better choice than putting it in the state (since the state gets persisted to disk, but --skip is fundamentally a one-time thing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Using this style seems to me too much for internal package, but if you want to use this sure.

@@ -149,7 +149,7 @@ func ReparentSkipContinue(
}

if output.ExitCode != 0 && strings.Contains(string(output.Stderr), "no rebase in progress") {
// If there's no rebase, assume the user did `git rebase --continue/--skip` manually.
// If there's no rebase, assume the user did `git rebase --continue/--skipNextCommit` manually.
Copy link
Contributor

Choose a reason for hiding this comment

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

There's no such option like --skipNextCommit.

@@ -633,7 +633,7 @@ func ParsePRMetadata(
return
}

// This will skip over any data lines (since those weren't consumed by buf,
// This will skipNextCommit over any data lines (since those weren't consumed by buf,
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is a mistake.

@@ -27,7 +27,7 @@ type PushOpts struct {
Force ForceOpt
// If true, require the corresponding branch exist on the remote (otherwise, don't push).
SkipIfRemoteBranchNotExist bool
// If true, skip pushing the branch if the corresponding branch on the remote points to the
// If true, skipNextCommit pushing the branch if the corresponding branch on the remote points to the
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a mistake.

@@ -24,7 +24,9 @@ type SyncBranchOpts struct {
// If specified, synchronize the branch against the latest version of the
// trunk branch. This value is ignored if the branch is not a stack root.
ToTrunk bool
Skip bool
// If true, skipNextCommit the current commit.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a mistake. s/skipNextCommit/skip/

}
)

func WithSkipNextCommit() SyncStackOpt {
Copy link
Contributor

Choose a reason for hiding this comment

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

Using this style seems to me too much for internal package, but if you want to use this sure.

@twavv twavv changed the title fix(stack sync): Fetch from remote during av stack sync fix(stack sync): Fix fetching merge commit from remote May 26, 2023
@twavv twavv changed the title fix(stack sync): Fix fetching merge commit from remote refactor(stack sync): Don't pass StackSyncFlags to actions.SyncStack May 26, 2023
@aviator-app aviator-app bot merged commit 6ac3167 into master May 26, 2023
@aviator-app aviator-app bot deleted the travis/mer-2353-av-cli-stack-sync-should-fetch-first branch May 26, 2023 21:02
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.

3 participants