Skip to content

Commit da8dabf

Browse files
committed
VersionInfo: add overlayVersion field
1 parent 6504a72 commit da8dabf

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/codeql.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,15 @@ export interface CodeQL {
226226
export interface VersionInfo {
227227
version: string;
228228
features?: { [name: string]: boolean };
229+
/**
230+
* The overlay version helps deal with backward incompatible changes for
231+
* overlay analysis. When a precompiled query pack reports the same overlay
232+
* version as the CodeQL CLI, we can use the CodeQL CLI to perform overlay
233+
* analysis with that pack. Otherwise, if the overlay versions are different,
234+
* or if either the pack or the CLI does not report an overlay version,
235+
* we need to revert to non-overlay analysis.
236+
*/
237+
overlayVersion?: number;
229238
}
230239

231240
export interface ResolveLanguagesOutput {

src/testing-utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,18 +254,21 @@ export function mockLanguagesInRepo(languages: string[]) {
254254
export const makeVersionInfo = (
255255
version: string,
256256
features?: { [name: string]: boolean },
257+
overlayVersion?: number,
257258
): codeql.VersionInfo => ({
258259
version,
259260
features,
261+
overlayVersion,
260262
});
261263

262264
export function mockCodeQLVersion(
263265
version: string,
264266
features?: { [name: string]: boolean },
267+
overlayVersion?: number,
265268
) {
266269
return codeql.createStubCodeQL({
267270
async getVersion() {
268-
return makeVersionInfo(version, features);
271+
return makeVersionInfo(version, features, overlayVersion);
269272
},
270273
});
271274
}

0 commit comments

Comments
 (0)