Compare commits

..

12 Commits

Author SHA1 Message Date
Michael B. Gale
fbfa9f3747 Merge pull request #4311 from github/henrymercer/exclude-notify-from-required-checks
Exclude `Notify` from required checks
2026-11-09 13:24:24 +00:00
Henry Mercer
ce8b5602e2 Merge pull request #4302 from github/henrymercer/toolcache-cleanup-duration
Report how long toolcache cleanup takes
2026-11-09 12:03:29 +00:00
Henry Mercer
e4ce43d857 Merge pull request #4309 from github/henrymercer/replace-macos-14-xlarge-runner
Remove `macos-14-xlarge` from `codeql` workflow
2026-11-09 11:54:44 +00:00
Henry Mercer
822e91c47d Exclude Notify from required checks
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-06 18:24:29 +00:00
Henry Mercer
d2a785ca9c Remove macos-14-xlarge from codeql workflow
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-06 18:17:27 +00:00
Sam Robson
0911ee96d2 Merge pull request #4303 from github/mergeback/v4.39.3-to-main-33d7b85d
Mergeback v4.39.3 refs/heads/releases/v4 into main
2026-11-04 17:52:12 +00:00
github-actions[bot]
d11b2246b1 Rebuild 2026-11-04 16:49:37 +00:00
github-actions[bot]
8e42d3873f Update changelog and version after v4.39.3 2026-11-04 16:49:21 +00:00
Michael B. Gale
8aab3d8601 Merge pull request #4298 from github/mbg/decouple-features-enum
Move `Feature` enum to a separate file
2026-11-04 15:50:28 +00:00
Henry Mercer
e70c0414bf Record how long the toolcache cleanup takes in telemetry
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-04 14:31:49 +00:00
Henry Mercer
e7ce43a4dc Log how long deleting each CodeQL version from the toolcache takes
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-04 14:27:07 +00:00
Michael B. Gale
29ddace71d Move Feature enum to a separate file 2026-11-04 13:14:15 +00:00
11 changed files with 172 additions and 116 deletions

View File

@@ -79,7 +79,6 @@ jobs:
- ubuntu-24.04
- windows-2022
- windows-2025
- macos-14-xlarge
- macos-15-xlarge
tools: ${{ fromJson(needs.check-codeql-versions.outputs.versions) }}
runs-on: ${{ matrix.os }}

View File

@@ -2,6 +2,10 @@
See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs.
## [UNRELEASED]
No user facing changes.
## 4.39.3 - 04 Nov 2026
- Fixed diff-informed alert filtering incorrectly removing alerts in changed files whose paths contain spaces, special characters, or non-ASCII characters. [#4283](https://github.com/github/codeql-action/pull/4283)

10
lib/entry-points.js generated
View File

@@ -178724,7 +178724,7 @@ function getDiffRangesJsonFilePath(env = getEnv()) {
return path2.join(getTemporaryDirectory(env), PR_DIFF_RANGE_JSON_FILENAME);
}
function getActionVersion() {
return "4.39.3";
return "4.39.4";
}
function getWorkflowEventName(env = getEnv()) {
return env.getRequired("GITHUB_EVENT_NAME" /* GITHUB_EVENT_NAME */);
@@ -184864,13 +184864,16 @@ async function deleteToolcacheBundles({
}
const versionDirectory = path12.join(toolDirectory, entry.name);
try {
const deletionStart = import_perf_hooks3.performance.now();
await fs15.promises.rm(versionDirectory, {
force: true,
recursive: true
});
deletedVersions.push(entry.name);
logger2.info(
`Deleted the CodeQL tools at '${versionDirectory}' from the toolcache to free up disk space.`
`Deleted the CodeQL tools at '${versionDirectory}' from the toolcache to free up disk space (${formatDuration(
durationMsSince(deletionStart)
)}).`
);
} catch (e) {
failed = true;
@@ -185369,13 +185372,14 @@ async function tryDeleteToolcacheBundles({
if (!isGitHubHostedRunner(env) || !isToolcacheOnWorkspaceFilesystem(logger2)) {
return;
}
const startTime = import_perf_hooks4.performance.now();
const result = await deleteToolcacheBundles({ env, logger: logger2 });
addNoLanguageDiagnostic(
void 0,
makeTelemetryDiagnostic(
"codeql-action/toolcache-bundle-cleanup",
"Toolcache CodeQL bundle cleanup",
{ ...result }
{ ...result, durationMs: durationMsSince(startTime) }
)
);
}

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "codeql",
"version": "4.39.3",
"version": "4.39.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "codeql",
"version": "4.39.3",
"version": "4.39.4",
"license": "MIT",
"workspaces": [
"pr-checks"

View File

@@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "4.39.3",
"version": "4.39.4",
"private": true,
"description": "CodeQL action",
"scripts": {

View File

@@ -24,3 +24,5 @@ is:
# PRs), so requiring them would block the PRs they don't run on.
- "github-advanced-security"
- "License compliance check"
# Only runs when a PR is removed from the merge queue.
- "Notify"

View File

@@ -6,6 +6,7 @@ import * as semver from "semver";
import { getApiClient } from "./api-client";
import type { CodeQL } from "./codeql";
import * as defaults from "./defaults.json";
import { Feature } from "./feature-flags/features";
import { Logger } from "./logging";
import {
CODEQL_OVERLAY_MINIMUM_VERSION,
@@ -21,6 +22,8 @@ import { RepositoryNwo } from "./repository";
import { ToolsFeature } from "./tools-features";
import * as util from "./util";
export { Feature } from "./feature-flags/features";
const DEFAULT_VERSION_FEATURE_FLAG_PREFIX = "default_codeql_version_";
const DEFAULT_VERSION_FEATURE_FLAG_SUFFIX = "_enabled";
@@ -61,107 +64,6 @@ export interface CodeQLDefaultVersionInfo {
toolsFeatureFlagsValid?: boolean;
}
/**
* Features as named by the GitHub API endpoint.
*
* Do not include the `codeql_action_` prefix as this is stripped by the API
* endpoint.
*
* Legacy features should end with `_enabled`.
*/
export enum Feature {
/** Allows supported properties of configuration files to be merged. */
AllowMergeConfigFiles = "allow_merge_config_files",
/** Controls whether we allow multiple values for the `analysis-kinds` input. */
AllowMultipleAnalysisKinds = "allow_multiple_analysis_kinds",
/**
* Whether to check for unsupported traced analysis. Primarily intended as an override to disable
* the check if it causes problems somehow.
*/
CheckUnsupportedTracedAnalysis = "check_unsupported_traced_analysis",
/** Whether to allow the `config-file` input to be specified via a repository property. */
ConfigFileRepositoryProperty = "config_file_repository_property",
CppDependencyInstallation = "cpp_dependency_installation_enabled",
CsharpCacheBuildModeNone = "csharp_cache_bmn",
CsharpNewCacheKey = "csharp_new_cache_key",
DiffInformedQueries = "diff_informed_queries",
DisableCsharpBuildless = "disable_csharp_buildless",
DisableJavaBuildlessEnabled = "disable_java_buildless_enabled",
DisableKotlinAnalysisEnabled = "disable_kotlin_analysis_enabled",
ExportDiagnosticsEnabled = "export_diagnostics_enabled",
/**
* Emergency override that forces the CodeQL CLI to use the JGit-based Git backend instead of its
* default backend selection.
*/
ForceJGit = "force_jgit",
ForceNightly = "force_nightly",
IgnoreGeneratedFiles = "ignore_generated_files",
JavaNetworkDebugging = "java_network_debugging",
OverlayAnalysis = "overlay_analysis",
OverlayAnalysisCodeScanningCpp = "overlay_analysis_code_scanning_cpp",
OverlayAnalysisCodeScanningCsharp = "overlay_analysis_code_scanning_csharp",
OverlayAnalysisCodeScanningGo = "overlay_analysis_code_scanning_go",
OverlayAnalysisCodeScanningJava = "overlay_analysis_code_scanning_java",
OverlayAnalysisCodeScanningJavascript = "overlay_analysis_code_scanning_javascript",
OverlayAnalysisCodeScanningPython = "overlay_analysis_code_scanning_python",
OverlayAnalysisCodeScanningRuby = "overlay_analysis_code_scanning_ruby",
OverlayAnalysisCpp = "overlay_analysis_cpp",
OverlayAnalysisCsharp = "overlay_analysis_csharp",
OverlayAnalysisGo = "overlay_analysis_go",
OverlayAnalysisJava = "overlay_analysis_java",
OverlayAnalysisJavascript = "overlay_analysis_javascript",
/**
* Lowers the overlay minimum available disk space to 8 GB. The lowest enabled limit wins; if
* none are enabled, the default applies.
*/
OverlayAnalysisMinDisk8Gb = "overlay_analysis_min_disk_8_gb",
/**
* Lowers the overlay minimum available disk space to 9 GB. The lowest enabled limit wins; if
* none are enabled, the default applies.
*/
OverlayAnalysisMinDisk9Gb = "overlay_analysis_min_disk_9_gb",
/**
* Lowers the overlay minimum available disk space to 10 GB. The lowest enabled limit wins; if
* none are enabled, the default applies.
*/
OverlayAnalysisMinDisk10Gb = "overlay_analysis_min_disk_10_gb",
/**
* Lowers the overlay minimum available disk space to 11 GB. The lowest enabled limit wins; if
* none are enabled, the default applies.
*/
OverlayAnalysisMinDisk11Gb = "overlay_analysis_min_disk_11_gb",
/**
* Lowers the overlay minimum available disk space to 12 GB. The lowest enabled limit wins; if
* none are enabled, the default applies.
*/
OverlayAnalysisMinDisk12Gb = "overlay_analysis_min_disk_12_gb",
/**
* Lowers the overlay minimum available disk space to 13 GB. The lowest enabled limit wins; if
* none are enabled, the default applies.
*/
OverlayAnalysisMinDisk13Gb = "overlay_analysis_min_disk_13_gb",
OverlayAnalysisPython = "overlay_analysis_python",
OverlayAnalysisRuby = "overlay_analysis_ruby",
/** Controls whether hardware checks are skipped for overlay analysis. */
OverlayAnalysisSkipResourceChecks = "overlay_analysis_skip_resource_checks",
/** Controls whether the Actions cache is checked for overlay build outcomes. */
OverlayAnalysisStatusCheck = "overlay_analysis_status_check",
/** Controls whether overlay build failures on the default branch are stored in the Actions cache. */
OverlayAnalysisStatusSave = "overlay_analysis_status_save",
QaTelemetryEnabled = "qa_telemetry_enabled",
/** Whether we should fail early if we detect that traced analysis is unsupported. */
AbortUnsupportedTracedAnalysis = "abort_unsupported_traced_analysis",
/** Routes (some) API requests through the registry proxy. */
ProxyApiRequests = "proxy_api_requests",
/** Note that this currently only disables baseline file coverage information. */
SkipFileCoverageOnPrs = "skip_file_coverage_on_prs",
StartProxyUseFeaturesRelease = "start_proxy_use_features_release",
/** Whether to allow the `tools` input to be specified via a repository property. */
ToolsRepositoryProperty = "tools_repository_property",
UploadOverlayDbToApi = "upload_overlay_db_to_api",
ValidateDbConfig = "validate_db_config",
}
export type FeatureConfig = {
/**
* Default value in environments where the feature flags API is not available,

View File

@@ -0,0 +1,100 @@
/**
* Features as named by the GitHub API endpoint.
*
* Do not include the `codeql_action_` prefix as this is stripped by the API
* endpoint.
*
* Legacy features should end with `_enabled`.
*/
export enum Feature {
/** Allows supported properties of configuration files to be merged. */
AllowMergeConfigFiles = "allow_merge_config_files",
/** Controls whether we allow multiple values for the `analysis-kinds` input. */
AllowMultipleAnalysisKinds = "allow_multiple_analysis_kinds",
/**
* Whether to check for unsupported traced analysis. Primarily intended as an override to disable
* the check if it causes problems somehow.
*/
CheckUnsupportedTracedAnalysis = "check_unsupported_traced_analysis",
/** Whether to allow the `config-file` input to be specified via a repository property. */
ConfigFileRepositoryProperty = "config_file_repository_property",
CppDependencyInstallation = "cpp_dependency_installation_enabled",
CsharpCacheBuildModeNone = "csharp_cache_bmn",
CsharpNewCacheKey = "csharp_new_cache_key",
DiffInformedQueries = "diff_informed_queries",
DisableCsharpBuildless = "disable_csharp_buildless",
DisableJavaBuildlessEnabled = "disable_java_buildless_enabled",
DisableKotlinAnalysisEnabled = "disable_kotlin_analysis_enabled",
ExportDiagnosticsEnabled = "export_diagnostics_enabled",
/**
* Emergency override that forces the CodeQL CLI to use the JGit-based Git backend instead of its
* default backend selection.
*/
ForceJGit = "force_jgit",
ForceNightly = "force_nightly",
IgnoreGeneratedFiles = "ignore_generated_files",
JavaNetworkDebugging = "java_network_debugging",
OverlayAnalysis = "overlay_analysis",
OverlayAnalysisCodeScanningCpp = "overlay_analysis_code_scanning_cpp",
OverlayAnalysisCodeScanningCsharp = "overlay_analysis_code_scanning_csharp",
OverlayAnalysisCodeScanningGo = "overlay_analysis_code_scanning_go",
OverlayAnalysisCodeScanningJava = "overlay_analysis_code_scanning_java",
OverlayAnalysisCodeScanningJavascript = "overlay_analysis_code_scanning_javascript",
OverlayAnalysisCodeScanningPython = "overlay_analysis_code_scanning_python",
OverlayAnalysisCodeScanningRuby = "overlay_analysis_code_scanning_ruby",
OverlayAnalysisCpp = "overlay_analysis_cpp",
OverlayAnalysisCsharp = "overlay_analysis_csharp",
OverlayAnalysisGo = "overlay_analysis_go",
OverlayAnalysisJava = "overlay_analysis_java",
OverlayAnalysisJavascript = "overlay_analysis_javascript",
/**
* Lowers the overlay minimum available disk space to 8 GB. The lowest enabled limit wins; if
* none are enabled, the default applies.
*/
OverlayAnalysisMinDisk8Gb = "overlay_analysis_min_disk_8_gb",
/**
* Lowers the overlay minimum available disk space to 9 GB. The lowest enabled limit wins; if
* none are enabled, the default applies.
*/
OverlayAnalysisMinDisk9Gb = "overlay_analysis_min_disk_9_gb",
/**
* Lowers the overlay minimum available disk space to 10 GB. The lowest enabled limit wins; if
* none are enabled, the default applies.
*/
OverlayAnalysisMinDisk10Gb = "overlay_analysis_min_disk_10_gb",
/**
* Lowers the overlay minimum available disk space to 11 GB. The lowest enabled limit wins; if
* none are enabled, the default applies.
*/
OverlayAnalysisMinDisk11Gb = "overlay_analysis_min_disk_11_gb",
/**
* Lowers the overlay minimum available disk space to 12 GB. The lowest enabled limit wins; if
* none are enabled, the default applies.
*/
OverlayAnalysisMinDisk12Gb = "overlay_analysis_min_disk_12_gb",
/**
* Lowers the overlay minimum available disk space to 13 GB. The lowest enabled limit wins; if
* none are enabled, the default applies.
*/
OverlayAnalysisMinDisk13Gb = "overlay_analysis_min_disk_13_gb",
OverlayAnalysisPython = "overlay_analysis_python",
OverlayAnalysisRuby = "overlay_analysis_ruby",
/** Controls whether hardware checks are skipped for overlay analysis. */
OverlayAnalysisSkipResourceChecks = "overlay_analysis_skip_resource_checks",
/** Controls whether the Actions cache is checked for overlay build outcomes. */
OverlayAnalysisStatusCheck = "overlay_analysis_status_check",
/** Controls whether overlay build failures on the default branch are stored in the Actions cache. */
OverlayAnalysisStatusSave = "overlay_analysis_status_save",
QaTelemetryEnabled = "qa_telemetry_enabled",
/** Whether we should fail early if we detect that traced analysis is unsupported. */
AbortUnsupportedTracedAnalysis = "abort_unsupported_traced_analysis",
/** Routes (some) API requests through the registry proxy. */
ProxyApiRequests = "proxy_api_requests",
/** Note that this currently only disables baseline file coverage information. */
SkipFileCoverageOnPrs = "skip_file_coverage_on_prs",
StartProxyUseFeaturesRelease = "start_proxy_use_features_release",
/** Whether to allow the `tools` input to be specified via a repository property. */
ToolsRepositoryProperty = "tools_repository_property",
UploadOverlayDbToApi = "upload_overlay_db_to_api",
ValidateDbConfig = "validate_db_config",
}

View File

@@ -1821,7 +1821,8 @@ function createToolcacheEntry(
/**
* Stubs out the download and the diagnostic sink, then downloads the CodeQL tools.
*
* @returns the extraction directory and the toolcache cleanup diagnostic, if emitted.
* @returns the extraction directory and, if the toolcache cleanup diagnostic was emitted, the
* cleanup duration it reports and its other attributes.
*/
async function runDownloadCodeQL(
toolcacheRoot: string,
@@ -1837,6 +1838,7 @@ async function runDownloadCodeQL(
): Promise<{
codeqlFolder: string;
cleanupDiagnostic: toolsDownload.ToolcacheCleanupResult | undefined;
cleanupDurationMs: number | undefined;
}> {
stubDownloadAndExtract();
const addDiagnostic = sinon.stub(diagnostics, "addNoLanguageDiagnostic");
@@ -1866,11 +1868,21 @@ async function runDownloadCodeQL(
.map((call) => call.args[1])
.find((d) => d.source?.id === "codeql-action/toolcache-bundle-cleanup");
return {
codeqlFolder,
cleanupDiagnostic: diagnostic?.attributes as
toolsDownload.ToolcacheCleanupResult | undefined,
};
if (diagnostic === undefined) {
return {
codeqlFolder,
cleanupDiagnostic: undefined,
cleanupDurationMs: undefined,
};
}
// The duration varies between runs, so split it out to let tests compare the other attributes
// exactly.
const { durationMs, ...cleanupDiagnostic } =
diagnostic.attributes as toolsDownload.ToolcacheCleanupResult & {
durationMs: number;
};
return { codeqlFolder, cleanupDiagnostic, cleanupDurationMs: durationMs };
}
/**
@@ -1991,6 +2003,35 @@ test.serial(
},
);
test.serial(
"downloadCodeQLBundle reports the total time taken to clean up the toolcache",
async (t) => {
await withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);
createToolcacheEntry(tmpDir, "CodeQL", CLEANUP_CLI_VERSION);
createToolcacheEntry(tmpDir, "CodeQL", CLEANUP_STALE_VERSION);
// Advance the clock by 1.5s each time a path is deleted, so that deleting both versions
// takes 3s.
let elapsedMs = 1000;
sinon.stub(performance, "now").callsFake(() => elapsedMs);
const rm = fs.promises.rm;
sinon.stub(fs.promises, "rm").callsFake(async (...args) => {
elapsedMs += 1500;
await rm(...args);
});
const { cleanupDurationMs } = await runDownloadCodeQL(
tmpDir,
CLEANUP_BUNDLE_VERSION,
);
t.is(cleanupDurationMs, 3000);
});
},
);
test.serial(
"downloadCodeQLBundle reports no deleted versions when the toolcache has no CodeQL bundles",
async (t) => {

View File

@@ -814,6 +814,7 @@ async function tryDeleteToolcacheBundles({
return;
}
const startTime = performance.now();
const result = await deleteToolcacheBundles({ env, logger });
addNoLanguageDiagnostic(
@@ -821,7 +822,7 @@ async function tryDeleteToolcacheBundles({
makeTelemetryDiagnostic(
"codeql-action/toolcache-bundle-cleanup",
"Toolcache CodeQL bundle cleanup",
{ ...result },
{ ...result, durationMs: util.durationMsSince(startTime) },
),
);
}

View File

@@ -342,13 +342,16 @@ export async function deleteToolcacheBundles({
const versionDirectory = path.join(toolDirectory, entry.name);
try {
const deletionStart = performance.now();
await fs.promises.rm(versionDirectory, {
force: true,
recursive: true,
});
deletedVersions.push(entry.name);
logger.info(
`Deleted the CodeQL tools at '${versionDirectory}' from the toolcache to free up disk space.`,
`Deleted the CodeQL tools at '${versionDirectory}' from the toolcache to free up disk space (${formatDuration(
durationMsSince(deletionStart),
)}).`,
);
} catch (e) {
failed = true;