Skip to content

Commit

Permalink
Merge pull request #1835 from github/henrymercer/language-baseline-co…
Browse files Browse the repository at this point in the history
…nfig

 Enable language specific baselines via feature flag
  • Loading branch information
henrymercer authored Aug 14, 2023
2 parents 9a510d9 + d03c744 commit ac35d7a
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
- Log a warning if the amount of available disk space runs low during a code scanning run. [#1825](https://github.com/github/codeql-action/pull/1825)
- When downloading CodeQL bundle version 2.13.4 and later, cache these bundles in the Actions tool cache using a simpler version number. [#1832](https://github.com/github/codeql-action/pull/1832)
- Fix an issue that first appeared in CodeQL Action v2.21.2 that prevented CodeQL invocations from being logged. [#1833](https://github.com/github/codeql-action/pull/1833)
- We are rolling out a feature in August 2023 that will improve the quality of file coverage information. [#1835](https://github.com/github/codeql-action/pull/1835)

## 2.21.3 - 08 Aug 2023

Expand Down
3 changes: 3 additions & 0 deletions lib/codeql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/codeql.js.map

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion lib/feature-flags.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/feature-flags.js.map

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/codeql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,13 @@ export async function getCodeQLForCmd(
) {
extraArgs.push(`--qlconfig-file=${qlconfigFile}`);
}

if (
await features.getValue(Feature.LanguageBaselineConfigEnabled, this)
) {
extraArgs.push("--calculate-language-specific-baseline");
}

await runTool(
cmd,
[
Expand Down
11 changes: 11 additions & 0 deletions src/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ export const CODEQL_VERSION_ANALYSIS_SUMMARY_V2 = "2.14.0";
*/
export const CODEQL_VERSION_INTRA_LAYER_PARALLELISM = "2.14.0";

/**
* Versions 2.14.2+ of the CodeQL CLI support language-specific baseline configuration.
*/
export const CODEQL_VERSION_LANGUAGE_BASELINE_CONFIG = "2.14.2";

export interface CodeQLDefaultVersionInfo {
cliVersion: string;
tagName: string;
Expand Down Expand Up @@ -55,6 +60,7 @@ export enum Feature {
DisablePythonDependencyInstallationEnabled = "disable_python_dependency_installation_enabled",
EvaluatorIntraLayerParallelismEnabled = "evaluator_intra_layer_parallelism_enabled",
ExportDiagnosticsEnabled = "export_diagnostics_enabled",
LanguageBaselineConfigEnabled = "language_baseline_config_enabled",
MlPoweredQueriesEnabled = "ml_powered_queries_enabled",
QaTelemetryEnabled = "qa_telemetry_enabled",
ScalingReservedRamEnabled = "scaling_reserved_ram_enabled",
Expand Down Expand Up @@ -95,6 +101,11 @@ export const featureConfig: Record<
minimumVersion: "2.12.4",
defaultValue: true,
},
[Feature.LanguageBaselineConfigEnabled]: {
envVar: "CODEQL_ACTION_LANGUAGE_BASELINE_CONFIG",
minimumVersion: CODEQL_VERSION_LANGUAGE_BASELINE_CONFIG,
defaultValue: false,
},
[Feature.MlPoweredQueriesEnabled]: {
envVar: "CODEQL_ML_POWERED_QUERIES",
minimumVersion: undefined,
Expand Down

0 comments on commit ac35d7a

Please sign in to comment.