Skip to content

[rebase] detect and show a dialog containing what needs to be done - #6698

Merged
iAmWillShepherd merged 13 commits into
developmentfrom
shiftkey/rebase/detect-and-show-some-ui
Feb 25, 2019
Merged

iAmWillShepherd merged 13 commits into
developmentfrom
shiftkey/rebase/detect-and-show-some-ui

Conversation

@shiftkey

@shiftkey shiftkey commented Jan 23, 2019 •

Copy link
Copy Markdown
Member

Overview

Fixes #6548

This PR has evolved to cover detecting a rebase conflict and letting the user continue or abort. It's feature-flagged for development only so the dialog won't be shown until we're ready to ship it.

Description

The two flows I want to flesh out here are:

  1. detect a rebase with conflicts done externally to Desktop
  • app should show dialog
  • dialog should block while there are conflicts
  • user can abort rebase while underway
  • if no conflicts, let user continue rebase
  1. detect when git pull --rebase raises an error (see Option to rebase instead of automatically merge when pulling from upstream #3422 for tracking issue)
  • error handling is invoked
  • dialog is shown
  • then user is in the flow from scenario 1

I'll follow up on some questions in the PR about the symmetry between Rebase conflicts and Merge conflicts as I'm thinking about them.

TODO:

  • when an error occurs that throws a RebaseConflicts error from dugite, show the dialog
  • when git status detects that a rebase is in progress, show a dialog with what needs to be done
  • show the list of files and their state
  • the abort button so the user can bail out
  • continue button is enabled when no more conflicts
  • need to stage conflicted files before continuing the rebase
  • disable pull --rebase blocker behind feature flag to enable further testing
  • add some tests
  • test flows and identify more interesting corner cases
  • add banners for warning and success
  • show warning banner when dismissing dialog, warning banner lets you return to dialog
  • show success banner after successful rebase
  • rebase conflicts dialog shows base branch (if known) and target branch
  • extract follow-up tasks as part of these changes
  • rebase on top of unify banner state in application to pay down some tech debt #6884 once that is merged

Duplicated components

  • app/src/ui/rebase/conflict-files-list.tsx has been extracted from app/src/ui/merge-conflicts/merge-conflicts-dialog.tsx and could be turned into a reusable component - I don't think I've tweaked it too much, gonna wait and see what recent changes @outofambit has been making moved to investigate unifying rebase conflicts file rendering with merge conflicts file rendering #6904
  • app/src/ui/rebase/rebase-conflicts-dialog.tsx has been heavily influenced by app/src/ui/merge-conflicts/merge-conflicts-dialog.tsx but is likely to need a different flow (in particular to show progress while a rebase is occurring in the background) so I'm fine with keeping them separate for now rather than trying to unify them and be too clever this is fine

Release notes

Notes: detect and guide user through a rebase when encountered in the app

@shiftkey shiftkey added this to the 1.7.0 milestone Jan 23, 2019
@shiftkey
shiftkey force-pushed the shiftkey/rebase/detect-and-show-some-ui branch 4 times, most recently from fbb3935 to 9f709dd Compare January 25, 2019 16:20
@shiftkey

shiftkey commented Feb 5, 2019

Copy link
Copy Markdown
Member Author

For those who are following along with this PR, I've been working on a suite of tests around rebase scenarios in this repository: https://github.com/shiftkey/rebase-test-cases

Why a separate repository?

  • using branches in active repositories is not ideal because of how they evolve over time (new commits added to branches could impact tests, branches could be merged and deleted, etc)
  • active repositories have lots of unimportant history that would be cloned down
  • creating a set of test cases means we can reuse known cases when testing and QA-ing this flow
  • we can add different cases to this repository as we identify things that Desktop needs to support

The repository is setup with a README that links off to the specific test cases, which explain in more detail what you're trying to test and how to go about it. I'll keep building on it as I test more rebase cases but please comment here if you have things that you want covered.

I eventually want to move that repository under the desktop org so it's not tied to my personal account, but for the moment it's fine there while I get things together. I also intend to enable branch protection on all branches so that you can't force push to change a test case after completing a rebase.

@shiftkey
shiftkey force-pushed the shiftkey/rebase/detect-and-show-some-ui branch 2 times, most recently from 373b371 to 8aee627 Compare February 5, 2019 21:28
@shiftkey

shiftkey commented Feb 5, 2019

Copy link
Copy Markdown
Member Author

@billygriffin @ampinsk I've updated the PR to point out some ways in which this branch differs from the designs discussed around resolving conflicts - the designs pre-date our decision to let people dismiss the dialog, and maybe we should incorporate our learnings there. Happy to discuss in detail later in the week if you want to throw ideas around.

@billygriffin

Copy link
Copy Markdown
Contributor

@shiftkey @ampinsk Thanks for the description! I agree that it'll be important for people to get into a "clean" state prior to doing other major actions (switching branches, committing, etc.). My question is whether there's a "manual mode" equivalent of what we did with regular merge conflicts, or if this is a special case where it needs to happen through something more guided. Maybe let's go through a few scenarios on a call to figure that out.

@shiftkey
shiftkey force-pushed the shiftkey/rebase/detect-and-show-some-ui branch 2 times, most recently from 3569e2d to 0d41819 Compare February 12, 2019 12:25
@shiftkey
shiftkey force-pushed the shiftkey/rebase/detect-and-show-some-ui branch from 5823199 to 709bffd Compare February 12, 2019 13:35
@shiftkey
shiftkey force-pushed the shiftkey/rebase/detect-and-show-some-ui branch from 709bffd to 5be61a2 Compare February 14, 2019 17:20
@shiftkey
shiftkey changed the base branch from development to shiftkey/rebase/state-changes February 14, 2019 18:55
@shiftkey
shiftkey force-pushed the shiftkey/rebase/detect-and-show-some-ui branch 6 times, most recently from fc620ab to 306a223 Compare February 19, 2019 21:38
@shiftkey
shiftkey changed the base branch from shiftkey/rebase/state-changes to development February 19, 2019 21:40
@shiftkey
shiftkey force-pushed the shiftkey/rebase/detect-and-show-some-ui branch from 306a223 to bf94f67 Compare February 19, 2019 22:18
@shiftkey
shiftkey force-pushed the shiftkey/rebase/detect-and-show-some-ui branch from 6bf1d27 to fa9edd3 Compare February 21, 2019 13:06
@shiftkey shiftkey added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Feb 21, 2019
@shiftkey

Copy link
Copy Markdown
Member Author

Advice for people testing out this PR - you'll need to trigger conflicts from the command line and then switch to Desktop, as the UI for this #6551 is not in scope until 1.7.0. I have some pre-canned rebase cases here which will help you to test things out yourself in the meantime: https://github.com/shiftkey/rebase-test-cases (click into each of the links on the root README)

@shiftkey

Copy link
Copy Markdown
Member Author

Marking this as time-sensitive because it's now a blocker for a number of draft PRs that I'm testing and verifying: #6907 #6913 #6914

@shiftkey
shiftkey force-pushed the shiftkey/rebase/detect-and-show-some-ui branch 2 times, most recently from 67dc8f0 to 0ef1a50 Compare February 21, 2019 21:23
@iAmWillShepherd iAmWillShepherd self-assigned this Feb 22, 2019
@shiftkey
shiftkey force-pushed the shiftkey/rebase/detect-and-show-some-ui branch from 0ef1a50 to ba24e76 Compare February 22, 2019 17:02
@shiftkey shiftkey removed the time-sensitive Pull Requests where reviews need to happen in a timely manner label Feb 22, 2019
Comment thread app/src/lib/tip.ts Resolved
@iAmWillShepherd
iAmWillShepherd merged commit 7d72dab into development Feb 25, 2019
@shiftkey
shiftkey deleted the shiftkey/rebase/detect-and-show-some-ui branch March 26, 2019 21:18
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.

3 participants