Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable language specific baselines via feature flag #1836

Merged
merged 4 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading