Skip to content

Commit 4818fdd

Browse files
authored
Merge pull request #1903 from github/henrymercer/sublanguage-file-coverage
Enable sub-language file coverage behind a feature flag
2 parents e548601 + c95737b commit 4818fdd

File tree

7 files changed

+45
-3
lines changed

7 files changed

+45
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
66

77
- Update default CodeQL bundle version to 2.14.6. [#1897](https://github.com/github/codeql-action/pull/1897)
88
- We are rolling out a feature in October 2023 that will improve the success rate of C/C++ autobuild. [#1889](https://github.com/github/codeql-action/pull/1889)
9+
- We are rolling out a feature in October 2023 that will provide specific file coverage information for C and C++, Java and Kotlin, and JavaScript and TypeScript. Currently file coverage information for each of these pairs of languages is grouped together. [#1903](https://github.com/github/codeql-action/pull/1903)
910
- Add a warning to help customers avoid inadvertently analyzing the same CodeQL language in multiple matrix jobs. [#1901](https://github.com/github/codeql-action/pull/1901)
1011

1112
## 2.21.8 - 19 Sep 2023

lib/codeql.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/codeql.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/feature-flags.js

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/feature-flags.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/codeql.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
Feature,
2121
FeatureEnablement,
2222
useCodeScanningConfigInCli,
23+
CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE,
2324
} from "./feature-flags";
2425
import { isTracedLanguage, Language } from "./languages";
2526
import { Logger } from "./logging";
@@ -611,6 +612,19 @@ export async function getCodeQLForCmd(
611612
extraArgs.push("--calculate-language-specific-baseline");
612613
}
613614

615+
if (
616+
await features.getValue(Feature.SublanguageFileCoverageEnabled, this)
617+
) {
618+
extraArgs.push("--sublanguage-file-coverage");
619+
} else if (
620+
await util.codeQlVersionAbove(
621+
this,
622+
CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE,
623+
)
624+
) {
625+
extraArgs.push("--no-sublanguage-file-coverage");
626+
}
627+
614628
await runTool(
615629
cmd,
616630
[

src/feature-flags.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ export const CODEQL_VERSION_ANALYSIS_SUMMARY_V2 = "2.14.0";
2929
*/
3030
export const CODEQL_VERSION_INTRA_LAYER_PARALLELISM = "2.14.6";
3131

32+
/**
33+
* Versions 2.15.0+ of the CodeQL CLI support sub-language file coverage information.
34+
*/
35+
export const CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE = "2.15.0";
36+
3237
export interface CodeQLDefaultVersionInfo {
3338
cliVersion: string;
3439
tagName: string;
@@ -59,6 +64,7 @@ export enum Feature {
5964
ExportDiagnosticsEnabled = "export_diagnostics_enabled",
6065
MlPoweredQueriesEnabled = "ml_powered_queries_enabled",
6166
QaTelemetryEnabled = "qa_telemetry_enabled",
67+
SublanguageFileCoverageEnabled = "sublanguage_file_coverage_enabled",
6268
UploadFailedSarifEnabled = "upload_failed_sarif_enabled",
6369
}
6470

@@ -111,6 +117,11 @@ export const featureConfig: Record<
111117
minimumVersion: undefined,
112118
defaultValue: false,
113119
},
120+
[Feature.SublanguageFileCoverageEnabled]: {
121+
envVar: "CODEQL_ACTION_SUBLANGUAGE_FILE_COVERAGE",
122+
minimumVersion: CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE,
123+
defaultValue: false,
124+
},
114125
[Feature.UploadFailedSarifEnabled]: {
115126
envVar: "CODEQL_ACTION_UPLOAD_FAILED_SARIF",
116127
minimumVersion: "2.11.3",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy