-
Notifications
You must be signed in to change notification settings - Fork 29
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
Conversation
root: string, | ||
pythonBinPath: string | ||
): Thenable<unknown> => | ||
Toast.showProgress('Upgrading DVC', async progress => { |
There was a problem hiding this comment.
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" 🤔
There was a problem hiding this comment.
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:
vscode-dvc/extension/src/experiments/commands/index.ts
Lines 58 to 77 in e95cc0e
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated! Looks better, thanks :)
await Toast.runCommandAndIncrementProgress( | ||
async () => { | ||
await installPackages(root, pythonBinPath, 'dvc') | ||
return 'Upgraded successfully' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" /> |
There was a problem hiding this comment.
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)
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. |
Demo
Screen.Recording.2023-05-18.at.8.57.10.AM.mov
Part of #3434