-
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
Simplify DVC CLI Location/Version Logic #3784
Conversation
import { getFirstWorkspaceFolder } from '../../vscode/workspaceFolders' | ||
import { delay } from '../../util/time' | ||
import { SetupSection } from '../../setup/webview/contract' | ||
|
||
const warnWithSetupAction = async ( |
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.
Current possible options are:
Version not found:
An error was thrown when trying to access the CLI.
buttons: Setup, Don't Show Again
Version can not be verified:
The extension cannot initialize as we were unable to verify the DVC CLI version.
Button: Setup
Version is found but it's not up to date:
The extension cannot initialize because you are using the wrong version of the CLI
Buttons: Setup
Version is found but it's too far ahead:
The extension cannot initialize because you are using the wrong version of the extension.
Button: Setup
What do we think? Should the toasts be more/less simplified?
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 Toasts:
Version not found:
An error was thrown when trying to access the CLI.
buttons: Setup, Don't Show Again
Version can not be verified:
The extension cannot initialize as we were unable to verify the DVC CLI version.
Button: Setup
Version behind or ahead
The extension cannot initialize because the DVC CLI version is incompatible.
Button: Setup
e05c8f4
to
4b1f4a7
Compare
) | ||
} | ||
|
||
export const warnAheadOfLatestTested = (): void => { | ||
const warnAheadOfLatestTested = (): void => { | ||
void Toast.warnWithOptions( | ||
`The located DVC CLI is at least a minor version ahead of the latest version the extension was tested with (${LATEST_TESTED_CLI_VERSION}). This could lead to unexpected behaviour. Please upgrade to the most recent version of the extension and reload this window.` |
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.
Left this toast alone for now since we don't have any info on the latest tested cli version in Setup yet. Once we update our DVC Setup page (task is in #3434 list), we can simplify this one or remove entirely.
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.
let's aim to remove it
) | ||
} | ||
|
||
export const warnAheadOfLatestTested = (): void => { | ||
const warnAheadOfLatestTested = (): void => { | ||
void Toast.warnWithOptions( | ||
`The located DVC CLI is at least a minor version ahead of the latest version the extension was tested with (${LATEST_TESTED_CLI_VERSION}). This could lead to unexpected behaviour. Please upgrade to the most recent version of the extension and reload this window.` |
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.
let's aim to remove it
Code Climate has analyzed commit b7dcf84 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 95.2% (85% is the threshold). This pull request will bring the total coverage in the repository to 94.7% (0.0% change). View more on Code Climate. |
Demo
Note: Toast and extension button are hard to see in the demo since they're at the bottom of the screen 😅
https://user-images.githubusercontent.com/43496356/235555040-3615e203-d6df-45ef-b9f5-630a589b183e.movhttps://user-images.githubusercontent.com/43496356/235725878-10c11d86-e6ed-439d-8102-c4c38523a4e5.movScreen.Recording.2023-05-03.at.9.18.38.AM.mov
Part of #3434