diff --git a/src/codeql.ts b/src/codeql.ts index 422f41c80..594b58eb2 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -226,6 +226,15 @@ export interface CodeQL { export interface VersionInfo { version: string; features?: { [name: string]: boolean }; + /** + * The overlay version helps deal with backward incompatible changes for + * overlay analysis. When a precompiled query pack reports the same overlay + * version as the CodeQL CLI, we can use the CodeQL CLI to perform overlay + * analysis with that pack. Otherwise, if the overlay versions are different, + * or if either the pack or the CLI does not report an overlay version, + * we need to revert to non-overlay analysis. + */ + overlayVersion?: number; } export interface ResolveLanguagesOutput { diff --git a/src/testing-utils.ts b/src/testing-utils.ts index 11df50dc6..d7d486bd5 100644 --- a/src/testing-utils.ts +++ b/src/testing-utils.ts @@ -254,18 +254,21 @@ export function mockLanguagesInRepo(languages: string[]) { export const makeVersionInfo = ( version: string, features?: { [name: string]: boolean }, + overlayVersion?: number, ): codeql.VersionInfo => ({ version, features, + overlayVersion, }); export function mockCodeQLVersion( version: string, features?: { [name: string]: boolean }, + overlayVersion?: number, ) { return codeql.createStubCodeQL({ async getVersion() { - return makeVersionInfo(version, features); + return makeVersionInfo(version, features, overlayVersion); }, }); }