Skip to content

Add option to retry cloning upon thrown clone errors - #7080

Merged
outofambit merged 16 commits into
desktop:developmentfrom
Daniel-McCarthy:Add-Option-To-Retry-Cloning
Apr 30, 2020
Merged

outofambit merged 16 commits into
desktop:developmentfrom
Daniel-McCarthy:Add-Option-To-Retry-Cloning

Conversation

@Daniel-McCarthy

@Daniel-McCarthy Daniel-McCarthy commented Mar 13, 2019 •

Copy link
Copy Markdown
Member

Overview

Closes #926

Description

  • Handles thrown clone errors and displays popup to show error and offer to retry or dismiss.

image
image

Note: Although the functionality of this pull request does not depend on it, testing the HostDown cloning error will not be possible until Issue #7057 is resolved and merged into this branch.
Update: Dugite has been updated and the development branch has been merged into this PR. This should now be able to be tested appropriately with the HostDown error.

Release notes

Notes: Adds ability to retry cloning when error is shown.

@billygriffin billygriffin added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Mar 13, 2019
@tierninho

Copy link
Copy Markdown
Contributor

Tested this and the fix looks nice. Only tested a misspelled URL though, with hostdown pending the dugite update.

Not sure if I prefer the "flashing lights" animation between the foreground and background ... but not hung up on it. A wider modal would cover up the background animation.
Mar-14-2019 14-53-02

@Daniel-McCarthy

Copy link
Copy Markdown
Member Author

@tierninho That is definitely a good point. I can certainly widen the popup dialog.
Part of this is due to the fact that I have it set up to close the dialog then initiate attempting to retry cloning (Instead of closing it after cloning is complete).

The reason I chose to do this is because it did not seem preferable to have this dialog up during the entire cloning process.

amber888-star
amber888-star previously approved these changes Oct 1, 2019

@amber888-star amber888-star left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approve

A dialog is being created for handling cloning errors and giving the user an opportunity to retry a clone.

This defines the popup type that will be used for creating and showing a Retry Clone dialog.
Previously if a clone failed and returned a git error such as when failing due to connection issues, a git error was presented directly to the user.

These errors are not great for the user as they are intimidating and potentially confusing or vague.

This dialog will display to the user that cloning has failed and if possible, offer them the chance to retry cloning.
Previously the RetryCloneDialog has been added as well as the RetryClone popup type.

Now, so that the dialog can be used, we are connecting the App.tsx to create a RetryCloneDialog when it recieves a RetryClone Popup.
Added handler to catch errors thrown due to attempting to clone with no internet connection. If this error is thrown, it will be caught, and a new user facing error will be displayed.

The new error will be passed into the retry clone dialog.
An error handler for git clone connection errors. Now the handler has been registered to be used in conjunction with the existing handlers, giving it a chance to check if it is a match for any thrown errors.
Previously a new error message was used to replace the existing Git Clone Connection error. However, in an effort to make this handler more generic and be able to used for any clone errors, we will send in the error message itself to be used in the dialog.
Since this error handler is becoming a generic git clone error handler intended to pass clone errors to a retry dialog, it is no longer valuable to have errors that don't have a retryAction available.

Those errors will instead be thrown with the default error handler since they don't gain value from the retry dialog.
The retry clone dialog has become more multi-purpose. Instead of replacing errors and showing it's own text, it now will display the error text directly. It will display any clone failure error and offer to retry cloning if applicable.

If there is no retry error, the retry dialog will not be used, and that error will instead be passed to the default handler.

Messages are no longer optional as well. However, if the message contains no text it will use a fallback text.
Previously this handler was designed to only work with the HostDown dugite clone error.

However, the purpose has shifted to make retrying a clone for any type of clone error that is thrown.

The function will escape by returning the error immediately if the retryAction (if any) is not a Clone retryAction.

This should allow throwing up the retry popup only when an error is a clone error and has the ability to retry.
Previously this error handler was intended for the HostDown dugite error. However it has since been made more general, and the name of the handler should match.
Added a background color to distinguish the repository name from the rest of the text.
Added more styling to distinguish the repository name from the rest of the text. This has been made to match the styling for the repository name in the URL tab of the Clone Repository dialog.
The Ref component exists for the purpose done with the added styling.
Therefore this can be simplified and improve reuse by importing and using the ref component.
Previously the dialogue used the ButtonGroup, but it has since been replaced with the OkCancelButtonGroup. This section has been updated to reflect this.
Previously the button component was being used in conjunction with the ButtonGroup. However the ButtonGroup has been replaced with the OkCancelButtonGroup which does not require including the Button component externally.
@outofambit
outofambit force-pushed the Add-Option-To-Retry-Cloning branch from 0878ee5 to 1e30379 Compare April 30, 2020 00:05

@outofambit outofambit 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.

this looks good! thank you @Daniel-McCarthy and apologies for the glacial pace we've had to get this in. 💙

@outofambit
outofambit merged commit 70d5273 into desktop:development Apr 30, 2020
@Daniel-McCarthy
Daniel-McCarthy deleted the Add-Option-To-Retry-Cloning branch April 30, 2020 00:33
@Daniel-McCarthy

Copy link
Copy Markdown
Member Author

That's great news! No worries at all, thanks for taking on the PR for review!

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.

Provide a better error message and give users the option to retry a failed clone

6 participants