Skip to content

Commit

Permalink
Remove max version of CLI (3.0 release)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon committed Jun 6, 2023
1 parent dd7eac8 commit ba483ae
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 29 deletions.
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

0 comments on commit ba483ae

Please sign in to comment.