You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Includes product update to be announced in the next stable release notes
What does this PR do?
This PR adds test coverage for the snyk-docker-plugin upgrade from version 9.3.0 to 9.6.0, focusing on the key fixes and features introduced in this upgrade.
Where should the reviewer start?
1. mssql-jdbc pom.properties Fix (CN-1011)
Issue: com.microsoft.sqlserver:mssql-jdbc JARs (e.g., mssql-jdbc-12.10.2.jre11.jar) have pom.properties files with incomplete version info (only version=12.10.2), causing Snyk to incorrectly report them as version 12.10.2 instead of 12.10.2.jre11. This led to false positive vulnerability alerts for SNYK-JAVA-COMMICROSOFTSQLSERVER-13821835.
Fix: Added package override to skip pom.properties JAR resolution and use maven-deps for resolution instead.
Test Coverage:
Created test fixture with real mssql-jdbc JAR from Maven Central
Test verifies version is correctly identified as 12.10.2.jre11 (not 12.10.2)
Test verifies no false positive vulnerability alerts
2. JVM Release File Parsing (CN-444)
Feature: Added ability to parse JVM release files at /opt/java/openjdk/release to detect Java runtime version and scan for JVM vulnerabilities.
Test Coverage:
Test uses public eclipse-temurin:11-jre image
Verifies Java version detection from release file
Verifies baseRuntimes fact is added to scan results
The new acceptance tests in mssql-jdbc-pom-properties.spec.ts and jvm-release-detection.spec.ts invoke Snyk CLI commands (test, monitor) that interact with live Snyk APIs without setting up fake-server for mocking. This violates the repository's guidelines in CONTRIBUTING.md which state that tests must never call remote endpoints. This will cause failures in CI environments without network access or valid tokens.
const{ code, stdout }=awaitrunSnykCLI(`container test ${TEST_FIXTURE} --json`,);
The regression check for the mssql-jdbc fix relies on the hardcoded vulnerability ID SNYK-JAVA-COMMICROSOFTSQLSERVER-13821835. This makes the test suite brittle to upstream metadata changes in the Snyk vulnerability database. If this vulnerability is renamed, removed, or its version range is updated in the database, the test will pass vacuously even if the underlying version detection bug returns.
The test mssql-jdbc-pom-properties.spec.ts does not directly verify that the mssql-jdbc dependency is identified as 12.10.2.jre11 as claimed in the PR description. It only asserts the absence of a vulnerability associated with the incorrect version (12.10.2). If the package detection logic fails entirely to find the JAR, the test will pass silently. A robust test should inspect jsonOutput.applications or the facts tree for the expected version string.
expect(falsePositive).toBeUndefined();
📚 Repository Context Analyzed
This review considered 4 relevant code sections from 4 files (average relevance: 1.00)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Submission Checklist
are release-note ready, emphasizing
what was changed, not how.
What does this PR do?
This PR adds test coverage for the snyk-docker-plugin upgrade from version 9.3.0 to 9.6.0, focusing on the key fixes and features introduced in this upgrade.
Where should the reviewer start?
1. mssql-jdbc pom.properties Fix (CN-1011)
Issue:
com.microsoft.sqlserver:mssql-jdbcJARs (e.g.,mssql-jdbc-12.10.2.jre11.jar) have pom.properties files with incomplete version info (onlyversion=12.10.2), causing Snyk to incorrectly report them as version12.10.2instead of12.10.2.jre11. This led to false positive vulnerability alerts for SNYK-JAVA-COMMICROSOFTSQLSERVER-13821835.Fix: Added package override to skip pom.properties JAR resolution and use maven-deps for resolution instead.
Test Coverage:
12.10.2.jre11(not12.10.2)2. JVM Release File Parsing (CN-444)
Feature: Added ability to parse JVM release files at
/opt/java/openjdk/releaseto detect Java runtime version and scan for JVM vulnerabilities.Test Coverage:
baseRuntimesfact is added to scan results3. Go stdlib Detection (PR #767)
Feature: Enhanced Go binary scanning to detect vulnerabilities in Go standard library.
Test Coverage:
How should this be manually tested?
n/a
What's the product update that needs to be communicated to CLI users?
n/a
Risk assessment (Low | Medium | High)?
n/a
Any background context you want to provide?
n/a
What are the relevant tickets?
n/a
Screenshots (if appropriate)
n/a