Merge pull request #3263 from github/dbartol/extensible-failure
This commit is contained in:
@@ -1737,6 +1737,10 @@ export class CliVersionConstraint {
|
|||||||
*/
|
*/
|
||||||
public static CLI_VERSION_WITH_TRIM_CACHE = new SemVer("2.15.1");
|
public static CLI_VERSION_WITH_TRIM_CACHE = new SemVer("2.15.1");
|
||||||
|
|
||||||
|
public static CLI_VERSION_WITHOUT_MRVA_EXTENSIBLE_PREDICATE_HACK = new SemVer(
|
||||||
|
"2.16.1",
|
||||||
|
);
|
||||||
|
|
||||||
constructor(private readonly cli: CodeQLCliServer) {
|
constructor(private readonly cli: CodeQLCliServer) {
|
||||||
/**/
|
/**/
|
||||||
}
|
}
|
||||||
@@ -1779,6 +1783,13 @@ export class CliVersionConstraint {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async preservesExtensiblePredicatesInMrvaPack() {
|
||||||
|
// Negated, because we _stopped_ preserving these in 2.16.1.
|
||||||
|
return !(await this.isVersionAtLeast(
|
||||||
|
CliVersionConstraint.CLI_VERSION_WITHOUT_MRVA_EXTENSIBLE_PREDICATE_HACK,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
async supportsMrvaPackCreate(): Promise<boolean> {
|
async supportsMrvaPackCreate(): Promise<boolean> {
|
||||||
return (await this.cli.getFeatures()).mrvaPackCreate === true;
|
return (await this.cli.getFeatures()).mrvaPackCreate === true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -275,7 +275,13 @@ describe("Variant Analysis Manager", () => {
|
|||||||
|
|
||||||
const queryToRun =
|
const queryToRun =
|
||||||
"Security/CWE/CWE-020/ExternalAPIsUsedWithUntrustedData.ql";
|
"Security/CWE/CWE-020/ExternalAPIsUsedWithUntrustedData.ql";
|
||||||
const extraQuery = "Telemetry/ExtractorInformation.ql";
|
|
||||||
|
// Recent versions of the CLI don't preserve queries with extensible predicates in MRVA packs,
|
||||||
|
// because all the necessary info is in the `.packinfo` file.
|
||||||
|
const extraQueries =
|
||||||
|
(await cli.cliConstraints.preservesExtensiblePredicatesInMrvaPack())
|
||||||
|
? ["Telemetry/ExtractorInformation.ql"]
|
||||||
|
: [];
|
||||||
|
|
||||||
await doVariantAnalysisTest({
|
await doVariantAnalysisTest({
|
||||||
queryPath: join(
|
queryPath: join(
|
||||||
@@ -284,7 +290,7 @@ describe("Variant Analysis Manager", () => {
|
|||||||
queryToRun,
|
queryToRun,
|
||||||
),
|
),
|
||||||
expectedPackName: "codeql/java-queries",
|
expectedPackName: "codeql/java-queries",
|
||||||
filesThatExist: [queryToRun, extraQuery],
|
filesThatExist: [queryToRun, ...extraQueries],
|
||||||
filesThatDoNotExist: [],
|
filesThatDoNotExist: [],
|
||||||
qlxFilesThatExist: [],
|
qlxFilesThatExist: [],
|
||||||
dependenciesToCheck: ["codeql/java-all"],
|
dependenciesToCheck: ["codeql/java-all"],
|
||||||
|
|||||||
Reference in New Issue
Block a user