Skip to content

Commit 5cabc85

Browse files
author
ksidoren
committed
fix: coerce the version to semver #154
1 parent 6b3120c commit 5cabc85

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ const generateReport = async options => {
165165
headers,
166166
});
167167
const json = JSON.parse(res.body);
168-
version = json.version;
168+
version = semver.coerce(json.version);
169169
console.error("sonarqube version: %s", version);
170170
} catch (error) {
171171
logError("getting version", error);
@@ -187,13 +187,13 @@ const generateReport = async options => {
187187
DEFAULT_ISSUES_FILTER = "&types=VULNERABILITY,SECURITY_HOTSPOT";
188188
DEFAULT_RULES_FILTER = "&types=VULNERABILITY,SECURITY_HOTSPOT";
189189
ISSUE_STATUSES = "OPEN,CONFIRMED,REOPENED";
190-
} else if (semver.satisfies(version, "7.8 - 8.2")) {
190+
} else if (semver.satisfies(version, "7.8 - 7.9")) {
191191
// hotspots are stored in the /issues endpoint and issue status includes TO_REVIEW,IN_REVIEW
192192
DEFAULT_ISSUES_FILTER = "&types=VULNERABILITY,SECURITY_HOTSPOT";
193193
DEFAULT_RULES_FILTER = "&types=VULNERABILITY,SECURITY_HOTSPOT";
194194
ISSUE_STATUSES = "OPEN,CONFIRMED,REOPENED,TO_REVIEW";
195195
} else {
196-
// version >= 8.2
196+
// version >= 8.0
197197
// hotspots are in a dedicated endpoint: rules have type SECURITY_HOTSPOT but issues don't
198198
DEFAULT_ISSUES_FILTER = "&types=VULNERABILITY";
199199
DEFAULT_RULES_FILTER = "&types=VULNERABILITY,SECURITY_HOTSPOT";

0 commit comments

Comments
 (0)