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 setup showing false info on incompatible global DVC #3961

Merged
merged 3 commits into from
May 23, 2023

Conversation

julieg18
Copy link
Contributor

@julieg18 julieg18 commented May 23, 2023

  • keeps section (and extension status) showing accurate information when extension encounters an incompatible version of DVC

Demo

Demo environment details: I have a MIN_CLI_VERSION of 2.58.0 (updated for test so I could easily test global DVC incompatibility), a global DVC installation of 2.57.0, and a selected python environment with no DVC.

main

image

PR

image

Part of #3878

* keeps section (and extension status) showing accurate information when extension auto selects a global version of DVC
@julieg18 julieg18 added the bug Something isn't working label May 23, 2023
@julieg18 julieg18 self-assigned this May 23, 2023
@@ -485,8 +485,9 @@ describe('run', () => {
await flushPromises()
expect(mockedWarnWithOptions).toHaveBeenCalledTimes(1)
expect(mockedWarnWithOptions).toHaveBeenCalledWith(
'The extension cannot initialize because the DVC CLI version is incompatible.',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This bug and incorrectly written test was introduced in #3784 when I simplified the discovery.ts logic.

}

setup.unsetPythonBinPath()

return processVersionDetails(
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 only set DVC as global if the found version is compatible so we shouldn't be processing global DVC version details unless we're setting DVC as global. Else we need to process python environment details.

@julieg18 julieg18 changed the title Fix DVC setup showing false info on global DVC Fix DVC setup showing false info on incompatible global DVC May 23, 2023
@julieg18 julieg18 marked this pull request as ready for review May 23, 2023 21:35
@julieg18 julieg18 requested review from mattseddon and sroy3 as code owners May 23, 2023 21:35
@mattseddon mattseddon enabled auto-merge (squash) May 23, 2023 23:14
@codeclimate
Copy link

codeclimate bot commented May 23, 2023

Code Climate has analyzed commit 3c24d4d 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% (0.0% change).

View more on Code Climate.

@mattseddon mattseddon merged commit c82b555 into main May 23, 2023
@mattseddon mattseddon deleted the fix-extension-showing-incorrect-env-info branch May 23, 2023 23:55
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