Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion extension/src/cli/dvc/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Plot } from '../../plots/webview/contract'

export const MIN_CLI_VERSION = '2.58.1'
export const LATEST_TESTED_CLI_VERSION = '2.58.2'
export const MAX_CLI_VERSION = '3'

type ErrorContents = { type: string; msg: string }

Expand Down
9 changes: 2 additions & 7 deletions extension/src/cli/dvc/version.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
LATEST_TESTED_CLI_VERSION,
MAX_CLI_VERSION,
MIN_CLI_VERSION
} from './contract'
import { LATEST_TESTED_CLI_VERSION, MIN_CLI_VERSION } from './contract'

export enum CliCompatible {
NO_CANNOT_VERIFY = 'no-cannot-verify',
Expand Down Expand Up @@ -38,13 +34,12 @@ const checkCLIVersion = (currentSemVer: {
patch: minPatch
} = extractSemver(MIN_CLI_VERSION) as ParsedSemver

const isAheadMaxVersion = currentMajor >= Number(MAX_CLI_VERSION)
const isBehindMinVersion =
currentMajor < minMajor ||
currentMinor < minMinor ||
(currentMinor === minMinor && currentPatch < Number(minPatch))

if (isAheadMaxVersion || isBehindMinVersion) {
if (isBehindMinVersion) {
return CliCompatible.NO_INCOMPATIBLE
}

Expand Down
21 changes: 0 additions & 21 deletions extension/src/setup/runner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,27 +514,6 @@ describe('run', () => {
expect(mockedInitialize).not.toHaveBeenCalled()
})

it('should send a specific message to the user if the located CLI is a major version ahead', async () => {
const MajorAhead = MIN_CLI_VERSION.split('.')
.map(num => Number(num) + 100)
.join('.')
mockedGetFirstWorkspaceFolder.mockReturnValueOnce(mockedCwd)
mockedShouldWarnUserIfCLIUnavailable.mockReturnValueOnce(true)
mockedIsPythonExtensionUsed.mockResolvedValueOnce(true)
mockedGetCliVersion.mockResolvedValueOnce(MajorAhead)

await run(setup)
await flushPromises()
expect(mockedWarnWithOptions).toHaveBeenCalledTimes(1)
expect(mockedWarnWithOptions).toHaveBeenCalledWith(
'The extension cannot initialize because the DVC CLI version is incompatible.',
'Setup'
)
expect(mockedGetCliVersion).toHaveBeenCalledTimes(1)
expect(mockedResetMembers).toHaveBeenCalledTimes(1)
expect(mockedInitialize).not.toHaveBeenCalled()
})

it('should send a specific message to the user if the Python extension is being used, the CLI is not available in the virtual environment and no cli is found globally', async () => {
mockedGetFirstWorkspaceFolder.mockReturnValueOnce(mockedCwd)
mockedHasRoots.mockReturnValueOnce(true)
Expand Down