Skip to content

Commit f3c5a69

Browse files
committed
Move VersionInfo to dedicated module
1 parent cd71147 commit f3c5a69

6 files changed

Lines changed: 21 additions & 18 deletions

File tree

‎src/cli/output-cache.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import * as fs from "fs";
22
import path from "path";
33

44
import { getTemporaryDirectory } from "../actions-util";
5-
import { VersionInfo } from "../codeql";
65
import { Env, getEnv } from "../environment";
76
import { isPersistedVersionInfo } from "../util";
87

8+
import type { VersionInfo } from "./types";
9+
910
/**
1011
* The name of the temporary file that backs the on-disk cache of
1112
* CLI responses between workflow steps.

‎src/cli/types.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export interface VersionInfo {
2+
version: string;
3+
features?: { [name: string]: boolean };
4+
/**
5+
* The overlay version helps deal with backward incompatible changes for
6+
* overlay analysis. When a precompiled query pack reports the same overlay
7+
* version as the CodeQL CLI, we can use the CodeQL CLI to perform overlay
8+
* analysis with that pack. Otherwise, if the overlay versions are different,
9+
* or if either the pack or the CLI does not report an overlay version,
10+
* we need to revert to non-overlay analysis.
11+
*/
12+
overlayVersion?: number;
13+
}

‎src/codeql.ts‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
} from "./actions-util";
1414
import * as api from "./api-client";
1515
import * as outputCache from "./cli/output-cache";
16+
import type { VersionInfo } from "./cli/types";
1617
import { CliError, wrapCliConfigurationError } from "./cli-errors";
1718
import { appendExtraQueryExclusions, type Config } from "./config-utils";
1819
import { DocUrl } from "./doc-url";
@@ -216,20 +217,6 @@ export interface CodeQL {
216217
): Promise<void>;
217218
}
218219

219-
export interface VersionInfo {
220-
version: string;
221-
features?: { [name: string]: boolean };
222-
/**
223-
* The overlay version helps deal with backward incompatible changes for
224-
* overlay analysis. When a precompiled query pack reports the same overlay
225-
* version as the CodeQL CLI, we can use the CodeQL CLI to perform overlay
226-
* analysis with that pack. Otherwise, if the overlay versions are different,
227-
* or if either the pack or the CLI does not report an overlay version,
228-
* we need to revert to non-overlay analysis.
229-
*/
230-
overlayVersion?: number;
231-
}
232-
233220
export interface ResolveDatabaseOutput {
234221
overlayBaseSpecifier?: string;
235222
}

‎src/testing-utils.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import * as apiClient from "./api-client";
1919
import { GitHubApiDetails } from "./api-client";
2020
import { CachingKind } from "./caching-utils";
2121
import { resetCachedCodeQlVersion } from "./cli/output-cache";
22+
import type { VersionInfo } from "./cli/types";
2223
import * as codeql from "./codeql";
2324
import { Config } from "./config-utils";
2425
import * as defaults from "./defaults.json";
@@ -872,7 +873,7 @@ export const makeVersionInfo = (
872873
version: string,
873874
features?: { [name: string]: boolean },
874875
overlayVersion?: number,
875-
): codeql.VersionInfo => ({
876+
): VersionInfo => ({
876877
version,
877878
features,
878879
overlayVersion,

‎src/tools-features.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as semver from "semver";
22

3-
import type { VersionInfo } from "./codeql";
3+
import type { VersionInfo } from "./cli/types";
44

55
export enum ToolsFeature {
66
BuiltinExtractorsSpecifyDefaultQueries = "builtinExtractorsSpecifyDefaultQueries",

‎src/util.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import * as yaml from "js-yaml";
1010
import * as semver from "semver";
1111

1212
import * as apiCompatibility from "./api-compatibility.json";
13-
import type { CodeQL, VersionInfo } from "./codeql";
13+
import type { VersionInfo } from "./cli/types";
14+
import type { CodeQL } from "./codeql";
1415
import type { Pack } from "./config/db-config";
1516
import type { Config } from "./config-utils";
1617
import { EnvVar, getRequiredEnvParam } from "./environment";

0 commit comments

Comments
 (0)