Closed sfat closed 5 years ago
linked snyk-gradle-plugin
with my local snyk
Added this snippet in run-test.ts
to check that snyk test -d
spits the needed information:
if (deps.plugin && deps.plugin.meta && deps.plugin.meta.versionBuildInfo) {
analytics.add('gradleVersion', deps.plugin.meta.versionBuildInfo.gradleVersion);
const metaBuildVersion = deps.plugin.meta.versionBuildInfo.metaBuildVersion;
if (metaBuildVersion) {
analytics.add('metaBuildVersion', metaBuildVersion);
}
}
Screenshot with the output from snyk test -d
the job fails because this needs review first: https://github.com/snyk/snyk-cli-interface/pull/21
Changed implementation to saved in MultiProjectResult.meta
instead of plugin.meta
.
To accomplish the above screenshot, I've modified src/lib/snyk-test/run-test.ts
, in assembleLocalPayloads()
the following:
for (const scannedProject of deps.scannedProjects) {
if (scannedProject && scannedProject.meta && scannedProject.meta.buildInfoVersion) { // from here
analytics.add('gradleVersion', scannedProject.meta.buildInfoVersion.gradleVersion);
const metaBuildVersion = scannedProject.meta.buildInfoVersion.metaBuildVersion;
if (metaBuildVersion) {
analytics.add('metaBuildVersion', JSON.stringify(metaBuildVersion));
}
}
What does this PR do?
implementation for https://github.com/snyk/snyk-gradle-plugin/issues/89