Skip to content

Commit a2d725d

Browse files
authoredJul 6, 2023
Merge pull request #1753 from github/henrymercer/new-analysis-summary
Add support for new analysis summaries
2 parents 8c2e08d + bbefc2b commit a2d725d

File tree

6 files changed

+42
-4
lines changed

6 files changed

+42
-4
lines changed
 

Diff for: ‎lib/codeql.js

+11-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: ‎lib/codeql.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: ‎lib/feature-flags.js

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: ‎lib/feature-flags.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: ‎src/codeql.ts

+15
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,11 @@ export const CODEQL_VERSION_INIT_WITH_QLCONFIG = "2.12.4";
315315
*/
316316
export const CODEQL_VERSION_RESOLVE_ENVIRONMENT = "2.13.4";
317317

318+
/**
319+
* Versions 2.14.0+ of the CodeQL CLI support new analysis summaries.
320+
*/
321+
export const CODEQL_VERSION_NEW_ANALYSIS_SUMMARY = "2.14.0";
322+
318323
/**
319324
* Set up CodeQL CLI access.
320325
*
@@ -816,6 +821,16 @@ export async function getCodeQLForCmd(
816821
} else if (await util.codeQlVersionAbove(this, "2.12.4")) {
817822
codeqlArgs.push("--no-sarif-include-diagnostics");
818823
}
824+
if (await features.getValue(Feature.NewAnalysisSummaryEnabled, codeql)) {
825+
codeqlArgs.push("--new-analysis-summary");
826+
} else if (
827+
await util.codeQlVersionAbove(
828+
codeql,
829+
CODEQL_VERSION_NEW_ANALYSIS_SUMMARY
830+
)
831+
) {
832+
codeqlArgs.push("--no-new-analysis-summary");
833+
}
819834
codeqlArgs.push(databasePath);
820835
if (querySuitePaths) {
821836
codeqlArgs.push(...querySuitePaths);

Diff for: ‎src/feature-flags.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as path from "path";
44
import * as semver from "semver";
55

66
import { getApiClient } from "./api-client";
7-
import { CodeQL } from "./codeql";
7+
import { CODEQL_VERSION_NEW_ANALYSIS_SUMMARY, CodeQL } from "./codeql";
88
import * as defaults from "./defaults.json";
99
import { Logger } from "./logging";
1010
import { RepositoryNwo } from "./repository";
@@ -42,6 +42,7 @@ export enum Feature {
4242
DisablePythonDependencyInstallationEnabled = "disable_python_dependency_installation_enabled",
4343
ExportDiagnosticsEnabled = "export_diagnostics_enabled",
4444
MlPoweredQueriesEnabled = "ml_powered_queries_enabled",
45+
NewAnalysisSummaryEnabled = "new_analysis_summary_enabled",
4546
QaTelemetryEnabled = "qa_telemetry_enabled",
4647
UploadFailedSarifEnabled = "upload_failed_sarif_enabled",
4748
}
@@ -70,6 +71,11 @@ export const featureConfig: Record<
7071
minimumVersion: "2.7.5",
7172
defaultValue: false,
7273
},
74+
[Feature.NewAnalysisSummaryEnabled]: {
75+
envVar: "CODEQL_ACTION_NEW_ANALYSIS_SUMMARY",
76+
minimumVersion: CODEQL_VERSION_NEW_ANALYSIS_SUMMARY,
77+
defaultValue: false,
78+
},
7379
[Feature.QaTelemetryEnabled]: {
7480
envVar: "CODEQL_ACTION_QA_TELEMETRY",
7581
minimumVersion: undefined,

0 commit comments

Comments
 (0)
Please sign in to comment.