-
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
Fix dvc details version incorrectly showing "Not Found" #3787
Conversation
extension/src/setup/index.ts
Outdated
return { | ||
command, | ||
version: cwd ? await this.getCliVersion(cwd) : undefined | ||
version: version || (await this.getCliVersion(cwd, true)) |
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.
Looking at the discovery.ts
code, we check for the version, then check for a global version. Our function that gets DVC CLI details, however, wasn't checking for a global.
This could possibly be why Ivan was seeing Version: Not Found
but the section was saying DVC Incompatible
.
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.
Why not save the version when setup gets run instead of recreating the logic here?
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.
I had a quick look at the code and potentially setCliCompatible
in Setup
could be passed the version/undefined, it could then set both the version and cliCompatible
. The version can then be passed to the webview without having to call this.getCliVersion
each time.
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.
I assume the current behaviour is why we are calling dvc version
all of the time too:
Screen.Recording.2023-05-01.at.12.25.15.pm.mov
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.
Thanks for the ideas, Matt! Updated the code to use a variable for version.
@@ -579,7 +578,6 @@ suite('Setup Test Suite', () => { | |||
mockRunSetup.restore() | |||
stub(config, 'isPythonExtensionUsed').returns(false) | |||
stub(config, 'getPythonBinPath').resolves(join('python')) | |||
stub(setup, 'getDvcCliDetails').resolves(undefined) |
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.
With getDvcCliDetails
no longer calling getDvcVersion
, we can delete related stubs.
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.
Ready for another round of reviews! cc @mattseddon, @sroy3
Code Climate has analyzed commit c46303f 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 94.6% (0.0% change). View more on Code Climate. |
getDvcCliDetails()
rely on a version variable instead of callinggetCliVersion
Possibly will fix the bug mentioned in #3434 (comment)