blackducksoftware / synopsys-coverity-azure-devops

Apache License 2.0
3 stars 3 forks source link

Fixing unsupported Coverity Analysis 2021.03 VERSION file. #13

Closed bd-yeep closed 1 year ago

bd-yeep commented 3 years ago

Fixing unsupported Coverity Analysis 2021.03 VERSION file that contains two "externalVersion" tags. The plugin expected a single externalVersion tag, failing the task otherwise.

if (versionLines.length == 1) {
    return versionLines[0];
} else {
    throw `Unable to find coverity version from version file.`;
}

The new change supports more than one externalVersion tag, using the first occurrence.

if (versionLines.length > 0) {
    return versionLines[0];
} else {
    throw `Unable to find coverity version from version file.`;
}

Coverity Analysis 2021.03-2 will remove the unsupported VERSION file but this change will prevent 2021.03 users from having to upgrade Coverity Analysis.