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

Fix dvc details version incorrectly showing "Not Found" #3787

Merged
merged 6 commits into from
May 1, 2023

Conversation

julieg18
Copy link
Contributor

@julieg18 julieg18 commented Apr 28, 2023

  • has getDvcCliDetails() rely on a version variable instead of calling getCliVersion

Possibly will fix the bug mentioned in #3434 (comment)

@julieg18 julieg18 added the bug Something isn't working label Apr 28, 2023
@julieg18 julieg18 self-assigned this Apr 28, 2023
return {
command,
version: cwd ? await this.getCliVersion(cwd) : undefined
version: version || (await this.getCliVersion(cwd, true))
Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Member

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.

Copy link
Member

@mattseddon mattseddon May 1, 2023

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

Copy link
Contributor Author

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.

@julieg18 julieg18 marked this pull request as ready for review April 28, 2023 23:05
@julieg18 julieg18 requested a review from shcheklein April 28, 2023 23:05
@@ -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)
Copy link
Contributor Author

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.

Copy link
Contributor Author

@julieg18 julieg18 left a 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

@mattseddon mattseddon enabled auto-merge (squash) May 1, 2023 23:30
@codeclimate
Copy link

codeclimate bot commented May 1, 2023

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.

@mattseddon mattseddon merged commit e2ee91c into main May 1, 2023
@mattseddon mattseddon deleted the fix-dvc-details-version-bug branch May 1, 2023 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants