Skip to content

Commit

Permalink
fix: add targetRuntime meta information to monitor (#4916)
Browse files Browse the repository at this point in the history
* fix: add targetRuntime meta information to monitor

* fix: not sure how this test will work

* fix: bump snyk-nuget-plugin
  • Loading branch information
dotkas committed Oct 25, 2023
1 parent b7211c8 commit 068b111
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 24 deletions.
46 changes: 23 additions & 23 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"snyk-module": "3.1.0",
"snyk-mvn-plugin": "3.1.0",
"snyk-nodejs-lockfile-parser": "1.52.1",
"snyk-nuget-plugin": "1.39.1",
"snyk-nuget-plugin": "2.0.0",
"snyk-php-plugin": "1.9.2",
"snyk-policy": "^1.25.0",
"snyk-python-plugin": "^2.0.1",
Expand Down
2 changes: 2 additions & 0 deletions src/lib/monitor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ interface Meta {
dockerImageId?: string;
dockerBaseImage?: string;
projectName: string;
targetRuntime?: string;
}

export async function monitor(
Expand Down Expand Up @@ -351,6 +352,7 @@ export async function monitorDepGraph(
monitorGraph: true,
versionBuildInfo: JSON.stringify(scannedProject.meta?.versionBuildInfo),
gradleProjectName: scannedProject.meta?.gradleProjectName,
targetRuntime: scannedProject.meta?.targetRuntime,
},
policy: policy ? policy.toString() : undefined,
depGraphJSON: depGraph, // depGraph will be auto serialized to JSON on send
Expand Down
9 changes: 9 additions & 0 deletions test/tap/cli-monitor.acceptance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,15 @@ if (!isWindows) {
t.same(req.body.projectAttributes.lifecycle, ['production', 'sandbox']);
});

test('`monitor nuget package with --dotnet-runtime-resolution enabled`', async (t) => {
chdirWorkspaces();
await cli.monitor('nuget-app-6', {
'dotnet-runtime-resolution': true,
});
const req = server.popRequest();
t.same(req.body.meta.targetRuntime, 'net6.0');
});

test('`monitor npm-package with --project-tags`', async (t) => {
chdirWorkspaces();
await cli.monitor('npm-package', {
Expand Down

0 comments on commit 068b111

Please sign in to comment.