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

Add upgrade dvc button to setup when incompatible #3904

Merged
merged 12 commits into from
May 18, 2023

Conversation

julieg18
Copy link
Contributor

@julieg18 julieg18 commented May 16, 2023

Demo

Screen.Recording.2023-05-18.at.8.57.10.AM.mov

Part of #3434

@julieg18 julieg18 added the product PR that affects product label May 16, 2023
@julieg18 julieg18 self-assigned this May 16, 2023
root: string,
pythonBinPath: string
): Thenable<unknown> =>
Toast.showProgress('Upgrading DVC', async progress => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We might not need a progress bar since's it's essentially going from 0 to 100. I kept it since it looked good when I was testing but we also could just show two toasts, "Upgrading DVC" and "Upgraded Successfully" 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Take a look at this:

return Toast.showProgress('exp push', async progress => {
progress.report({ increment: 0 })
progress.report({ increment: 25, message: `Pushing ${ids.join(' ')}...` })
const remainingProgress = 75
const stdout = await internalCommands.executeCommand(
AvailableCommands.EXP_PUSH,
dvcRoot,
...ids
)
progress.report({
increment: remainingProgress,
message: convertUrlTextToLink(stdout)
})
return Toast.delayProgressClosing(15000)
})

Can start by making a small increment and then updating again afterwards. That gives the impression to the user that something is happening. Doesn't have to be super accurate until he have a way to give discrete progress updates.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated! Looks better, thanks :)

@julieg18 julieg18 marked this pull request as ready for review May 16, 2023 16:56
@julieg18 julieg18 requested review from mattseddon and sroy3 as code owners May 16, 2023 16:56
@julieg18 julieg18 requested a review from shcheklein May 16, 2023 16:57
@julieg18 julieg18 enabled auto-merge (squash) May 17, 2023 20:45
@mattseddon mattseddon disabled auto-merge May 17, 2023 20:49
await Toast.runCommandAndIncrementProgress(
async () => {
await installPackages(root, pythonBinPath, 'dvc')
return 'Upgraded successfully'
Copy link
Member

Choose a reason for hiding this comment

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

The assumption here is that the user used pip to install DVC which isn't necessarily true. I think this is fine but we should add a quantifier to the button as an interim solution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The assumption here is that the user used pip to install DVC which isn't necessarily true. I think this is fine but we should add a quantifier to the button as an interim solution.

Good idea! I'll be opening an issue soon detailing what can be improved with how we handle the installation of DVC and will be sure to mention this. Out of scope, but we should probably add a quantifier to our "Install" button as well. Same issue with it assuming the use of pip.

const conditionalContents = canUpgrade ? (
<>
<div className={styles.sideBySideButtons}>
<Button onClick={upgradeDvc} text="Upgrade" />
Copy link
Member

Choose a reason for hiding this comment

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

perhaps just add (pip) i.e Upgrade (pip)

@julieg18 julieg18 enabled auto-merge (squash) May 18, 2023 14:18
@codeclimate
Copy link

codeclimate bot commented May 18, 2023

Code Climate has analyzed commit ebba807 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (85% is the threshold).

This pull request will bring the total coverage in the repository to 95.0%.

View more on Code Climate.

@julieg18 julieg18 merged commit ec22bcd into main May 18, 2023
@julieg18 julieg18 deleted the add-upgrade-button-to-dvc-setup branch May 18, 2023 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR that affects product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants