Skip to content
Draft
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
2 changes: 1 addition & 1 deletion cliv2-private/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ require (
github.com/snyk/cli-extension-os-flows v0.0.0-20260617143547-fe76369c867a // indirect
github.com/snyk/cli-extension-sbom v0.0.0-20260428131356-48881c6270fa // indirect
github.com/snyk/cli-extension-secrets v0.0.0-20260619070019-764c5c87eda3 // indirect
github.com/snyk/code-client-go v1.27.5 // indirect
github.com/snyk/code-client-go v1.28.0 // indirect
github.com/snyk/container-cli v0.0.0-20260213211631-cd2b2cf8f3ea // indirect
github.com/snyk/dep-graph/go v0.0.0-20260127160647-c836da762c62 // indirect
github.com/snyk/error-catalog-golang-public v0.0.0-20260505112649-a5103d411663 // indirect
Expand Down
4 changes: 2 additions & 2 deletions cliv2-private/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,8 @@ github.com/snyk/cli-extension-sbom v0.0.0-20260428131356-48881c6270fa h1:9GSKXrR
github.com/snyk/cli-extension-sbom v0.0.0-20260428131356-48881c6270fa/go.mod h1:SJ624HENWG4yjM6jNuLebTeNsMriozf1LcKhMYVm1aY=
github.com/snyk/cli-extension-secrets v0.0.0-20260619070019-764c5c87eda3 h1:wBYQm4YP65FTZ4rZ0iunhsIUYBindUEnfRWRi+Rugag=
github.com/snyk/cli-extension-secrets v0.0.0-20260619070019-764c5c87eda3/go.mod h1:D/Bk0EH8np/d6c1tG7wazpHI6iU9m8KzxytFcIQkEvQ=
github.com/snyk/code-client-go v1.27.5 h1:fog+j64VKoj5TH/sGehJ5AXe52q7LpOJtKEhwQrcXx4=
github.com/snyk/code-client-go v1.27.5/go.mod h1:SdASBkLVYjmY4PSm8A65XHW5mRph2ktGKwdE6n2Fci0=
github.com/snyk/code-client-go v1.28.0 h1:wmu5EqSppMm1ks11h5YnVLnTTyOYnQhwPQEmDGXcxbs=
github.com/snyk/code-client-go v1.28.0/go.mod h1:MJk1PNA5mJxI7TpJUDjyckUKAhUaT0jg/M3Nd2JF45A=
github.com/snyk/container-cli v0.0.0-20260213211631-cd2b2cf8f3ea h1:/v48hCMPiZVjplylgE2FX1ib8Qd8LN/vf8ZIKfA+wkI=
github.com/snyk/container-cli v0.0.0-20260213211631-cd2b2cf8f3ea/go.mod h1:P5yW8+jkwhYBsj5l2jtHeWujyX+SAtvkC8+LELKdlWI=
github.com/snyk/dep-graph/go v0.0.0-20260127160647-c836da762c62 h1:kgZNQ5ztI4+n3YKLR5LJbqL8WJmUYgDSbFKREIY79g0=
Expand Down
2 changes: 1 addition & 1 deletion cliv2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/snyk/cli-extension-os-flows v0.0.0-20260617143547-fe76369c867a
github.com/snyk/cli-extension-sbom v0.0.0-20260428131356-48881c6270fa
github.com/snyk/cli-extension-secrets v0.0.0-20260619070019-764c5c87eda3
github.com/snyk/code-client-go v1.27.0
github.com/snyk/code-client-go v1.28.0
github.com/snyk/container-cli v0.0.0-20260213211631-cd2b2cf8f3ea
github.com/snyk/error-catalog-golang-public v0.0.0-20260505112649-a5103d411663
github.com/snyk/go-application-framework v0.5.0
Expand Down
4 changes: 2 additions & 2 deletions cliv2/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,8 @@ github.com/snyk/cli-extension-sbom v0.0.0-20260428131356-48881c6270fa h1:9GSKXrR
github.com/snyk/cli-extension-sbom v0.0.0-20260428131356-48881c6270fa/go.mod h1:SJ624HENWG4yjM6jNuLebTeNsMriozf1LcKhMYVm1aY=
github.com/snyk/cli-extension-secrets v0.0.0-20260619070019-764c5c87eda3 h1:wBYQm4YP65FTZ4rZ0iunhsIUYBindUEnfRWRi+Rugag=
github.com/snyk/cli-extension-secrets v0.0.0-20260619070019-764c5c87eda3/go.mod h1:D/Bk0EH8np/d6c1tG7wazpHI6iU9m8KzxytFcIQkEvQ=
github.com/snyk/code-client-go v1.27.0 h1:FOX4JzgHssm5fei4ALyrBAIL9eJGnG52yTkqWcM1Qew=
github.com/snyk/code-client-go v1.27.0/go.mod h1:DQHr0nRchfrc54aciYyrveKWEpBhJwUoc1XoDhWt6W4=
github.com/snyk/code-client-go v1.28.0 h1:wmu5EqSppMm1ks11h5YnVLnTTyOYnQhwPQEmDGXcxbs=
github.com/snyk/code-client-go v1.28.0/go.mod h1:MJk1PNA5mJxI7TpJUDjyckUKAhUaT0jg/M3Nd2JF45A=
github.com/snyk/container-cli v0.0.0-20260213211631-cd2b2cf8f3ea h1:/v48hCMPiZVjplylgE2FX1ib8Qd8LN/vf8ZIKfA+wkI=
github.com/snyk/container-cli v0.0.0-20260213211631-cd2b2cf8f3ea/go.mod h1:P5yW8+jkwhYBsj5l2jtHeWujyX+SAtvkC8+LELKdlWI=
github.com/snyk/dep-graph/go v0.0.0-20260127160647-c836da762c62 h1:kgZNQ5ztI4+n3YKLR5LJbqL8WJmUYgDSbFKREIY79g0=
Expand Down
2 changes: 1 addition & 1 deletion cliv2/pkg/core/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import (
"github.com/snyk/cli/cliv2/internal/cliv2"
"github.com/snyk/cli/cliv2/internal/constants"

cliv2utils "github.com/snyk/cli/cliv2/internal/utils"
persona "github.com/snyk/cli/cliv2/internal/persona"
cliv2utils "github.com/snyk/cli/cliv2/internal/utils"

localworkflows "github.com/snyk/go-application-framework/pkg/local_workflows"
"github.com/snyk/go-application-framework/pkg/local_workflows/config_utils"
Expand Down
72 changes: 8 additions & 64 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"@sentry/node": "^7.120.4",
"@snyk/cli-interface": "2.15.0",
"@snyk/cloud-config-parser": "^1.14.5",
"@snyk/code-client": "^4.23.5",
"@snyk/dep-graph": "^2.16.3",
"@snyk/docker-registry-v2-client": "^4.0.2",
"@snyk/error-catalog-nodejs-public": "^5.79.0",
Expand Down
7 changes: 7 additions & 0 deletions src/cli/commands/fix/validate-fix-command-is-supported.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { getEcosystemForTest } from '../../../lib/ecosystems';

import { isFeatureFlagSupportedForOrg } from '../../../lib/feature-flags';
import { FeatureNotSupportedByEcosystemError } from '../../../lib/errors/not-supported-by-ecosystem';
import { CustomError } from '../../../lib/errors/custom-error';
import { Options, TestOptions } from '../../../lib/types';
import { AuthFailedError } from '../../../lib/errors';
import chalk from 'chalk';
Expand All @@ -18,6 +19,12 @@ export async function validateFixCommandIsSupported(
throw new FeatureNotSupportedByEcosystemError('snyk fix', 'docker');
}

if (options.code) {
throw new CustomError(
'`snyk fix` is not supported for Snyk Code projects.',
);
}

const ecosystem = getEcosystemForTest(options);
if (ecosystem) {
throw new FeatureNotSupportedByEcosystemError('snyk fix', ecosystem);
Expand Down
7 changes: 7 additions & 0 deletions src/cli/commands/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { MissingArgError } from '../../../lib/errors';
import * as theme from '../../../lib/theme';

import * as snyk from '../../../lib';
import { CustomError } from '../../../lib/errors/custom-error';
import { Options, TestOptions } from '../../../lib/types';
import { MethodArgs } from '../../args';
import { TestCommandResult } from '../../commands/types';
Expand Down Expand Up @@ -110,6 +111,12 @@ export default async function test(
throw new MissingArgError();
}

if (options.code) {
throw new CustomError(
'Snyk Code testing is handled by the native CLI workflow. Use the packaged Snyk CLI binary to run `snyk code test`.',
);
}

if (options.docker) {
// order is important here, we want:
// 1) exclude-app-vulns set -> no app vulns
Expand Down
15 changes: 0 additions & 15 deletions src/lib/code-config.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/lib/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ interface Config {
timeout: number;
PROJECT_NAME: string;
TOKEN: string;
CODE_CLIENT_PROXY_URL: string;
DISABLE_ANALYTICS: unknown;
CACHE_PATH?: string;
DRIFTCTL_PATH?: string;
Expand Down Expand Up @@ -90,6 +89,4 @@ if (!config.ROOT) {
config.PUBLIC_VULN_DB_URL = 'https://security.snyk.io';
config.PUBLIC_LICENSE_URL = 'https://snyk.io';

config.CODE_CLIENT_PROXY_URL = process.env.SNYK_CODE_CLIENT_PROXY_URL || '';

export default config;
3 changes: 0 additions & 3 deletions src/lib/ecosystems/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ export function getEcosystemForTest(options: Options): Ecosystem | null {
if (options.unmanaged) {
return 'cpp';
}
if (options.code) {
return 'code';
}
return null;
}

Expand Down
2 changes: 0 additions & 2 deletions src/lib/ecosystems/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as cppPlugin from 'snyk-cpp-plugin';
import * as dockerPlugin from 'snyk-docker-plugin';
import { codePlugin } from '../plugins/sast';
import { Ecosystem, EcosystemPlugin } from './types';

const EcosystemPlugins: {
Expand All @@ -9,7 +8,6 @@ const EcosystemPlugins: {
cpp: cppPlugin as EcosystemPlugin,
// TODO: not any
docker: dockerPlugin as any,
code: codePlugin,
};

export function getPlugin(ecosystem: Ecosystem): EcosystemPlugin {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/ecosystems/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SEVERITY } from '../snyk-test/common';
import { RemediationChanges } from '../snyk-test/legacy';
import { Options, ProjectAttributes, Tag } from '../types';

export type Ecosystem = 'cpp' | 'docker' | 'code';
export type Ecosystem = 'cpp' | 'docker';

export type FindingType = 'iacIssue';

Expand Down
Loading