Skip to content

warn before rebase if operation requires a force push - #7242

Merged
niik merged 22 commits into
developmentfrom
warn-before-rebase
Apr 12, 2019
Merged

niik merged 22 commits into
developmentfrom
warn-before-rebase

Conversation

@shiftkey

@shiftkey shiftkey commented Apr 8, 2019 •

Copy link
Copy Markdown
Member

Overview

Closes #6963

Description

  • wireup UI to show when rebase
  • plug in user preference to warn about force push
  • implement logic to if remote branch has commits that will be rebased
  • use Branch shape rather than string as this contains the relevant tracking branch
  • update tests to use Branch rather than string

Release notes

Notes: no-notes

@shiftkey shiftkey added this to the 1.7.0 milestone Apr 8, 2019
@billygriffin

Copy link
Copy Markdown
Contributor

I know we've been iterating on the verbiage here throughout the design process, but wanted to offer alternate verbiage since it's been awhile since I've looked at it.

Since this is a pre-emptive warning and everything currently exists locally, I think maybe the force pushing and the rewriting history on the remote should be reversed in the second sentence. A possible alternative:

Are you sure you want to rebase [branch] onto [branch]?

In order to push this branch to your remote branch, you will need to force push the branch after the rebase is complete. That will alter the history on the remote and potentially cause problems for others collaborating on this branch.

I don't love my proposed language. But overall, my goals here are to 1. make it more human-readable, and 2. help folks understand why it might be a problem and why we're warning them.

@shiftkey

shiftkey commented Apr 8, 2019

Copy link
Copy Markdown
Member Author

@billygriffin yep, I'm totally 👍 to iterating on the messaging here. I'll pull in your suggestion and see what we can come up with while we're working on this.

@shiftkey

shiftkey commented Apr 8, 2019

Copy link
Copy Markdown
Member Author

@billygriffin I've updated the PR description with the latest copy - let me know if you have any additional ideas or suggestions.

@shiftkey
shiftkey marked this pull request as ready for review April 8, 2019 17:41
@shiftkey shiftkey added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 8, 2019
@tierninho

Copy link
Copy Markdown
Contributor

Two things I noticed while testing this:

  • The "dont show me this" toggle does not appear to be working in sync with the Pref option.
  • When you navigate away from Desktop and return to the app, the dialogue will disappear. (When I returned I clicked this area just in case)

image

Otherwise, all looks good.

@shiftkey

shiftkey commented Apr 8, 2019

Copy link
Copy Markdown
Member Author

When you navigate away from Desktop and return to the app, the dialogue will disappear. (When I returned I clicked this area just in case)

Fixed in 6b851fba11749b16cf8d8cb3eec0a1a9ddad5d40 - turns out we had an eager refactor in #7209 that meant we were always trying to cleanup the rebase flow, even when it was in a state that no conflicts were occurring.

@shiftkey
shiftkey force-pushed the warn-before-rebase branch from 6b851fb to bd5d6ac Compare April 8, 2019 20:34
@shiftkey

shiftkey commented Apr 8, 2019

Copy link
Copy Markdown
Member Author

The "dont show me this" toggle does not appear to be working in sync with the Pref option.

Fixed in 78bc057e9e46d73f1c44712aaab1dd309444d9ec - not sure what I meant to put in there but clearly it wasn't working.

@shiftkey
shiftkey force-pushed the warn-before-rebase branch from 19ae9fb to 14160c2 Compare April 8, 2019 20:56
billygriffin
billygriffin previously approved these changes Apr 8, 2019

@billygriffin billygriffin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy looks great now, thanks! Approving just that portion. 😄

@billygriffin
billygriffin requested a review from a team April 8, 2019 21:26
@tierninho

Copy link
Copy Markdown
Contributor

Thanks. Both issues fixed with the latest commits 👍

One clarifying question though: from a UX perspective if I check the "dont show me again" option but decide to hit the Cancel button, should my preference be saved? My expectation would be yes, but we are treating the Continue rebase button as a save button.

@billygriffin

Copy link
Copy Markdown
Contributor

Re: @tierninho's comment above

One clarifying question though: from a UX perspective if I check the "dont show me again" option but decide to hit the Cancel button, should my preference be saved? My expectation would be yes, but we are treating the Continue rebase button as a save button.

I think my expectation is that if you click "Cancel" that the checkbox state for the warning would not be saved because you haven't really affirmatively committed to anything yet.

Separately, this dialog appears before you begin a rebase, right? Should we consider having that button say "Begin rebase" instead of "Continue rebase"?

@tierninho

Copy link
Copy Markdown
Contributor

I think my expectation is that if you click "Cancel" that the checkbox state for the warning would not be saved because you haven't really affirmatively committed to anything yet.

My thought was: "I don't want to see this message and I understand the risks" is a separate from "I don't want to proceed force pushing this one instance". No strong feelings on this as it could go either way. 🤷‍♂️

Separately, this dialog appears before you begin a rebase, right? Should we consider having that button say "Begin rebase" instead of "Continue rebase"?

Hard to say, as the user has already selected the menu option "Rebase current branch...", chosen a branch, and clicked "Rebase X onto X" button. I have the same stance as above. We can use "Beginuing" button 😆

@shiftkey

shiftkey commented Apr 8, 2019

Copy link
Copy Markdown
Member Author

@billygriffin @tierninho

I think my expectation is that if you click "Cancel" that the checkbox state for the warning would not be saved because you haven't really affirmatively committed to anything yet.

Just to reiterate - this is only updated when you "continue" - cancelling will not trigger updating this:

private onContinueRebase = async () => {
this.props.dispatcher.setConfirmForcePushSetting(
this.state.askForConfirmationOnForcePush
)

Should we consider having that button say "Begin rebase" instead of "Continue rebase"?

We don't say "Begin" or "Start" when choosing the branch:

I still prefer changing this to "Begin rebase" because the corresponding action is not "Abort rebase" (which suggests the rebase is underway) but "Cancel" which suggests it's easier to bail out now.

@billygriffin

Copy link
Copy Markdown
Contributor

Thanks @shiftkey! I think we're aligned on both of those things then. I made the suggestion to change "Continue" to "Begin," but wasn't sure if any of the function names should change for clarity.

@shiftkey shiftkey added the time-sensitive Pull Requests where reviews need to happen in a timely manner label Apr 11, 2019
@shiftkey

Copy link
Copy Markdown
Member Author

Added time-sensitive on this because I'd like to get this out with the next beta

@niik niik self-assigned this Apr 11, 2019
@shiftkey

Copy link
Copy Markdown
Member Author

Refreshed the screenshot in the PR description with the latest changes

@shiftkey
shiftkey requested review from billygriffin and niik April 11, 2019 15:41
@shiftkey shiftkey removed the time-sensitive Pull Requests where reviews need to happen in a timely manner label Apr 11, 2019
@niik
niik merged commit d467f31 into development Apr 12, 2019
@niik
niik deleted the warn-before-rebase branch April 12, 2019 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[rebase] warn the user when the rebase will result in a force push

4 participants