Skip to content
Snippets Groups Projects
Unverified Commit b2e2b0d4 authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

fix(vulnerabilities): set matchCurrentVersion for github alerts (#31612)

parent f96ecc18
No related branches found
Tags 38.95.3
No related merge requests found
......@@ -15,6 +15,7 @@ exports[`workers/repository/init/vulnerability detectVulnerabilityAlerts() retur
"vulnerabilityFixStrategy": "lowest",
},
"isVulnerabilityAlert": true,
"matchCurrentVersion": "< 1.8.3",
"matchDatasources": [
"go",
],
......@@ -50,6 +51,7 @@ exports[`workers/repository/init/vulnerability detectVulnerabilityAlerts() retur
"vulnerabilityFixStrategy": "lowest",
},
"isVulnerabilityAlert": true,
"matchCurrentVersion": "(,2.7.9.4)",
"matchDatasources": [
"maven",
],
......@@ -85,6 +87,7 @@ exports[`workers/repository/init/vulnerability detectVulnerabilityAlerts() retur
"vulnerabilityFixStrategy": "lowest",
},
"isVulnerabilityAlert": true,
"matchCurrentVersion": "< 2.2.1.0",
"matchDatasources": [
"pypi",
],
......
......@@ -184,9 +184,15 @@ export async function detectVulnerabilityAlerts(
matchFileNames,
};
let matchCurrentVersion = `< ${val.firstPatchedVersion}`;
if (datasource === MavenDatasource.id) {
matchCurrentVersion = `(,${val.firstPatchedVersion})`;
}
// Remediate only direct dependencies
matchRule = {
...matchRule,
matchCurrentVersion,
vulnerabilityFixVersion: val.firstPatchedVersion,
prBodyNotes,
isVulnerabilityAlert: true,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment