Skip to content

Commit 5ef6442

Browse files
committed
fix(code): fix backward compatibility issue in sarif driver name
1 parent add2966 commit 5ef6442

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

cliv2/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ require (
1515
github.com/snyk/cli-extension-sbom v0.0.0-20241016065306-0df2be5b3b8f
1616
github.com/snyk/container-cli v0.0.0-20240821111304-7ca1c415a5d7
1717
github.com/snyk/error-catalog-golang-public v0.0.0-20250218074309-307ad7b38a60
18-
github.com/snyk/go-application-framework v0.0.0-20250312152307-f382628a3a7e
18+
github.com/snyk/go-application-framework v0.0.0-20250320111922-b329abf1a58c
1919
github.com/snyk/go-httpauth v0.0.0-20240307114523-1f5ea3f55c65
2020
github.com/snyk/snyk-iac-capture v0.6.5
2121
github.com/snyk/snyk-ls v0.0.0-20250325135416-ee1e33097efc

cliv2/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,8 +808,8 @@ github.com/snyk/container-cli v0.0.0-20240821111304-7ca1c415a5d7 h1:Zn5BcV76oFAb
808808
github.com/snyk/container-cli v0.0.0-20240821111304-7ca1c415a5d7/go.mod h1:38w+dcAQp9eG3P5t2eNS9eG0reut10AeJjLv5lJ5lpM=
809809
github.com/snyk/error-catalog-golang-public v0.0.0-20250218074309-307ad7b38a60 h1:iB6z2BhBpfN9p0/dEZfwWvs7fpdZk3loooAih8yspS8=
810810
github.com/snyk/error-catalog-golang-public v0.0.0-20250218074309-307ad7b38a60/go.mod h1:Ytttq7Pw4vOCu9NtRQaOeDU2dhBYUyNBe6kX4+nIIQ4=
811-
github.com/snyk/go-application-framework v0.0.0-20250312152307-f382628a3a7e h1:zWUYzapqmQyzNxMqRdia/u6TVDa8aPG3eWolXCe/OcI=
812-
github.com/snyk/go-application-framework v0.0.0-20250312152307-f382628a3a7e/go.mod h1:A7oFVjMjNukzsMeiIWXEXjCrAf2ARvoK4aQOm9e3E/Y=
811+
github.com/snyk/go-application-framework v0.0.0-20250320111922-b329abf1a58c h1:HnWiT5YyPW9NCR+ZekqOS7ygoSXYNX2U9Z7UJMAMtjU=
812+
github.com/snyk/go-application-framework v0.0.0-20250320111922-b329abf1a58c/go.mod h1:A7oFVjMjNukzsMeiIWXEXjCrAf2ARvoK4aQOm9e3E/Y=
813813
github.com/snyk/go-httpauth v0.0.0-20240307114523-1f5ea3f55c65 h1:CEQuYv0Go6MEyRCD3YjLYM2u3Oxkx8GpCpFBd4rUTUk=
814814
github.com/snyk/go-httpauth v0.0.0-20240307114523-1f5ea3f55c65/go.mod h1:88KbbvGYlmLgee4OcQ19yr0bNpXpOr2kciOthaSzCAg=
815815
github.com/snyk/policy-engine v0.33.2 h1:ZxD6/RQ4vqUAXa64V72SsGjZ8vmnBgZNGYQxMIqctYo=

test/jest/acceptance/snyk-code/snyk-code-user-journey.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { matchers } from 'jest-json-schema';
44
import { resolve } from 'path';
55
import { existsSync, unlinkSync, readFileSync } from 'fs';
66
import { execSync } from 'child_process';
7+
import { runCommand } from '../../util/runCommand';
8+
import * as fs from 'fs';
79

810
expect.extend(matchers);
911
jest.setTimeout(1000 * 120);
@@ -283,6 +285,7 @@ describe('snyk code test', () => {
283285
it('works with --json-file-output', async () => {
284286
const fileName = 'jsonOutput.json';
285287
const filePath = `${projectRoot}/${fileName}`;
288+
const htmlFilePath = `${projectRoot}/out.html`;
286289
const { stderr, code } = await runSnykCLI(
287290
`code test ${projectWithCodeIssues} --json-file-output=${fileName}`,
288291
{
@@ -299,9 +302,21 @@ describe('snyk code test', () => {
299302
expect(existsSync(filePath)).toBe(true);
300303
expect(require(filePath)).toMatchSchema(sarifSchema);
301304

305+
// execute snyk-to-html for a basic compatibility check
306+
const s2h = await runCommand('npx', [
307+
'snyk-to-html',
308+
`--input=${filePath}`,
309+
`--output=${htmlFilePath}`,
310+
]);
311+
expect(s2h.code).toBe(0);
312+
expect(fs.readFileSync(htmlFilePath, 'utf8')).toContain(
313+
'Snyk Code Report',
314+
);
315+
302316
// cleanup file
303317
try {
304318
unlinkSync(filePath);
319+
unlinkSync(htmlFilePath);
305320
} catch (error) {
306321
console.error('failed to remove file.', error);
307322
}

0 commit comments

Comments
 (0)