From 7ea93ee2e19ad7dc528f1dde2a4f9bead6d4fa86 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 24 Feb 2026 18:48:32 +0000 Subject: [PATCH 01/14] Add support for boolean repository properties --- lib/init-action.js | 18 +++++++++-- src/feature-flags/properties.test.ts | 4 +-- src/feature-flags/properties.ts | 47 +++++++++++++++++++--------- 3 files changed, 50 insertions(+), 19 deletions(-) diff --git a/lib/init-action.js b/lib/init-action.js index 7e3eed4cd..507a76cc0 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -104279,9 +104279,22 @@ function getUnknownLanguagesError(languages) { // src/feature-flags/properties.ts var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; return RepositoryPropertyName2; })(RepositoryPropertyName || {}); +function isKnownPropertyName(value) { + return Object.values(RepositoryPropertyName).includes( + value + ); +} +var mapRepositoryProperties = { + ["github-codeql-disable-overlay" /* DISABLE_OVERLAY */]: (value) => value === "true", + ["github-codeql-extra-queries" /* EXTRA_QUERIES */]: (value) => value +}; +function setProperty2(properties, name, value) { + properties[name] = mapRepositoryProperties[name](value); +} async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) { if (gitHubVersion.type === "GitHub Enterprise Server" /* GHES */) { return {}; @@ -104297,7 +104310,6 @@ async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) { logger.debug( `Retrieved ${remoteProperties.length} repository properties: ${remoteProperties.map((p) => p.property_name).join(", ")}` ); - const knownProperties = new Set(Object.values(RepositoryPropertyName)); const properties = {}; for (const property of remoteProperties) { if (property.property_name === void 0) { @@ -104305,8 +104317,8 @@ async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) { `Expected property object to have a 'property_name', but got: ${JSON.stringify(property)}` ); } - if (knownProperties.has(property.property_name)) { - properties[property.property_name] = property.value; + if (isKnownPropertyName(property.property_name)) { + setProperty2(properties, property.property_name, property.value); } } if (Object.keys(properties).length === 0) { diff --git a/src/feature-flags/properties.test.ts b/src/feature-flags/properties.test.ts index dd0c72a21..a7c425002 100644 --- a/src/feature-flags/properties.test.ts +++ b/src/feature-flags/properties.test.ts @@ -59,7 +59,7 @@ test("loadPropertiesFromApi returns empty object if on GHES", async (t) => { data: [ { property_name: "github-codeql-extra-queries", value: "+queries" }, { property_name: "unknown-property", value: "something" }, - ] satisfies properties.RepositoryProperty[], + ] satisfies properties.GitHubPropertiesResponse, }); const logger = getRunnerLogger(true); const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); @@ -82,7 +82,7 @@ test("loadPropertiesFromApi loads known properties", async (t) => { data: [ { property_name: "github-codeql-extra-queries", value: "+queries" }, { property_name: "unknown-property", value: "something" }, - ] satisfies properties.RepositoryProperty[], + ] satisfies properties.GitHubPropertiesResponse, }); const logger = getRunnerLogger(true); const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); diff --git a/src/feature-flags/properties.ts b/src/feature-flags/properties.ts index d0eb23370..70af80129 100644 --- a/src/feature-flags/properties.ts +++ b/src/feature-flags/properties.ts @@ -7,13 +7,42 @@ import { GitHubVariant, GitHubVersion } from "../util"; * Enumerates repository property names that have some meaning to us. */ export enum RepositoryPropertyName { + DISABLE_OVERLAY = "github-codeql-disable-overlay", EXTRA_QUERIES = "github-codeql-extra-queries", } +function isKnownPropertyName(value: string): value is RepositoryPropertyName { + return Object.values(RepositoryPropertyName).includes( + value as RepositoryPropertyName, + ); +} + +type AllRepositoryProperties = { + [RepositoryPropertyName.DISABLE_OVERLAY]: boolean; + [RepositoryPropertyName.EXTRA_QUERIES]: string; +}; + +export type RepositoryProperties = Partial; + +const mapRepositoryProperties: { + [K in RepositoryPropertyName]: (value: string) => AllRepositoryProperties[K]; +} = { + [RepositoryPropertyName.DISABLE_OVERLAY]: (value) => value === "true", + [RepositoryPropertyName.EXTRA_QUERIES]: (value) => value, +}; + +function setProperty( + properties: RepositoryProperties, + name: K, + value: string, +): void { + properties[name] = mapRepositoryProperties[name](value); +} + /** * A repository property has a name and a value. */ -export interface RepositoryProperty { +interface GitHubRepositoryProperty { property_name: string; value: string; } @@ -21,14 +50,7 @@ export interface RepositoryProperty { /** * The API returns a list of `RepositoryProperty` objects. */ -type GitHubPropertiesResponse = RepositoryProperty[]; - -/** - * A partial mapping from `RepositoryPropertyName` to values. - */ -export type RepositoryProperties = Partial< - Record ->; +export type GitHubPropertiesResponse = GitHubRepositoryProperty[]; /** * Retrieves all known repository properties from the API. @@ -62,7 +84,6 @@ export async function loadPropertiesFromApi( `Retrieved ${remoteProperties.length} repository properties: ${remoteProperties.map((p) => p.property_name).join(", ")}`, ); - const knownProperties = new Set(Object.values(RepositoryPropertyName)); const properties: RepositoryProperties = {}; for (const property of remoteProperties) { if (property.property_name === undefined) { @@ -71,10 +92,8 @@ export async function loadPropertiesFromApi( ); } - if ( - knownProperties.has(property.property_name as RepositoryPropertyName) - ) { - properties[property.property_name] = property.value; + if (isKnownPropertyName(property.property_name)) { + setProperty(properties, property.property_name, property.value); } } From ed39a1ea5c90d48ecdf2a7da24e1c8f2a946cfe4 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 24 Feb 2026 18:58:08 +0000 Subject: [PATCH 02/14] Add repository property for disabling overlay --- lib/init-action.js | 8 +++++- src/config-utils.test.ts | 53 ++++++++++++++++++++++++++++++++++++++++ src/config-utils.ts | 15 +++++++++++- 3 files changed, 74 insertions(+), 2 deletions(-) diff --git a/lib/init-action.js b/lib/init-action.js index 507a76cc0..ad82159e7 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -106228,7 +106228,7 @@ async function runnerSupportsOverlayAnalysis(diskUsage, ramInput, logger, useV2R } return true; } -async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, buildMode, ramInput, codeScanningConfig, gitVersion, logger) { +async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, buildMode, ramInput, codeScanningConfig, repositoryProperties, gitVersion, logger) { let overlayDatabaseMode = "none" /* None */; let useOverlayDatabaseCaching = false; let skippedDueToCachedStatus = false; @@ -106238,6 +106238,11 @@ async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, b logger.info( `Setting overlay database mode to ${overlayDatabaseMode} from the CODEQL_OVERLAY_DATABASE_MODE environment variable.` ); + } else if (repositoryProperties["github-codeql-disable-overlay" /* DISABLE_OVERLAY */] === true) { + logger.info( + `Setting overlay database mode to ${"none" /* None */} because the ${"github-codeql-disable-overlay" /* DISABLE_OVERLAY */} repository property is set to true.` + ); + overlayDatabaseMode = "none" /* None */; } else if (await isOverlayAnalysisFeatureEnabled( features, codeql, @@ -106437,6 +106442,7 @@ async function initConfig(features, inputs) { config.buildMode, inputs.ramInput, config.computedConfig, + config.repositoryProperties, gitVersion, logger ); diff --git a/src/config-utils.test.ts b/src/config-utils.test.ts index f8c96b1cd..9e0064fe3 100644 --- a/src/config-utils.test.ts +++ b/src/config-utils.test.ts @@ -14,6 +14,7 @@ import { createStubCodeQL } from "./codeql"; import * as configUtils from "./config-utils"; import * as errorMessages from "./error-messages"; import { Feature } from "./feature-flags"; +import { RepositoryProperties } from "./feature-flags/properties"; import * as gitUtils from "./git-utils"; import { GitVersionInfo } from "./git-utils"; import { KnownLanguage, Language } from "./languages"; @@ -983,6 +984,7 @@ interface OverlayDatabaseModeTestSetup { diskUsage: DiskUsage | undefined; memoryFlagValue: number; shouldSkipOverlayAnalysisDueToCachedStatus: boolean; + repositoryProperties: RepositoryProperties; } const defaultOverlayDatabaseModeTestSetup: OverlayDatabaseModeTestSetup = { @@ -1005,6 +1007,7 @@ const defaultOverlayDatabaseModeTestSetup: OverlayDatabaseModeTestSetup = { }, memoryFlagValue: 6920, shouldSkipOverlayAnalysisDueToCachedStatus: false, + repositoryProperties: {}, }; const getOverlayDatabaseModeMacro = test.macro({ @@ -1082,6 +1085,7 @@ const getOverlayDatabaseModeMacro = test.macro({ setup.buildMode, undefined, setup.codeScanningConfig, + setup.repositoryProperties, setup.gitVersion, logger, ); @@ -1920,6 +1924,55 @@ test( }, ); +test( + getOverlayDatabaseModeMacro, + "No overlay when disabled via repository property", + { + languages: [KnownLanguage.javascript], + features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript], + isPullRequest: true, + repositoryProperties: { + "github-codeql-disable-overlay": true, + }, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.None, + useOverlayDatabaseCaching: false, + }, +); + +test( + getOverlayDatabaseModeMacro, + "Overlay not disabled when repository property is false", + { + languages: [KnownLanguage.javascript], + features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript], + isPullRequest: true, + repositoryProperties: { + "github-codeql-disable-overlay": false, + }, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.Overlay, + useOverlayDatabaseCaching: true, + }, +); + +test( + getOverlayDatabaseModeMacro, + "Environment variable override takes precedence over repository property", + { + overlayDatabaseEnvVar: "overlay", + repositoryProperties: { + "github-codeql-disable-overlay": true, + }, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.Overlay, + useOverlayDatabaseCaching: false, + }, +); + // Exercise language-specific overlay analysis features code paths for (const language in KnownLanguage) { test( diff --git a/src/config-utils.ts b/src/config-utils.ts index 8c54d4e04..7f2b86a15 100644 --- a/src/config-utils.ts +++ b/src/config-utils.ts @@ -35,7 +35,10 @@ import { DocUrl } from "./doc-url"; import { EnvVar } from "./environment"; import * as errorMessages from "./error-messages"; import { Feature, FeatureEnablement } from "./feature-flags"; -import { RepositoryProperties } from "./feature-flags/properties"; +import { + RepositoryProperties, + RepositoryPropertyName, +} from "./feature-flags/properties"; import { getGeneratedFiles, getGitRoot, @@ -750,6 +753,7 @@ export async function getOverlayDatabaseMode( buildMode: BuildMode | undefined, ramInput: string | undefined, codeScanningConfig: UserConfig, + repositoryProperties: RepositoryProperties, gitVersion: GitVersionInfo | undefined, logger: Logger, ): Promise<{ @@ -774,6 +778,14 @@ export async function getOverlayDatabaseMode( `Setting overlay database mode to ${overlayDatabaseMode} ` + "from the CODEQL_OVERLAY_DATABASE_MODE environment variable.", ); + } else if ( + repositoryProperties[RepositoryPropertyName.DISABLE_OVERLAY] === true + ) { + logger.info( + `Setting overlay database mode to ${OverlayDatabaseMode.None} ` + + `because the ${RepositoryPropertyName.DISABLE_OVERLAY} repository property is set to true.`, + ); + overlayDatabaseMode = OverlayDatabaseMode.None; } else if ( await isOverlayAnalysisFeatureEnabled( features, @@ -1067,6 +1079,7 @@ export async function initConfig( config.buildMode, inputs.ramInput, config.computedConfig, + config.repositoryProperties, gitVersion, logger, ); From 2808ca726e92c8bc3686e482111659b11062787d Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 24 Feb 2026 19:56:43 +0000 Subject: [PATCH 03/14] Improve validation and address review comments --- lib/analyze-action-post.js | 12 +++ lib/analyze-action.js | 12 +++ lib/autobuild-action.js | 12 +++ lib/init-action-post.js | 12 +++ lib/init-action.js | 33 +++++--- lib/resolve-environment-action.js | 12 +++ lib/setup-codeql-action.js | 12 +++ lib/start-proxy-action-post.js | 12 +++ lib/start-proxy-action.js | 12 +++ lib/upload-lib.js | 12 +++ lib/upload-sarif-action-post.js | 12 +++ lib/upload-sarif-action.js | 12 +++ src/feature-flags/properties.test.ts | 120 +++++++++++++++++++++++++++ src/feature-flags/properties.ts | 46 +++++++--- 14 files changed, 309 insertions(+), 22 deletions(-) diff --git a/lib/analyze-action-post.js b/lib/analyze-action-post.js index 7c8823caa..6adbd9db4 100644 --- a/lib/analyze-action-post.js +++ b/lib/analyze-action-post.js @@ -161253,6 +161253,18 @@ var core6 = __toESM(require_core()); // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver2 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 806fd5c46..d20a7e6ff 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -107115,6 +107115,18 @@ function createCacheKeyHash(components) { // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver2 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 03b8b56cd..6a2dfbad6 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -103658,6 +103658,18 @@ var core6 = __toESM(require_core()); // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver2 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; diff --git a/lib/init-action-post.js b/lib/init-action-post.js index bc1294485..cb91c0bf3 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -164631,6 +164631,18 @@ var RiskAssessment = { // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver2 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; diff --git a/lib/init-action.js b/lib/init-action.js index ad82159e7..d78abb1b6 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -104283,17 +104283,25 @@ var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; return RepositoryPropertyName2; })(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); function isKnownPropertyName(value) { - return Object.values(RepositoryPropertyName).includes( - value - ); + return KNOWN_REPOSITORY_PROPERTY_NAMES.has(value); } -var mapRepositoryProperties = { - ["github-codeql-disable-overlay" /* DISABLE_OVERLAY */]: (value) => value === "true", - ["github-codeql-extra-queries" /* EXTRA_QUERIES */]: (value) => value +var repositoryPropertyParsers = { + ["github-codeql-disable-overlay" /* DISABLE_OVERLAY */]: (name, value, logger) => { + if (value !== "true" && value !== "false") { + logger.warning( + `Repository property '${name}' has unexpected value '${value}'. Expected 'true' or 'false'. Defaulting to false.` + ); + } + return value === "true"; + }, + ["github-codeql-extra-queries" /* EXTRA_QUERIES */]: (_name, value) => value }; -function setProperty2(properties, name, value) { - properties[name] = mapRepositoryProperties[name](value); +function setProperty2(properties, name, value, logger) { + properties[name] = repositoryPropertyParsers[name](name, value, logger); } async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) { if (gitHubVersion.type === "GitHub Enterprise Server" /* GHES */) { @@ -104314,11 +104322,16 @@ async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) { for (const property of remoteProperties) { if (property.property_name === void 0) { throw new Error( - `Expected property object to have a 'property_name', but got: ${JSON.stringify(property)}` + `Expected repository property object to have a 'property_name', but got: ${JSON.stringify(property)}` + ); + } + if (typeof property.value !== "string") { + throw new Error( + `Expected repository property '${property.property_name}' to have a string value, but got: ${JSON.stringify(property)}` ); } if (isKnownPropertyName(property.property_name)) { - setProperty2(properties, property.property_name, property.value); + setProperty2(properties, property.property_name, property.value, logger); } } if (Object.keys(properties).length === 0) { diff --git a/lib/resolve-environment-action.js b/lib/resolve-environment-action.js index 8aac361a3..ad7b6c8ec 100644 --- a/lib/resolve-environment-action.js +++ b/lib/resolve-environment-action.js @@ -103657,6 +103657,18 @@ var core6 = __toESM(require_core()); // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver2 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; diff --git a/lib/setup-codeql-action.js b/lib/setup-codeql-action.js index 6a521cc92..099e162ae 100644 --- a/lib/setup-codeql-action.js +++ b/lib/setup-codeql-action.js @@ -104651,6 +104651,18 @@ var supportedAnalysisKinds = new Set(Object.values(AnalysisKind)); // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver5 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; diff --git a/lib/start-proxy-action-post.js b/lib/start-proxy-action-post.js index afed44174..78a4ed2a8 100644 --- a/lib/start-proxy-action-post.js +++ b/lib/start-proxy-action-post.js @@ -160888,6 +160888,18 @@ var core6 = __toESM(require_core()); // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver2 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index 1f83e0a9f..daed18596 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -121258,6 +121258,18 @@ var supportedAnalysisKinds = new Set(Object.values(AnalysisKind)); // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver5 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 01383883e..f66b8ce9b 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -106710,6 +106710,18 @@ var core6 = __toESM(require_core()); // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver2 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; diff --git a/lib/upload-sarif-action-post.js b/lib/upload-sarif-action-post.js index 67c09a211..4e0869c70 100644 --- a/lib/upload-sarif-action-post.js +++ b/lib/upload-sarif-action-post.js @@ -161038,6 +161038,18 @@ var core6 = __toESM(require_core()); // src/config/db-config.ts var jsonschema = __toESM(require_lib5()); var semver2 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 34114e3ea..64189de33 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -107382,6 +107382,18 @@ var path7 = __toESM(require("path")); // src/config/db-config.ts var jsonschema = __toESM(require_lib2()); var semver5 = __toESM(require_semver2()); + +// src/feature-flags/properties.ts +var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { + RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; + RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + return RepositoryPropertyName2; +})(RepositoryPropertyName || {}); +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); + +// src/config/db-config.ts var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; diff --git a/src/feature-flags/properties.test.ts b/src/feature-flags/properties.test.ts index a7c425002..8cf8ef7cd 100644 --- a/src/feature-flags/properties.test.ts +++ b/src/feature-flags/properties.test.ts @@ -28,6 +28,9 @@ test("loadPropertiesFromApi throws if response data is not an array", async (t) logger, mockRepositoryNwo, ), + { + message: /Expected repository properties API to return an array/, + }, ); }); @@ -48,6 +51,9 @@ test("loadPropertiesFromApi throws if response data contains unexpected objects" logger, mockRepositoryNwo, ), + { + message: /Expected repository property object to have a 'property_name'/, + }, ); }); @@ -95,3 +101,117 @@ test("loadPropertiesFromApi loads known properties", async (t) => { ); t.deepEqual(response, { "github-codeql-extra-queries": "+queries" }); }); + +test("loadPropertiesFromApi parses true boolean property", async (t) => { + sinon.stub(api, "getRepositoryProperties").resolves({ + headers: {}, + status: 200, + url: "", + data: [ + { + property_name: "github-codeql-disable-overlay", + value: "true", + }, + { property_name: "github-codeql-extra-queries", value: "+queries" }, + ] satisfies properties.GitHubPropertiesResponse, + }); + const logger = getRunnerLogger(true); + const warningSpy = sinon.spy(logger, "warning"); + const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); + const response = await properties.loadPropertiesFromApi( + { + type: util.GitHubVariant.DOTCOM, + }, + logger, + mockRepositoryNwo, + ); + t.deepEqual(response, { + "github-codeql-disable-overlay": true, + "github-codeql-extra-queries": "+queries", + }); + t.true(warningSpy.notCalled); +}); + +test("loadPropertiesFromApi parses false boolean property", async (t) => { + sinon.stub(api, "getRepositoryProperties").resolves({ + headers: {}, + status: 200, + url: "", + data: [ + { + property_name: "github-codeql-disable-overlay", + value: "false", + }, + ] satisfies properties.GitHubPropertiesResponse, + }); + const logger = getRunnerLogger(true); + const warningSpy = sinon.spy(logger, "warning"); + const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); + const response = await properties.loadPropertiesFromApi( + { + type: util.GitHubVariant.DOTCOM, + }, + logger, + mockRepositoryNwo, + ); + t.deepEqual(response, { + "github-codeql-disable-overlay": false, + }); + t.true(warningSpy.notCalled); +}); + +test("loadPropertiesFromApi throws if property value is not a string", async (t) => { + sinon.stub(api, "getRepositoryProperties").resolves({ + headers: {}, + status: 200, + url: "", + data: [{ property_name: "github-codeql-extra-queries", value: 123 }], + }); + const logger = getRunnerLogger(true); + const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); + await t.throwsAsync( + properties.loadPropertiesFromApi( + { + type: util.GitHubVariant.DOTCOM, + }, + logger, + mockRepositoryNwo, + ), + { + message: + /Expected repository property 'github-codeql-extra-queries' to have a string value/, + }, + ); +}); + +test("loadPropertiesFromApi warns if boolean property has unexpected value", async (t) => { + sinon.stub(api, "getRepositoryProperties").resolves({ + headers: {}, + status: 200, + url: "", + data: [ + { + property_name: "github-codeql-disable-overlay", + value: "yes", + }, + ] satisfies properties.GitHubPropertiesResponse, + }); + const logger = getRunnerLogger(true); + const warningSpy = sinon.spy(logger, "warning"); + const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); + const response = await properties.loadPropertiesFromApi( + { + type: util.GitHubVariant.DOTCOM, + }, + logger, + mockRepositoryNwo, + ); + t.deepEqual(response, { + "github-codeql-disable-overlay": false, + }); + t.true(warningSpy.calledOnce); + t.is( + warningSpy.firstCall.args[0], + "Repository property 'github-codeql-disable-overlay' has unexpected value 'yes'. Expected 'true' or 'false'. Defaulting to false.", + ); +}); diff --git a/src/feature-flags/properties.ts b/src/feature-flags/properties.ts index 70af80129..9477cbad4 100644 --- a/src/feature-flags/properties.ts +++ b/src/feature-flags/properties.ts @@ -11,10 +11,12 @@ export enum RepositoryPropertyName { EXTRA_QUERIES = "github-codeql-extra-queries", } +const KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName), +); + function isKnownPropertyName(value: string): value is RepositoryPropertyName { - return Object.values(RepositoryPropertyName).includes( - value as RepositoryPropertyName, - ); + return KNOWN_REPOSITORY_PROPERTY_NAMES.has(value); } type AllRepositoryProperties = { @@ -24,31 +26,45 @@ type AllRepositoryProperties = { export type RepositoryProperties = Partial; -const mapRepositoryProperties: { - [K in RepositoryPropertyName]: (value: string) => AllRepositoryProperties[K]; +/** Parsers that transform repository properties from the API response into typed values. */ +const repositoryPropertyParsers: { + [K in RepositoryPropertyName]: ( + name: K, + value: string, + logger: Logger, + ) => AllRepositoryProperties[K]; } = { - [RepositoryPropertyName.DISABLE_OVERLAY]: (value) => value === "true", - [RepositoryPropertyName.EXTRA_QUERIES]: (value) => value, + [RepositoryPropertyName.DISABLE_OVERLAY]: (name, value, logger) => { + if (value !== "true" && value !== "false") { + logger.warning( + `Repository property '${name}' has unexpected value '${value}'. Expected 'true' or 'false'. Defaulting to false.`, + ); + } + return value === "true"; + }, + [RepositoryPropertyName.EXTRA_QUERIES]: (_name, value) => value, }; +/** Update the partial set of repository properties with the parsed value of the specified property. */ function setProperty( properties: RepositoryProperties, name: K, value: string, + logger: Logger, ): void { - properties[name] = mapRepositoryProperties[name](value); + properties[name] = repositoryPropertyParsers[name](name, value, logger); } /** * A repository property has a name and a value. */ -interface GitHubRepositoryProperty { +export interface GitHubRepositoryProperty { property_name: string; value: string; } /** - * The API returns a list of `RepositoryProperty` objects. + * The API returns a list of `GitHubRepositoryProperty` objects. */ export type GitHubPropertiesResponse = GitHubRepositoryProperty[]; @@ -88,12 +104,18 @@ export async function loadPropertiesFromApi( for (const property of remoteProperties) { if (property.property_name === undefined) { throw new Error( - `Expected property object to have a 'property_name', but got: ${JSON.stringify(property)}`, + `Expected repository property object to have a 'property_name', but got: ${JSON.stringify(property)}`, + ); + } + + if (typeof property.value !== "string") { + throw new Error( + `Expected repository property '${property.property_name}' to have a string value, but got: ${JSON.stringify(property)}`, ); } if (isKnownPropertyName(property.property_name)) { - setProperty(properties, property.property_name, property.value); + setProperty(properties, property.property_name, property.value, logger); } } From 9c61a2ddf4eb51d1b093e7ca3bd1ffdc29ec0a5f Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 25 Feb 2026 11:32:32 +0000 Subject: [PATCH 04/14] Reorganize properties file --- lib/init-action.js | 40 ++++++++++--------- src/feature-flags/properties.ts | 70 ++++++++++++++++++++------------- 2 files changed, 65 insertions(+), 45 deletions(-) diff --git a/lib/init-action.js b/lib/init-action.js index d78abb1b6..e85eaeb08 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -104283,26 +104283,10 @@ var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; return RepositoryPropertyName2; })(RepositoryPropertyName || {}); -var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( - Object.values(RepositoryPropertyName) -); -function isKnownPropertyName(value) { - return KNOWN_REPOSITORY_PROPERTY_NAMES.has(value); -} var repositoryPropertyParsers = { - ["github-codeql-disable-overlay" /* DISABLE_OVERLAY */]: (name, value, logger) => { - if (value !== "true" && value !== "false") { - logger.warning( - `Repository property '${name}' has unexpected value '${value}'. Expected 'true' or 'false'. Defaulting to false.` - ); - } - return value === "true"; - }, - ["github-codeql-extra-queries" /* EXTRA_QUERIES */]: (_name, value) => value + ["github-codeql-disable-overlay" /* DISABLE_OVERLAY */]: parseBooleanRepositoryProperty, + ["github-codeql-extra-queries" /* EXTRA_QUERIES */]: parseStringRepositoryProperty }; -function setProperty2(properties, name, value, logger) { - properties[name] = repositoryPropertyParsers[name](name, value, logger); -} async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) { if (gitHubVersion.type === "GitHub Enterprise Server" /* GHES */) { return {}; @@ -104353,6 +104337,26 @@ async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) { ); } } +function setProperty2(properties, name, value, logger) { + properties[name] = repositoryPropertyParsers[name](name, value, logger); +} +function parseBooleanRepositoryProperty(name, value, logger) { + if (value !== "true" && value !== "false") { + logger.warning( + `Repository property '${name}' has unexpected value '${value}'. Expected 'true' or 'false'. Defaulting to false.` + ); + } + return value === "true"; +} +function parseStringRepositoryProperty(_name, value) { + return value; +} +var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName) +); +function isKnownPropertyName(name) { + return KNOWN_REPOSITORY_PROPERTY_NAMES.has(name); +} // src/config/db-config.ts function shouldCombine(inputValue) { diff --git a/src/feature-flags/properties.ts b/src/feature-flags/properties.ts index 9477cbad4..3b55fcb6a 100644 --- a/src/feature-flags/properties.ts +++ b/src/feature-flags/properties.ts @@ -11,19 +11,13 @@ export enum RepositoryPropertyName { EXTRA_QUERIES = "github-codeql-extra-queries", } -const KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( - Object.values(RepositoryPropertyName), -); - -function isKnownPropertyName(value: string): value is RepositoryPropertyName { - return KNOWN_REPOSITORY_PROPERTY_NAMES.has(value); -} - +/** Parsed types of the known repository properties. */ type AllRepositoryProperties = { [RepositoryPropertyName.DISABLE_OVERLAY]: boolean; [RepositoryPropertyName.EXTRA_QUERIES]: string; }; +/** Parsed repository properties. */ export type RepositoryProperties = Partial; /** Parsers that transform repository properties from the API response into typed values. */ @@ -34,27 +28,10 @@ const repositoryPropertyParsers: { logger: Logger, ) => AllRepositoryProperties[K]; } = { - [RepositoryPropertyName.DISABLE_OVERLAY]: (name, value, logger) => { - if (value !== "true" && value !== "false") { - logger.warning( - `Repository property '${name}' has unexpected value '${value}'. Expected 'true' or 'false'. Defaulting to false.`, - ); - } - return value === "true"; - }, - [RepositoryPropertyName.EXTRA_QUERIES]: (_name, value) => value, + [RepositoryPropertyName.DISABLE_OVERLAY]: parseBooleanRepositoryProperty, + [RepositoryPropertyName.EXTRA_QUERIES]: parseStringRepositoryProperty, }; -/** Update the partial set of repository properties with the parsed value of the specified property. */ -function setProperty( - properties: RepositoryProperties, - name: K, - value: string, - logger: Logger, -): void { - properties[name] = repositoryPropertyParsers[name](name, value, logger); -} - /** * A repository property has a name and a value. */ @@ -139,3 +116,42 @@ export async function loadPropertiesFromApi( ); } } + +/** Update the partial set of repository properties with the parsed value of the specified property. */ +function setProperty( + properties: RepositoryProperties, + name: K, + value: string, + logger: Logger, +): void { + properties[name] = repositoryPropertyParsers[name](name, value, logger); +} + +/** Parse a boolean repository property. */ +function parseBooleanRepositoryProperty( + name: string, + value: string, + logger: Logger, +): boolean { + if (value !== "true" && value !== "false") { + logger.warning( + `Repository property '${name}' has unexpected value '${value}'. Expected 'true' or 'false'. Defaulting to false.`, + ); + } + return value === "true"; +} + +/** Parse a string repository property. */ +function parseStringRepositoryProperty(_name: string, value: string): string { + return value; +} + +/** Set of known repository property names, for fast lookups. */ +const KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( + Object.values(RepositoryPropertyName), +); + +/** Returns whether the given value is a known repository property name. */ +function isKnownPropertyName(name: string): name is RepositoryPropertyName { + return KNOWN_REPOSITORY_PROPERTY_NAMES.has(name); +} From 70db156dcb3b4e4b3cd25cb65cb0a925c14298be Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 25 Feb 2026 11:44:45 +0000 Subject: [PATCH 05/14] Add diagnostic when overlay disabled by repo property --- lib/init-action.js | 32 +++++++++++++++++++++++++++++--- src/config-utils.test.ts | 3 +++ src/config-utils.ts | 31 +++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 3 deletions(-) diff --git a/lib/init-action.js b/lib/init-action.js index e85eaeb08..6c9b6d53a 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -106249,6 +106249,7 @@ async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, b let overlayDatabaseMode = "none" /* None */; let useOverlayDatabaseCaching = false; let skippedDueToCachedStatus = false; + let disabledByRepositoryProperty = false; const modeEnv = process.env.CODEQL_OVERLAY_DATABASE_MODE; if (modeEnv === "overlay" /* Overlay */ || modeEnv === "overlay-base" /* OverlayBase */ || modeEnv === "none" /* None */) { overlayDatabaseMode = modeEnv; @@ -106260,6 +106261,7 @@ async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, b `Setting overlay database mode to ${"none" /* None */} because the ${"github-codeql-disable-overlay" /* DISABLE_OVERLAY */} repository property is set to true.` ); overlayDatabaseMode = "none" /* None */; + disabledByRepositoryProperty = true; } else if (await isOverlayAnalysisFeatureEnabled( features, codeql, @@ -106312,7 +106314,8 @@ async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, b const nonOverlayAnalysis = { overlayDatabaseMode: "none" /* None */, useOverlayDatabaseCaching: false, - skippedDueToCachedStatus + skippedDueToCachedStatus, + disabledByRepositoryProperty }; if (overlayDatabaseMode === "none" /* None */) { return nonOverlayAnalysis; @@ -106358,7 +106361,8 @@ async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, b return { overlayDatabaseMode, useOverlayDatabaseCaching, - skippedDueToCachedStatus + skippedDueToCachedStatus, + disabledByRepositoryProperty }; } function dbLocationOrDefault(dbLocation, tempDir) { @@ -106450,7 +106454,8 @@ async function initConfig(features, inputs) { const { overlayDatabaseMode, useOverlayDatabaseCaching, - skippedDueToCachedStatus: overlaySkippedDueToCachedStatus + skippedDueToCachedStatus: overlaySkippedDueToCachedStatus, + disabledByRepositoryProperty: overlayDisabledByRepositoryProperty } = await getOverlayDatabaseMode( inputs.codeql, inputs.features, @@ -106491,6 +106496,27 @@ Improved incremental analysis will be automatically retried when the next versio ) ); } + if (overlayDisabledByRepositoryProperty) { + addNoLanguageDiagnostic( + config, + makeDiagnostic( + "codeql-action/overlay-disabled-by-repository-property", + "Improved incremental analysis disabled by repository property", + { + attributes: { + languages: config.languages + }, + markdownMessage: `Improved incremental analysis has been disabled because the \`${"github-codeql-disable-overlay" /* DISABLE_OVERLAY */}\` repository property is set to \`true\`. To re-enable improved incremental analysis, set this property to \`false\` or remove it.`, + severity: "note", + visibility: { + cliSummaryTable: true, + statusPage: true, + telemetry: true + } + } + ) + ); + } if (overlayDatabaseMode === "overlay" /* Overlay */ || await shouldPerformDiffInformedAnalysis( inputs.codeql, inputs.features, diff --git a/src/config-utils.test.ts b/src/config-utils.test.ts index 9e0064fe3..769fd14d3 100644 --- a/src/config-utils.test.ts +++ b/src/config-utils.test.ts @@ -1019,6 +1019,7 @@ const getOverlayDatabaseModeMacro = test.macro({ overlayDatabaseMode: OverlayDatabaseMode; useOverlayDatabaseCaching: boolean; skippedDueToCachedStatus?: boolean; + disabledByRepositoryProperty?: boolean; }, ) => { return await withTmpDir(async (tempDir) => { @@ -1092,6 +1093,7 @@ const getOverlayDatabaseModeMacro = test.macro({ t.deepEqual(result, { skippedDueToCachedStatus: false, + disabledByRepositoryProperty: false, ...expected, }); } finally { @@ -1938,6 +1940,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledByRepositoryProperty: true, }, ); diff --git a/src/config-utils.ts b/src/config-utils.ts index 7f2b86a15..0d7e51fb0 100644 --- a/src/config-utils.ts +++ b/src/config-utils.ts @@ -760,10 +760,12 @@ export async function getOverlayDatabaseMode( overlayDatabaseMode: OverlayDatabaseMode; useOverlayDatabaseCaching: boolean; skippedDueToCachedStatus: boolean; + disabledByRepositoryProperty: boolean; }> { let overlayDatabaseMode = OverlayDatabaseMode.None; let useOverlayDatabaseCaching = false; let skippedDueToCachedStatus = false; + let disabledByRepositoryProperty = false; const modeEnv = process.env.CODEQL_OVERLAY_DATABASE_MODE; // Any unrecognized CODEQL_OVERLAY_DATABASE_MODE value will be ignored and @@ -786,6 +788,7 @@ export async function getOverlayDatabaseMode( `because the ${RepositoryPropertyName.DISABLE_OVERLAY} repository property is set to true.`, ); overlayDatabaseMode = OverlayDatabaseMode.None; + disabledByRepositoryProperty = true; } else if ( await isOverlayAnalysisFeatureEnabled( features, @@ -856,6 +859,7 @@ export async function getOverlayDatabaseMode( overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, skippedDueToCachedStatus, + disabledByRepositoryProperty, }; if (overlayDatabaseMode === OverlayDatabaseMode.None) { @@ -921,6 +925,7 @@ export async function getOverlayDatabaseMode( overlayDatabaseMode, useOverlayDatabaseCaching, skippedDueToCachedStatus, + disabledByRepositoryProperty, }; } @@ -1071,6 +1076,7 @@ export async function initConfig( overlayDatabaseMode, useOverlayDatabaseCaching, skippedDueToCachedStatus: overlaySkippedDueToCachedStatus, + disabledByRepositoryProperty: overlayDisabledByRepositoryProperty, } = await getOverlayDatabaseMode( inputs.codeql, inputs.features, @@ -1119,6 +1125,31 @@ export async function initConfig( ); } + if (overlayDisabledByRepositoryProperty) { + addNoLanguageDiagnostic( + config, + makeDiagnostic( + "codeql-action/overlay-disabled-by-repository-property", + "Improved incremental analysis disabled by repository property", + { + attributes: { + languages: config.languages, + }, + markdownMessage: + "Improved incremental analysis has been disabled because the " + + `\`${RepositoryPropertyName.DISABLE_OVERLAY}\` repository property is set to \`true\`. ` + + "To re-enable improved incremental analysis, set this property to `false` or remove it.", + severity: "note", + visibility: { + cliSummaryTable: true, + statusPage: true, + telemetry: true, + }, + }, + ), + ); + } + if ( overlayDatabaseMode === OverlayDatabaseMode.Overlay || (await shouldPerformDiffInformedAnalysis( From 182427800cea6d68aaa9c2e4b4e732f005ae5d8b Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 25 Feb 2026 14:22:13 +0000 Subject: [PATCH 06/14] Add disabled reason --- lib/init-action.js | 40 +++++++++++----------- src/config-utils.test.ts | 50 ++++++++++++++++++++++------ src/config-utils.ts | 71 +++++++++++++++++++++++++++------------- 3 files changed, 109 insertions(+), 52 deletions(-) diff --git a/lib/init-action.js b/lib/init-action.js index 6c9b6d53a..f1967cb07 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -106248,8 +106248,7 @@ async function runnerSupportsOverlayAnalysis(diskUsage, ramInput, logger, useV2R async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, buildMode, ramInput, codeScanningConfig, repositoryProperties, gitVersion, logger) { let overlayDatabaseMode = "none" /* None */; let useOverlayDatabaseCaching = false; - let skippedDueToCachedStatus = false; - let disabledByRepositoryProperty = false; + let disabledReason; const modeEnv = process.env.CODEQL_OVERLAY_DATABASE_MODE; if (modeEnv === "overlay" /* Overlay */ || modeEnv === "overlay-base" /* OverlayBase */ || modeEnv === "none" /* None */) { overlayDatabaseMode = modeEnv; @@ -106261,7 +106260,7 @@ async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, b `Setting overlay database mode to ${"none" /* None */} because the ${"github-codeql-disable-overlay" /* DISABLE_OVERLAY */} repository property is set to true.` ); overlayDatabaseMode = "none" /* None */; - disabledByRepositoryProperty = true; + disabledReason = "disabled-by-repository-property" /* DisabledByRepositoryProperty */; } else if (await isOverlayAnalysisFeatureEnabled( features, codeql, @@ -106286,17 +106285,19 @@ async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, b useV2ResourceChecks )) { overlayDatabaseMode = "none" /* None */; + disabledReason = "insufficient-resources" /* InsufficientResources */; } else if (checkOverlayStatus && diskUsage === void 0) { logger.warning( `Unable to determine disk usage, therefore setting overlay database mode to ${"none" /* None */}.` ); overlayDatabaseMode = "none" /* None */; + disabledReason = "unable-to-determine-disk-usage" /* UnableToDetermineDiskUsage */; } else if (checkOverlayStatus && diskUsage && await shouldSkipOverlayAnalysis(codeql, languages, diskUsage, logger)) { logger.info( `Setting overlay database mode to ${"none" /* None */} because overlay analysis previously failed with this combination of languages, disk space, and CodeQL version.` ); overlayDatabaseMode = "none" /* None */; - skippedDueToCachedStatus = true; + disabledReason = "skipped-due-to-cached-status" /* SkippedDueToCachedStatus */; } else if (isAnalyzingPullRequest()) { overlayDatabaseMode = "overlay" /* Overlay */; useOverlayDatabaseCaching = true; @@ -106310,15 +106311,16 @@ async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, b `Setting overlay database mode to ${overlayDatabaseMode} with caching because we are analyzing the default branch.` ); } + } else { + disabledReason = "feature-not-enabled" /* FeatureNotEnabled */; } - const nonOverlayAnalysis = { + const disabledResult = (reason) => ({ overlayDatabaseMode: "none" /* None */, useOverlayDatabaseCaching: false, - skippedDueToCachedStatus, - disabledByRepositoryProperty - }; + disabledReason: reason + }); if (overlayDatabaseMode === "none" /* None */) { - return nonOverlayAnalysis; + return disabledResult(disabledReason); } if (buildMode !== "none" /* None */ && (await Promise.all( languages.map( @@ -106332,37 +106334,36 @@ async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, b logger.warning( `Cannot build an ${overlayDatabaseMode} database because build-mode is set to "${buildMode}" instead of "none". Falling back to creating a normal full database instead.` ); - return nonOverlayAnalysis; + return disabledResult("incompatible-build-mode" /* IncompatibleBuildMode */); } if (!await codeQlVersionAtLeast(codeql, CODEQL_OVERLAY_MINIMUM_VERSION)) { logger.warning( `Cannot build an ${overlayDatabaseMode} database because the CodeQL CLI is older than ${CODEQL_OVERLAY_MINIMUM_VERSION}. Falling back to creating a normal full database instead.` ); - return nonOverlayAnalysis; + return disabledResult("incompatible-codeql" /* IncompatibleCodeQl */); } if (await getGitRoot(sourceRoot) === void 0) { logger.warning( `Cannot build an ${overlayDatabaseMode} database because the source root "${sourceRoot}" is not inside a git repository. Falling back to creating a normal full database instead.` ); - return nonOverlayAnalysis; + return disabledResult("no-git-root" /* NoGitRoot */); } if (gitVersion === void 0) { logger.warning( `Cannot build an ${overlayDatabaseMode} database because the Git version could not be determined. Falling back to creating a normal full database instead.` ); - return nonOverlayAnalysis; + return disabledResult("incompatible-git" /* IncompatibleGit */); } if (!gitVersion.isAtLeast(GIT_MINIMUM_VERSION_FOR_OVERLAY)) { logger.warning( `Cannot build an ${overlayDatabaseMode} database because the installed Git version is older than ${GIT_MINIMUM_VERSION_FOR_OVERLAY}. Falling back to creating a normal full database instead.` ); - return nonOverlayAnalysis; + return disabledResult("incompatible-git" /* IncompatibleGit */); } return { overlayDatabaseMode, useOverlayDatabaseCaching, - skippedDueToCachedStatus, - disabledByRepositoryProperty + disabledReason }; } function dbLocationOrDefault(dbLocation, tempDir) { @@ -106454,8 +106455,7 @@ async function initConfig(features, inputs) { const { overlayDatabaseMode, useOverlayDatabaseCaching, - skippedDueToCachedStatus: overlaySkippedDueToCachedStatus, - disabledByRepositoryProperty: overlayDisabledByRepositoryProperty + disabledReason: overlayDisabledReason } = await getOverlayDatabaseMode( inputs.codeql, inputs.features, @@ -106473,7 +106473,7 @@ async function initConfig(features, inputs) { ); config.overlayDatabaseMode = overlayDatabaseMode; config.useOverlayDatabaseCaching = useOverlayDatabaseCaching; - if (overlaySkippedDueToCachedStatus) { + if (overlayDisabledReason === "skipped-due-to-cached-status" /* SkippedDueToCachedStatus */) { addNoLanguageDiagnostic( config, makeDiagnostic( @@ -106496,7 +106496,7 @@ Improved incremental analysis will be automatically retried when the next versio ) ); } - if (overlayDisabledByRepositoryProperty) { + if (overlayDisabledReason === "disabled-by-repository-property" /* DisabledByRepositoryProperty */) { addNoLanguageDiagnostic( config, makeDiagnostic( diff --git a/src/config-utils.test.ts b/src/config-utils.test.ts index 769fd14d3..d8ebf05fb 100644 --- a/src/config-utils.test.ts +++ b/src/config-utils.test.ts @@ -12,6 +12,7 @@ import * as api from "./api-client"; import { CachingKind } from "./caching-utils"; import { createStubCodeQL } from "./codeql"; import * as configUtils from "./config-utils"; +import { OverlayDisabledReason } from "./config-utils"; import * as errorMessages from "./error-messages"; import { Feature } from "./feature-flags"; import { RepositoryProperties } from "./feature-flags/properties"; @@ -1018,8 +1019,7 @@ const getOverlayDatabaseModeMacro = test.macro({ expected: { overlayDatabaseMode: OverlayDatabaseMode; useOverlayDatabaseCaching: boolean; - skippedDueToCachedStatus?: boolean; - disabledByRepositoryProperty?: boolean; + disabledReason?: OverlayDisabledReason; }, ) => { return await withTmpDir(async (tempDir) => { @@ -1091,11 +1091,11 @@ const getOverlayDatabaseModeMacro = test.macro({ logger, ); - t.deepEqual(result, { - skippedDueToCachedStatus: false, - disabledByRepositoryProperty: false, - ...expected, - }); + if (!("disabledReason" in expected)) { + expected.disabledReason = undefined; + } + + t.deepEqual(result, expected); } finally { // Restore the original environment process.env = originalEnv; @@ -1150,6 +1150,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1232,6 +1233,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.InsufficientResources, }, ); @@ -1250,6 +1252,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.InsufficientResources, }, ); @@ -1294,6 +1297,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.InsufficientResources, }, ); @@ -1337,6 +1341,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.InsufficientResources, }, ); @@ -1355,6 +1360,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.InsufficientResources, }, ); @@ -1393,7 +1399,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, - skippedDueToCachedStatus: true, + disabledReason: OverlayDisabledReason.SkippedDueToCachedStatus, }, ); @@ -1413,7 +1419,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, - skippedDueToCachedStatus: true, + disabledReason: OverlayDisabledReason.SkippedDueToCachedStatus, }, ); @@ -1434,6 +1440,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1454,6 +1461,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1474,6 +1482,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1494,6 +1503,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1508,6 +1518,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1522,6 +1533,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1536,6 +1548,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1605,6 +1618,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.InsufficientResources, }, ); @@ -1645,6 +1659,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.InsufficientResources, }, ); @@ -1663,6 +1678,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.InsufficientResources, }, ); @@ -1702,6 +1718,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1722,6 +1739,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1742,6 +1760,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1762,6 +1781,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1776,6 +1796,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1790,6 +1811,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1804,6 +1826,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); @@ -1857,6 +1880,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.IncompatibleBuildMode, }, ); @@ -1871,6 +1895,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.IncompatibleBuildMode, }, ); @@ -1884,6 +1909,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.IncompatibleCodeQl, }, ); @@ -1897,6 +1923,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.NoGitRoot, }, ); @@ -1910,6 +1937,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.IncompatibleGit, }, ); @@ -1923,6 +1951,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.IncompatibleGit, }, ); @@ -1940,7 +1969,7 @@ test( { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, - disabledByRepositoryProperty: true, + disabledReason: OverlayDisabledReason.DisabledByRepositoryProperty, }, ); @@ -1989,6 +2018,7 @@ for (const language in KnownLanguage) { { overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, + disabledReason: OverlayDisabledReason.FeatureNotEnabled, }, ); } diff --git a/src/config-utils.ts b/src/config-utils.ts index 0d7e51fb0..8d218b059 100644 --- a/src/config-utils.ts +++ b/src/config-utils.ts @@ -69,6 +69,30 @@ import { DiskUsage, } from "./util"; +/** + * The reason why overlay analysis was disabled, if applicable. + */ +export enum OverlayDisabledReason { + /** Overlay analysis was disabled by a repository property. */ + DisabledByRepositoryProperty = "disabled-by-repository-property", + /** Overlay analysis feature was not enabled. */ + FeatureNotEnabled = "feature-not-enabled", + /** The build mode is incompatible with overlay analysis. */ + IncompatibleBuildMode = "incompatible-build-mode", + /** The CodeQL CLI version is too old to support overlay analysis. */ + IncompatibleCodeQl = "incompatible-codeql", + /** The Git version could not be determined or is too old. */ + IncompatibleGit = "incompatible-git", + /** The runner does not have enough disk space or memory. */ + InsufficientResources = "insufficient-resources", + /** The source root is not inside a git repository. */ + NoGitRoot = "no-git-root", + /** Overlay analysis was skipped because it previously failed with similar hardware resources. */ + SkippedDueToCachedStatus = "skipped-due-to-cached-status", + /** Disk usage could not be determined during the overlay status check. */ + UnableToDetermineDiskUsage = "unable-to-determine-disk-usage", +} + export * from "./config/db-config"; /** @@ -759,13 +783,11 @@ export async function getOverlayDatabaseMode( ): Promise<{ overlayDatabaseMode: OverlayDatabaseMode; useOverlayDatabaseCaching: boolean; - skippedDueToCachedStatus: boolean; - disabledByRepositoryProperty: boolean; + disabledReason: OverlayDisabledReason | undefined; }> { let overlayDatabaseMode = OverlayDatabaseMode.None; let useOverlayDatabaseCaching = false; - let skippedDueToCachedStatus = false; - let disabledByRepositoryProperty = false; + let disabledReason: OverlayDisabledReason | undefined; const modeEnv = process.env.CODEQL_OVERLAY_DATABASE_MODE; // Any unrecognized CODEQL_OVERLAY_DATABASE_MODE value will be ignored and @@ -788,7 +810,7 @@ export async function getOverlayDatabaseMode( `because the ${RepositoryPropertyName.DISABLE_OVERLAY} repository property is set to true.`, ); overlayDatabaseMode = OverlayDatabaseMode.None; - disabledByRepositoryProperty = true; + disabledReason = OverlayDisabledReason.DisabledByRepositoryProperty; } else if ( await isOverlayAnalysisFeatureEnabled( features, @@ -821,11 +843,13 @@ export async function getOverlayDatabaseMode( )) ) { overlayDatabaseMode = OverlayDatabaseMode.None; + disabledReason = OverlayDisabledReason.InsufficientResources; } else if (checkOverlayStatus && diskUsage === undefined) { logger.warning( `Unable to determine disk usage, therefore setting overlay database mode to ${OverlayDatabaseMode.None}.`, ); overlayDatabaseMode = OverlayDatabaseMode.None; + disabledReason = OverlayDisabledReason.UnableToDetermineDiskUsage; } else if ( checkOverlayStatus && diskUsage && @@ -837,7 +861,7 @@ export async function getOverlayDatabaseMode( "disk space, and CodeQL version.", ); overlayDatabaseMode = OverlayDatabaseMode.None; - skippedDueToCachedStatus = true; + disabledReason = OverlayDisabledReason.SkippedDueToCachedStatus; } else if (isAnalyzingPullRequest()) { overlayDatabaseMode = OverlayDatabaseMode.Overlay; useOverlayDatabaseCaching = true; @@ -853,17 +877,18 @@ export async function getOverlayDatabaseMode( "with caching because we are analyzing the default branch.", ); } + } else { + disabledReason = OverlayDisabledReason.FeatureNotEnabled; } - const nonOverlayAnalysis = { + const disabledResult = (reason: OverlayDisabledReason | undefined) => ({ overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, - skippedDueToCachedStatus, - disabledByRepositoryProperty, - }; + disabledReason: reason, + }); if (overlayDatabaseMode === OverlayDatabaseMode.None) { - return nonOverlayAnalysis; + return disabledResult(disabledReason); } if ( @@ -886,7 +911,7 @@ export async function getOverlayDatabaseMode( `build-mode is set to "${buildMode}" instead of "none". ` + "Falling back to creating a normal full database instead.", ); - return nonOverlayAnalysis; + return disabledResult(OverlayDisabledReason.IncompatibleBuildMode); } if (!(await codeQlVersionAtLeast(codeql, CODEQL_OVERLAY_MINIMUM_VERSION))) { logger.warning( @@ -894,7 +919,7 @@ export async function getOverlayDatabaseMode( `the CodeQL CLI is older than ${CODEQL_OVERLAY_MINIMUM_VERSION}. ` + "Falling back to creating a normal full database instead.", ); - return nonOverlayAnalysis; + return disabledResult(OverlayDisabledReason.IncompatibleCodeQl); } if ((await getGitRoot(sourceRoot)) === undefined) { logger.warning( @@ -902,7 +927,7 @@ export async function getOverlayDatabaseMode( `the source root "${sourceRoot}" is not inside a git repository. ` + "Falling back to creating a normal full database instead.", ); - return nonOverlayAnalysis; + return disabledResult(OverlayDisabledReason.NoGitRoot); } if (gitVersion === undefined) { logger.warning( @@ -910,7 +935,7 @@ export async function getOverlayDatabaseMode( "the Git version could not be determined. " + "Falling back to creating a normal full database instead.", ); - return nonOverlayAnalysis; + return disabledResult(OverlayDisabledReason.IncompatibleGit); } if (!gitVersion.isAtLeast(GIT_MINIMUM_VERSION_FOR_OVERLAY)) { logger.warning( @@ -918,14 +943,13 @@ export async function getOverlayDatabaseMode( `the installed Git version is older than ${GIT_MINIMUM_VERSION_FOR_OVERLAY}. ` + "Falling back to creating a normal full database instead.", ); - return nonOverlayAnalysis; + return disabledResult(OverlayDisabledReason.IncompatibleGit); } return { overlayDatabaseMode, useOverlayDatabaseCaching, - skippedDueToCachedStatus, - disabledByRepositoryProperty, + disabledReason, }; } @@ -1075,8 +1099,7 @@ export async function initConfig( const { overlayDatabaseMode, useOverlayDatabaseCaching, - skippedDueToCachedStatus: overlaySkippedDueToCachedStatus, - disabledByRepositoryProperty: overlayDisabledByRepositoryProperty, + disabledReason: overlayDisabledReason, } = await getOverlayDatabaseMode( inputs.codeql, inputs.features, @@ -1096,7 +1119,9 @@ export async function initConfig( config.overlayDatabaseMode = overlayDatabaseMode; config.useOverlayDatabaseCaching = useOverlayDatabaseCaching; - if (overlaySkippedDueToCachedStatus) { + if ( + overlayDisabledReason === OverlayDisabledReason.SkippedDueToCachedStatus + ) { addNoLanguageDiagnostic( config, makeDiagnostic( @@ -1125,7 +1150,9 @@ export async function initConfig( ); } - if (overlayDisabledByRepositoryProperty) { + if ( + overlayDisabledReason === OverlayDisabledReason.DisabledByRepositoryProperty + ) { addNoLanguageDiagnostic( config, makeDiagnostic( From 445a2a9bb2e867a25d86d1ec52fd7704f2a9a668 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 25 Feb 2026 14:36:03 +0000 Subject: [PATCH 07/14] Record overlay disablement reason --- lib/init-action.js | 103 +++++++++++++++++++-------------- src/codeql.test.ts | 6 +- src/config-utils.test.ts | 29 +++++----- src/config-utils.ts | 90 +++-------------------------- src/overlay/diagnostics.ts | 113 +++++++++++++++++++++++++++++++++++++ src/util.ts | 3 +- 6 files changed, 203 insertions(+), 141 deletions(-) create mode 100644 src/overlay/diagnostics.ts diff --git a/lib/init-action.js b/lib/init-action.js index f1967cb07..ba5c1e742 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -105779,6 +105779,64 @@ var KnownLanguage = /* @__PURE__ */ ((KnownLanguage2) => { return KnownLanguage2; })(KnownLanguage || {}); +// src/overlay/diagnostics.ts +async function addOverlayDisablementDiagnostics(config, codeql, overlayDisabledReason) { + addNoLanguageDiagnostic( + config, + makeTelemetryDiagnostic( + "codeql-action/overlay-disabled", + "Overlay analysis disabled", + { + reason: overlayDisabledReason + } + ) + ); + if (overlayDisabledReason === "skipped-due-to-cached-status" /* SkippedDueToCachedStatus */) { + addNoLanguageDiagnostic( + config, + makeDiagnostic( + "codeql-action/overlay-disabled-due-to-cached-status", + "Skipped improved incremental analysis because it failed previously with similar hardware resources", + { + attributes: { + languages: config.languages + }, + markdownMessage: `Improved incremental analysis was skipped because it previously failed for this repository with CodeQL version ${(await codeql.getVersion()).version} on a runner with similar hardware resources. Improved incremental analysis may require a significant amount of disk space for some repositories. If you want to enable improved incremental analysis, increase the disk space available to the runner. If that doesn't help, contact GitHub Support for further assistance. + +Improved incremental analysis will be automatically retried when the next version of CodeQL is released. You can also manually trigger a retry by [removing](${"https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manage-caches#deleting-cache-entries" /* DELETE_ACTIONS_CACHE_ENTRIES */}) \`codeql-overlay-status-*\` entries from the Actions cache.`, + severity: "note", + visibility: { + cliSummaryTable: true, + statusPage: true, + telemetry: false + } + } + ) + ); + } + if (overlayDisabledReason === "disabled-by-repository-property" /* DisabledByRepositoryProperty */) { + addNoLanguageDiagnostic( + config, + makeDiagnostic( + "codeql-action/overlay-disabled-by-repository-property", + "Improved incremental analysis disabled by repository property", + { + attributes: { + languages: config.languages + }, + markdownMessage: `Improved incremental analysis has been disabled because the \`${"github-codeql-disable-overlay" /* DISABLE_OVERLAY */}\` repository property is set to \`true\`. To re-enable improved incremental analysis, set this property to \`false\` or remove it.`, + severity: "note", + visibility: { + cliSummaryTable: true, + statusPage: true, + telemetry: false + } + } + ) + ); + } +} + // src/overlay/status.ts var fs5 = __toESM(require("fs")); var path7 = __toESM(require("path")); @@ -106473,48 +106531,11 @@ async function initConfig(features, inputs) { ); config.overlayDatabaseMode = overlayDatabaseMode; config.useOverlayDatabaseCaching = useOverlayDatabaseCaching; - if (overlayDisabledReason === "skipped-due-to-cached-status" /* SkippedDueToCachedStatus */) { - addNoLanguageDiagnostic( + if (overlayDisabledReason !== void 0) { + await addOverlayDisablementDiagnostics( config, - makeDiagnostic( - "codeql-action/overlay-skipped-due-to-cached-status", - "Skipped improved incremental analysis because it failed previously with similar hardware resources", - { - attributes: { - languages: config.languages - }, - markdownMessage: `Improved incremental analysis was skipped because it previously failed for this repository with CodeQL version ${(await inputs.codeql.getVersion()).version} on a runner with similar hardware resources. Improved incremental analysis may require a significant amount of disk space for some repositories. If you want to enable improved incremental analysis, increase the disk space available to the runner. If that doesn't help, contact GitHub Support for further assistance. - -Improved incremental analysis will be automatically retried when the next version of CodeQL is released. You can also manually trigger a retry by [removing](${"https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manage-caches#deleting-cache-entries" /* DELETE_ACTIONS_CACHE_ENTRIES */}) \`codeql-overlay-status-*\` entries from the Actions cache.`, - severity: "note", - visibility: { - cliSummaryTable: true, - statusPage: true, - telemetry: true - } - } - ) - ); - } - if (overlayDisabledReason === "disabled-by-repository-property" /* DisabledByRepositoryProperty */) { - addNoLanguageDiagnostic( - config, - makeDiagnostic( - "codeql-action/overlay-disabled-by-repository-property", - "Improved incremental analysis disabled by repository property", - { - attributes: { - languages: config.languages - }, - markdownMessage: `Improved incremental analysis has been disabled because the \`${"github-codeql-disable-overlay" /* DISABLE_OVERLAY */}\` repository property is set to \`true\`. To re-enable improved incremental analysis, set this property to \`false\` or remove it.`, - severity: "note", - visibility: { - cliSummaryTable: true, - statusPage: true, - telemetry: true - } - } - ) + inputs.codeql, + overlayDisabledReason ); } if (overlayDatabaseMode === "overlay" /* Overlay */ || await shouldPerformDiffInformedAnalysis( diff --git a/src/codeql.test.ts b/src/codeql.test.ts index 6730f8d8b..eb1ea9b34 100644 --- a/src/codeql.test.ts +++ b/src/codeql.test.ts @@ -15,10 +15,10 @@ import { CliError } from "./cli-errors"; import * as codeql from "./codeql"; import { AugmentationProperties, - Config, - defaultAugmentationProperties, generateCodeScanningConfig, -} from "./config-utils"; + defaultAugmentationProperties, +} from "./config/db-config"; +import type { Config } from "./config-utils"; import * as defaults from "./defaults.json"; import { DocUrl } from "./doc-url"; import { KnownLanguage } from "./languages"; diff --git a/src/config-utils.test.ts b/src/config-utils.test.ts index d8ebf05fb..7624f1a2d 100644 --- a/src/config-utils.test.ts +++ b/src/config-utils.test.ts @@ -11,8 +11,8 @@ import { AnalysisKind, supportedAnalysisKinds } from "./analyses"; import * as api from "./api-client"; import { CachingKind } from "./caching-utils"; import { createStubCodeQL } from "./codeql"; +import { UserConfig } from "./config/db-config"; import * as configUtils from "./config-utils"; -import { OverlayDisabledReason } from "./config-utils"; import * as errorMessages from "./error-messages"; import { Feature } from "./feature-flags"; import { RepositoryProperties } from "./feature-flags/properties"; @@ -21,6 +21,7 @@ import { GitVersionInfo } from "./git-utils"; import { KnownLanguage, Language } from "./languages"; import { getRunnerLogger } from "./logging"; import { CODEQL_OVERLAY_MINIMUM_VERSION, OverlayDatabaseMode } from "./overlay"; +import { OverlayDisabledReason } from "./overlay/diagnostics"; import * as overlayStatus from "./overlay/status"; import { parseRepositoryNwo } from "./repository"; import { @@ -248,7 +249,7 @@ test("initActionState doesn't throw if there are queries configured in the repos }; // Expected configuration for a CQ-only analysis. - const computedConfig: configUtils.UserConfig = { + const computedConfig: UserConfig = { "disable-default-queries": true, queries: [{ uses: "code-quality" }], "query-filters": [], @@ -493,7 +494,7 @@ test("load non-empty input", async (t) => { fs.mkdirSync(path.join(tempDir, "foo")); - const userConfig: configUtils.UserConfig = { + const userConfig: UserConfig = { name: "my config", "disable-default-queries": true, queries: [{ uses: "./foo" }], @@ -981,7 +982,7 @@ interface OverlayDatabaseModeTestSetup { codeqlVersion: string; gitRoot: string | undefined; gitVersion: GitVersionInfo | undefined; - codeScanningConfig: configUtils.UserConfig; + codeScanningConfig: UserConfig; diskUsage: DiskUsage | undefined; memoryFlagValue: number; shouldSkipOverlayAnalysisDueToCachedStatus: boolean; @@ -1189,7 +1190,7 @@ test( features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript], codeScanningConfig: { packs: ["some-custom-pack@1.0.0"], - } as configUtils.UserConfig, + } as UserConfig, isDefaultBranch: true, }, { @@ -1434,7 +1435,7 @@ test( ], codeScanningConfig: { "disable-default-queries": true, - } as configUtils.UserConfig, + } as UserConfig, isDefaultBranch: true, }, { @@ -1455,7 +1456,7 @@ test( ], codeScanningConfig: { packs: ["some-custom-pack@1.0.0"], - } as configUtils.UserConfig, + } as UserConfig, isDefaultBranch: true, }, { @@ -1476,7 +1477,7 @@ test( ], codeScanningConfig: { queries: [{ uses: "some-query.ql" }], - } as configUtils.UserConfig, + } as UserConfig, isDefaultBranch: true, }, { @@ -1497,7 +1498,7 @@ test( ], codeScanningConfig: { "query-filters": [{ include: { "security-severity": "high" } }], - } as configUtils.UserConfig, + } as UserConfig, isDefaultBranch: true, }, { @@ -1574,7 +1575,7 @@ test( features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript], codeScanningConfig: { packs: ["some-custom-pack@1.0.0"], - } as configUtils.UserConfig, + } as UserConfig, isPullRequest: true, }, { @@ -1712,7 +1713,7 @@ test( ], codeScanningConfig: { "disable-default-queries": true, - } as configUtils.UserConfig, + } as UserConfig, isPullRequest: true, }, { @@ -1733,7 +1734,7 @@ test( ], codeScanningConfig: { packs: ["some-custom-pack@1.0.0"], - } as configUtils.UserConfig, + } as UserConfig, isPullRequest: true, }, { @@ -1754,7 +1755,7 @@ test( ], codeScanningConfig: { queries: [{ uses: "some-query.ql" }], - } as configUtils.UserConfig, + } as UserConfig, isPullRequest: true, }, { @@ -1775,7 +1776,7 @@ test( ], codeScanningConfig: { "query-filters": [{ include: { "security-severity": "high" } }], - } as configUtils.UserConfig, + } as UserConfig, isPullRequest: true, }, { diff --git a/src/config-utils.ts b/src/config-utils.ts index 8d218b059..3b23a12bd 100644 --- a/src/config-utils.ts +++ b/src/config-utils.ts @@ -27,11 +27,9 @@ import { } from "./config/db-config"; import { addNoLanguageDiagnostic, - makeDiagnostic, makeTelemetryDiagnostic, } from "./diagnostics"; import { shouldPerformDiffInformedAnalysis } from "./diff-informed-analysis-utils"; -import { DocUrl } from "./doc-url"; import { EnvVar } from "./environment"; import * as errorMessages from "./error-messages"; import { Feature, FeatureEnablement } from "./feature-flags"; @@ -50,6 +48,10 @@ import { import { KnownLanguage, Language } from "./languages"; import { Logger } from "./logging"; import { CODEQL_OVERLAY_MINIMUM_VERSION, OverlayDatabaseMode } from "./overlay"; +import { + addOverlayDisablementDiagnostics, + OverlayDisabledReason, +} from "./overlay/diagnostics"; import { shouldSkipOverlayAnalysis } from "./overlay/status"; import { RepositoryNwo } from "./repository"; import { ToolsFeature } from "./tools-features"; @@ -69,32 +71,6 @@ import { DiskUsage, } from "./util"; -/** - * The reason why overlay analysis was disabled, if applicable. - */ -export enum OverlayDisabledReason { - /** Overlay analysis was disabled by a repository property. */ - DisabledByRepositoryProperty = "disabled-by-repository-property", - /** Overlay analysis feature was not enabled. */ - FeatureNotEnabled = "feature-not-enabled", - /** The build mode is incompatible with overlay analysis. */ - IncompatibleBuildMode = "incompatible-build-mode", - /** The CodeQL CLI version is too old to support overlay analysis. */ - IncompatibleCodeQl = "incompatible-codeql", - /** The Git version could not be determined or is too old. */ - IncompatibleGit = "incompatible-git", - /** The runner does not have enough disk space or memory. */ - InsufficientResources = "insufficient-resources", - /** The source root is not inside a git repository. */ - NoGitRoot = "no-git-root", - /** Overlay analysis was skipped because it previously failed with similar hardware resources. */ - SkippedDueToCachedStatus = "skipped-due-to-cached-status", - /** Disk usage could not be determined during the overlay status check. */ - UnableToDetermineDiskUsage = "unable-to-determine-disk-usage", -} - -export * from "./config/db-config"; - /** * The minimum available disk space (in MB) required to perform overlay analysis. * If the available disk space on the runner is below the threshold when deciding @@ -1119,61 +1095,11 @@ export async function initConfig( config.overlayDatabaseMode = overlayDatabaseMode; config.useOverlayDatabaseCaching = useOverlayDatabaseCaching; - if ( - overlayDisabledReason === OverlayDisabledReason.SkippedDueToCachedStatus - ) { - addNoLanguageDiagnostic( + if (overlayDisabledReason !== undefined) { + await addOverlayDisablementDiagnostics( config, - makeDiagnostic( - "codeql-action/overlay-skipped-due-to-cached-status", - "Skipped improved incremental analysis because it failed previously with similar hardware resources", - { - attributes: { - languages: config.languages, - }, - markdownMessage: - `Improved incremental analysis was skipped because it previously failed for this repository ` + - `with CodeQL version ${(await inputs.codeql.getVersion()).version} on a runner with similar hardware resources. ` + - "Improved incremental analysis may require a significant amount of disk space for some repositories. " + - "If you want to enable improved incremental analysis, increase the disk space available " + - "to the runner. If that doesn't help, contact GitHub Support for further assistance.\n\n" + - "Improved incremental analysis will be automatically retried when the next version of CodeQL is released. " + - `You can also manually trigger a retry by [removing](${DocUrl.DELETE_ACTIONS_CACHE_ENTRIES}) \`codeql-overlay-status-*\` entries from the Actions cache.`, - severity: "note", - visibility: { - cliSummaryTable: true, - statusPage: true, - telemetry: true, - }, - }, - ), - ); - } - - if ( - overlayDisabledReason === OverlayDisabledReason.DisabledByRepositoryProperty - ) { - addNoLanguageDiagnostic( - config, - makeDiagnostic( - "codeql-action/overlay-disabled-by-repository-property", - "Improved incremental analysis disabled by repository property", - { - attributes: { - languages: config.languages, - }, - markdownMessage: - "Improved incremental analysis has been disabled because the " + - `\`${RepositoryPropertyName.DISABLE_OVERLAY}\` repository property is set to \`true\`. ` + - "To re-enable improved incremental analysis, set this property to `false` or remove it.", - severity: "note", - visibility: { - cliSummaryTable: true, - statusPage: true, - telemetry: true, - }, - }, - ), + inputs.codeql, + overlayDisabledReason, ); } diff --git a/src/overlay/diagnostics.ts b/src/overlay/diagnostics.ts new file mode 100644 index 000000000..ab1266868 --- /dev/null +++ b/src/overlay/diagnostics.ts @@ -0,0 +1,113 @@ +import { type CodeQL } from "../codeql"; +import { type Config } from "../config-utils"; +import { + addNoLanguageDiagnostic, + makeDiagnostic, + makeTelemetryDiagnostic, +} from "../diagnostics"; +import { DocUrl } from "../doc-url"; +import { RepositoryPropertyName } from "../feature-flags/properties"; + +/** Reason why overlay analysis was disabled. */ +export enum OverlayDisabledReason { + /** Overlay analysis was disabled by a repository property. */ + DisabledByRepositoryProperty = "disabled-by-repository-property", + /** Overlay analysis feature was not enabled. */ + FeatureNotEnabled = "feature-not-enabled", + /** The build mode is incompatible with overlay analysis. */ + IncompatibleBuildMode = "incompatible-build-mode", + /** The CodeQL CLI version is too old to support overlay analysis. */ + IncompatibleCodeQl = "incompatible-codeql", + /** The Git version could not be determined or is too old. */ + IncompatibleGit = "incompatible-git", + /** The runner does not have enough disk space or memory. */ + InsufficientResources = "insufficient-resources", + /** The source root is not inside a git repository. */ + NoGitRoot = "no-git-root", + /** Overlay analysis was skipped because it previously failed with similar hardware resources. */ + SkippedDueToCachedStatus = "skipped-due-to-cached-status", + /** Disk usage could not be determined during the overlay status check. */ + UnableToDetermineDiskUsage = "unable-to-determine-disk-usage", +} + +/** + * Add diagnostics related to why overlay was disabled. This includes: + * + * - A telemetry diagnostic that logs the disablement reason. + * - User-facing diagnostics for specific disablement reasons that are + * actionable by the user. + */ +export async function addOverlayDisablementDiagnostics( + config: Config, + codeql: CodeQL, + overlayDisabledReason: OverlayDisabledReason, +): Promise { + addNoLanguageDiagnostic( + config, + makeTelemetryDiagnostic( + "codeql-action/overlay-disabled", + "Overlay analysis disabled", + { + reason: overlayDisabledReason, + }, + ), + ); + + if ( + overlayDisabledReason === OverlayDisabledReason.SkippedDueToCachedStatus + ) { + addNoLanguageDiagnostic( + config, + makeDiagnostic( + "codeql-action/overlay-disabled-due-to-cached-status", + "Skipped improved incremental analysis because it failed previously with similar hardware resources", + { + attributes: { + languages: config.languages, + }, + markdownMessage: + `Improved incremental analysis was skipped because it previously failed for this repository ` + + `with CodeQL version ${(await codeql.getVersion()).version} on a runner with similar hardware resources. ` + + "Improved incremental analysis may require a significant amount of disk space for some repositories. " + + "If you want to enable improved incremental analysis, increase the disk space available " + + "to the runner. If that doesn't help, contact GitHub Support for further assistance.\n\n" + + "Improved incremental analysis will be automatically retried when the next version of CodeQL is released. " + + `You can also manually trigger a retry by [removing](${DocUrl.DELETE_ACTIONS_CACHE_ENTRIES}) \`codeql-overlay-status-*\` entries from the Actions cache.`, + severity: "note", + visibility: { + cliSummaryTable: true, + statusPage: true, + telemetry: false, + }, + }, + ), + ); + } + + if ( + overlayDisabledReason === OverlayDisabledReason.DisabledByRepositoryProperty + ) { + addNoLanguageDiagnostic( + config, + makeDiagnostic( + "codeql-action/overlay-disabled-by-repository-property", + "Improved incremental analysis disabled by repository property", + { + attributes: { + languages: config.languages, + }, + markdownMessage: + "Improved incremental analysis has been disabled because the " + + `\`${RepositoryPropertyName.DISABLE_OVERLAY}\` repository property is set to \`true\`. ` + + "To re-enable improved incremental analysis, set this property to `false` or remove it.", + severity: "note", + visibility: { + cliSummaryTable: true, + statusPage: true, + telemetry: false, + }, + }, + ), + ); + } +} diff --git a/src/util.ts b/src/util.ts index df3b5148f..bc5f02f00 100644 --- a/src/util.ts +++ b/src/util.ts @@ -11,7 +11,8 @@ import * as semver from "semver"; import * as apiCompatibility from "./api-compatibility.json"; import type { CodeQL, VersionInfo } from "./codeql"; -import type { Config, Pack } from "./config-utils"; +import type { Pack } from "./config/db-config"; +import type { Config } from "./config-utils"; import { EnvVar } from "./environment"; import { Language } from "./languages"; import { Logger } from "./logging"; From 8105503f1aaa53bc6ca23bf3aff5b97e8f02c840 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 25 Feb 2026 15:12:37 +0000 Subject: [PATCH 08/14] Add `merge_group` trigger to required checks to prepare for merge queue --- .github/workflows/__all-platform-bundle.yml | 1 + .github/workflows/__analysis-kinds.yml | 1 + .github/workflows/__analyze-ref-input.yml | 1 + .github/workflows/__autobuild-action.yml | 1 + .../workflows/__autobuild-direct-tracing-with-working-dir.yml | 1 + .github/workflows/__autobuild-working-dir.yml | 1 + .github/workflows/__build-mode-autobuild.yml | 1 + .github/workflows/__build-mode-manual.yml | 1 + .github/workflows/__build-mode-none.yml | 1 + .github/workflows/__build-mode-rollback.yml | 1 + .github/workflows/__bundle-from-nightly.yml | 1 + .github/workflows/__bundle-from-toolcache.yml | 1 + .github/workflows/__bundle-toolcache.yml | 1 + .github/workflows/__bundle-zstd.yml | 1 + .github/workflows/__cleanup-db-cluster-dir.yml | 1 + .github/workflows/__config-export.yml | 1 + .github/workflows/__config-input.yml | 1 + .github/workflows/__cpp-deptrace-disabled.yml | 1 + .github/workflows/__cpp-deptrace-enabled-on-macos.yml | 1 + .github/workflows/__cpp-deptrace-enabled.yml | 1 + .github/workflows/__diagnostics-export.yml | 1 + .github/workflows/__export-file-baseline-information.yml | 1 + .github/workflows/__extractor-ram-threads.yml | 1 + .github/workflows/__global-proxy.yml | 1 + .github/workflows/__go-custom-queries.yml | 1 + .../workflows/__go-indirect-tracing-workaround-diagnostic.yml | 1 + .../__go-indirect-tracing-workaround-no-file-program.yml | 1 + .github/workflows/__go-indirect-tracing-workaround.yml | 1 + .github/workflows/__go-tracing-autobuilder.yml | 1 + .github/workflows/__go-tracing-custom-build-steps.yml | 1 + .github/workflows/__go-tracing-legacy-workflow.yml | 1 + .github/workflows/__init-with-registries.yml | 1 + .github/workflows/__javascript-source-root.yml | 1 + .github/workflows/__job-run-uuid-sarif.yml | 1 + .github/workflows/__language-aliases.yml | 1 + .github/workflows/__local-bundle.yml | 1 + .github/workflows/__multi-language-autodetect.yml | 1 + .github/workflows/__overlay-init-fallback.yml | 1 + .../workflows/__packaging-codescanning-config-inputs-js.yml | 1 + .github/workflows/__packaging-config-inputs-js.yml | 1 + .github/workflows/__packaging-config-js.yml | 1 + .github/workflows/__packaging-inputs-js.yml | 1 + .github/workflows/__remote-config.yml | 1 + .github/workflows/__resolve-environment-action.yml | 1 + .github/workflows/__rubocop-multi-language.yml | 1 + .github/workflows/__ruby.yml | 1 + .github/workflows/__rust.yml | 1 + .github/workflows/__split-workflow.yml | 1 + .github/workflows/__start-proxy.yml | 1 + .github/workflows/__submit-sarif-failure.yml | 1 + .github/workflows/__swift-autobuild.yml | 1 + .github/workflows/__swift-custom-build.yml | 1 + .github/workflows/__unset-environment.yml | 1 + .github/workflows/__upload-ref-sha-input.yml | 1 + .github/workflows/__upload-sarif.yml | 1 + .github/workflows/__with-checkout-path.yml | 1 + .github/workflows/check-expected-release-files.yml | 1 + .github/workflows/codeql.yml | 1 + .github/workflows/codescanning-config-cli.yml | 3 ++- .github/workflows/debug-artifacts-failure-safe.yml | 3 ++- .github/workflows/debug-artifacts-safe.yml | 3 ++- .github/workflows/pr-checks.yml | 1 + .github/workflows/python312-windows.yml | 1 + .github/workflows/query-filters.yml | 3 ++- .github/workflows/test-codeql-bundle-all.yml | 3 ++- pr-checks/sync.py | 1 + 66 files changed, 71 insertions(+), 5 deletions(-) diff --git a/.github/workflows/__all-platform-bundle.yml b/.github/workflows/__all-platform-bundle.yml index 1547c3761..6a1d0ab76 100644 --- a/.github/workflows/__all-platform-bundle.yml +++ b/.github/workflows/__all-platform-bundle.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__analysis-kinds.yml b/.github/workflows/__analysis-kinds.yml index 1f270b278..555d1d91f 100644 --- a/.github/workflows/__analysis-kinds.yml +++ b/.github/workflows/__analysis-kinds.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__analyze-ref-input.yml b/.github/workflows/__analyze-ref-input.yml index 842cfcc08..75392cce1 100644 --- a/.github/workflows/__analyze-ref-input.yml +++ b/.github/workflows/__analyze-ref-input.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__autobuild-action.yml b/.github/workflows/__autobuild-action.yml index 482d12456..b7e6c3fb6 100644 --- a/.github/workflows/__autobuild-action.yml +++ b/.github/workflows/__autobuild-action.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml b/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml index 3c218ec26..3669f58f1 100644 --- a/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml +++ b/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__autobuild-working-dir.yml b/.github/workflows/__autobuild-working-dir.yml index 77bb424e4..b13e43b47 100644 --- a/.github/workflows/__autobuild-working-dir.yml +++ b/.github/workflows/__autobuild-working-dir.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__build-mode-autobuild.yml b/.github/workflows/__build-mode-autobuild.yml index 749def27e..8ce6b2230 100644 --- a/.github/workflows/__build-mode-autobuild.yml +++ b/.github/workflows/__build-mode-autobuild.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__build-mode-manual.yml b/.github/workflows/__build-mode-manual.yml index f10e8e36a..e98af266b 100644 --- a/.github/workflows/__build-mode-manual.yml +++ b/.github/workflows/__build-mode-manual.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__build-mode-none.yml b/.github/workflows/__build-mode-none.yml index d4fc1c3da..4ee2c5bc7 100644 --- a/.github/workflows/__build-mode-none.yml +++ b/.github/workflows/__build-mode-none.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__build-mode-rollback.yml b/.github/workflows/__build-mode-rollback.yml index d833e3ad8..87f7bfdfc 100644 --- a/.github/workflows/__build-mode-rollback.yml +++ b/.github/workflows/__build-mode-rollback.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__bundle-from-nightly.yml b/.github/workflows/__bundle-from-nightly.yml index e4eaf6312..31f1ccead 100644 --- a/.github/workflows/__bundle-from-nightly.yml +++ b/.github/workflows/__bundle-from-nightly.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__bundle-from-toolcache.yml b/.github/workflows/__bundle-from-toolcache.yml index 6e00eaa2d..bd9e68f2e 100644 --- a/.github/workflows/__bundle-from-toolcache.yml +++ b/.github/workflows/__bundle-from-toolcache.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__bundle-toolcache.yml b/.github/workflows/__bundle-toolcache.yml index d1ba1b826..d50e108db 100644 --- a/.github/workflows/__bundle-toolcache.yml +++ b/.github/workflows/__bundle-toolcache.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__bundle-zstd.yml b/.github/workflows/__bundle-zstd.yml index 026743c90..5a905d86d 100644 --- a/.github/workflows/__bundle-zstd.yml +++ b/.github/workflows/__bundle-zstd.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__cleanup-db-cluster-dir.yml b/.github/workflows/__cleanup-db-cluster-dir.yml index 28e9e6fdd..b1ad35fc0 100644 --- a/.github/workflows/__cleanup-db-cluster-dir.yml +++ b/.github/workflows/__cleanup-db-cluster-dir.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__config-export.yml b/.github/workflows/__config-export.yml index 42a3a1242..c629f5a31 100644 --- a/.github/workflows/__config-export.yml +++ b/.github/workflows/__config-export.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__config-input.yml b/.github/workflows/__config-input.yml index 7b048ed18..86f1dd894 100644 --- a/.github/workflows/__config-input.yml +++ b/.github/workflows/__config-input.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__cpp-deptrace-disabled.yml b/.github/workflows/__cpp-deptrace-disabled.yml index 578101d0e..cd8fa15ee 100644 --- a/.github/workflows/__cpp-deptrace-disabled.yml +++ b/.github/workflows/__cpp-deptrace-disabled.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__cpp-deptrace-enabled-on-macos.yml b/.github/workflows/__cpp-deptrace-enabled-on-macos.yml index aacbdf854..ef2f60f41 100644 --- a/.github/workflows/__cpp-deptrace-enabled-on-macos.yml +++ b/.github/workflows/__cpp-deptrace-enabled-on-macos.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__cpp-deptrace-enabled.yml b/.github/workflows/__cpp-deptrace-enabled.yml index c08e66ff7..60f865484 100644 --- a/.github/workflows/__cpp-deptrace-enabled.yml +++ b/.github/workflows/__cpp-deptrace-enabled.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__diagnostics-export.yml b/.github/workflows/__diagnostics-export.yml index c39524a97..daaa0456b 100644 --- a/.github/workflows/__diagnostics-export.yml +++ b/.github/workflows/__diagnostics-export.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index 41fb9220f..dd4a76cf8 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__extractor-ram-threads.yml b/.github/workflows/__extractor-ram-threads.yml index 7c3c6e0b0..37d12d7ad 100644 --- a/.github/workflows/__extractor-ram-threads.yml +++ b/.github/workflows/__extractor-ram-threads.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__global-proxy.yml b/.github/workflows/__global-proxy.yml index 1535e3689..27be1c465 100644 --- a/.github/workflows/__global-proxy.yml +++ b/.github/workflows/__global-proxy.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-custom-queries.yml b/.github/workflows/__go-custom-queries.yml index 715a1758a..ef9067630 100644 --- a/.github/workflows/__go-custom-queries.yml +++ b/.github/workflows/__go-custom-queries.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml b/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml index b869d3ebc..0ad360368 100644 --- a/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml +++ b/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml b/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml index 33bde3414..55430aa08 100644 --- a/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml +++ b/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-indirect-tracing-workaround.yml b/.github/workflows/__go-indirect-tracing-workaround.yml index 848dc7a98..3aee3af91 100644 --- a/.github/workflows/__go-indirect-tracing-workaround.yml +++ b/.github/workflows/__go-indirect-tracing-workaround.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-tracing-autobuilder.yml b/.github/workflows/__go-tracing-autobuilder.yml index 2c33de351..dc64fda4e 100644 --- a/.github/workflows/__go-tracing-autobuilder.yml +++ b/.github/workflows/__go-tracing-autobuilder.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-tracing-custom-build-steps.yml b/.github/workflows/__go-tracing-custom-build-steps.yml index 0f0ca6e50..525b42af7 100644 --- a/.github/workflows/__go-tracing-custom-build-steps.yml +++ b/.github/workflows/__go-tracing-custom-build-steps.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-tracing-legacy-workflow.yml b/.github/workflows/__go-tracing-legacy-workflow.yml index 136deca85..b139ce943 100644 --- a/.github/workflows/__go-tracing-legacy-workflow.yml +++ b/.github/workflows/__go-tracing-legacy-workflow.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__init-with-registries.yml b/.github/workflows/__init-with-registries.yml index bd088572c..6fec53262 100644 --- a/.github/workflows/__init-with-registries.yml +++ b/.github/workflows/__init-with-registries.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__javascript-source-root.yml b/.github/workflows/__javascript-source-root.yml index a39db258c..c94c6322e 100644 --- a/.github/workflows/__javascript-source-root.yml +++ b/.github/workflows/__javascript-source-root.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__job-run-uuid-sarif.yml b/.github/workflows/__job-run-uuid-sarif.yml index cecb2bf46..c60f6dc53 100644 --- a/.github/workflows/__job-run-uuid-sarif.yml +++ b/.github/workflows/__job-run-uuid-sarif.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__language-aliases.yml b/.github/workflows/__language-aliases.yml index b7f9691f6..91e2861c4 100644 --- a/.github/workflows/__language-aliases.yml +++ b/.github/workflows/__language-aliases.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__local-bundle.yml b/.github/workflows/__local-bundle.yml index 420be84b8..a9cab8443 100644 --- a/.github/workflows/__local-bundle.yml +++ b/.github/workflows/__local-bundle.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index d34d5829a..11b0e6642 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__overlay-init-fallback.yml b/.github/workflows/__overlay-init-fallback.yml index cc2a18984..71b46f3e0 100644 --- a/.github/workflows/__overlay-init-fallback.yml +++ b/.github/workflows/__overlay-init-fallback.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__packaging-codescanning-config-inputs-js.yml b/.github/workflows/__packaging-codescanning-config-inputs-js.yml index 5c846d32c..ffbf50d2a 100644 --- a/.github/workflows/__packaging-codescanning-config-inputs-js.yml +++ b/.github/workflows/__packaging-codescanning-config-inputs-js.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__packaging-config-inputs-js.yml b/.github/workflows/__packaging-config-inputs-js.yml index 42c5fb38a..812f09f4e 100644 --- a/.github/workflows/__packaging-config-inputs-js.yml +++ b/.github/workflows/__packaging-config-inputs-js.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__packaging-config-js.yml b/.github/workflows/__packaging-config-js.yml index 8dfa834c3..e07ff1d31 100644 --- a/.github/workflows/__packaging-config-js.yml +++ b/.github/workflows/__packaging-config-js.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__packaging-inputs-js.yml b/.github/workflows/__packaging-inputs-js.yml index 883b0d47a..5c5c5e830 100644 --- a/.github/workflows/__packaging-inputs-js.yml +++ b/.github/workflows/__packaging-inputs-js.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__remote-config.yml b/.github/workflows/__remote-config.yml index 2164a41b8..bc535280a 100644 --- a/.github/workflows/__remote-config.yml +++ b/.github/workflows/__remote-config.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__resolve-environment-action.yml b/.github/workflows/__resolve-environment-action.yml index b9deb5fad..c97ba6426 100644 --- a/.github/workflows/__resolve-environment-action.yml +++ b/.github/workflows/__resolve-environment-action.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__rubocop-multi-language.yml b/.github/workflows/__rubocop-multi-language.yml index b7f476057..e27432488 100644 --- a/.github/workflows/__rubocop-multi-language.yml +++ b/.github/workflows/__rubocop-multi-language.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__ruby.yml b/.github/workflows/__ruby.yml index 97331fd10..0198d5ea9 100644 --- a/.github/workflows/__ruby.yml +++ b/.github/workflows/__ruby.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__rust.yml b/.github/workflows/__rust.yml index 24744c4a5..037725328 100644 --- a/.github/workflows/__rust.yml +++ b/.github/workflows/__rust.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__split-workflow.yml b/.github/workflows/__split-workflow.yml index c37899e60..e2e63f08e 100644 --- a/.github/workflows/__split-workflow.yml +++ b/.github/workflows/__split-workflow.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__start-proxy.yml b/.github/workflows/__start-proxy.yml index 5d2019b49..3a3ecf153 100644 --- a/.github/workflows/__start-proxy.yml +++ b/.github/workflows/__start-proxy.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__submit-sarif-failure.yml b/.github/workflows/__submit-sarif-failure.yml index 7b9b6bc05..d04c965d9 100644 --- a/.github/workflows/__submit-sarif-failure.yml +++ b/.github/workflows/__submit-sarif-failure.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 0c51a28ff..642d76d36 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index d5862cc5d..333e17bd2 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__unset-environment.yml b/.github/workflows/__unset-environment.yml index b823bcf11..7ccd088f2 100644 --- a/.github/workflows/__unset-environment.yml +++ b/.github/workflows/__unset-environment.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__upload-ref-sha-input.yml b/.github/workflows/__upload-ref-sha-input.yml index cba2702f0..9464bd1e2 100644 --- a/.github/workflows/__upload-ref-sha-input.yml +++ b/.github/workflows/__upload-ref-sha-input.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__upload-sarif.yml b/.github/workflows/__upload-sarif.yml index 0ab7c0308..948f8224b 100644 --- a/.github/workflows/__upload-sarif.yml +++ b/.github/workflows/__upload-sarif.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__with-checkout-path.yml b/.github/workflows/__with-checkout-path.yml index 00ddb28c0..535d15b14 100644 --- a/.github/workflows/__with-checkout-path.yml +++ b/.github/workflows/__with-checkout-path.yml @@ -18,6 +18,7 @@ on: - synchronize - reopened - ready_for_review + merge_group: {} schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/check-expected-release-files.yml b/.github/workflows/check-expected-release-files.yml index c0dd21af6..a8dac289d 100644 --- a/.github/workflows/check-expected-release-files.yml +++ b/.github/workflows/check-expected-release-files.yml @@ -8,6 +8,7 @@ on: # Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened # by other workflows. types: [opened, synchronize, reopened, ready_for_review] + merge_group: defaults: run: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 999aa6dfd..765212ced 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -7,6 +7,7 @@ on: # Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened # by other workflows. types: [opened, synchronize, reopened, ready_for_review] + merge_group: schedule: # Weekly on Sunday. - cron: '30 1 * * 0' diff --git a/.github/workflows/codescanning-config-cli.yml b/.github/workflows/codescanning-config-cli.yml index cbac3a8a9..9cae63050 100644 --- a/.github/workflows/codescanning-config-cli.yml +++ b/.github/workflows/codescanning-config-cli.yml @@ -23,9 +23,10 @@ on: - synchronize - reopened - ready_for_review + merge_group: schedule: - cron: '0 5 * * *' - workflow_dispatch: {} + workflow_dispatch: defaults: run: diff --git a/.github/workflows/debug-artifacts-failure-safe.yml b/.github/workflows/debug-artifacts-failure-safe.yml index 1c1343b19..616b12b62 100644 --- a/.github/workflows/debug-artifacts-failure-safe.yml +++ b/.github/workflows/debug-artifacts-failure-safe.yml @@ -14,9 +14,10 @@ on: - synchronize - reopened - ready_for_review + merge_group: schedule: - cron: '0 5 * * *' - workflow_dispatch: {} + workflow_dispatch: defaults: run: diff --git a/.github/workflows/debug-artifacts-safe.yml b/.github/workflows/debug-artifacts-safe.yml index 5314cc753..20a38241a 100644 --- a/.github/workflows/debug-artifacts-safe.yml +++ b/.github/workflows/debug-artifacts-safe.yml @@ -13,9 +13,10 @@ on: - synchronize - reopened - ready_for_review + merge_group: schedule: - cron: '0 5 * * *' - workflow_dispatch: {} + workflow_dispatch: defaults: run: diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 5badaab81..dfb3e046d 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -6,6 +6,7 @@ on: # Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened # by other workflows. types: [opened, synchronize, reopened, ready_for_review] + merge_group: workflow_dispatch: defaults: diff --git a/.github/workflows/python312-windows.yml b/.github/workflows/python312-windows.yml index 8ef1be866..30af6377d 100644 --- a/.github/workflows/python312-windows.yml +++ b/.github/workflows/python312-windows.yml @@ -7,6 +7,7 @@ on: # Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened # by other workflows. types: [opened, synchronize, reopened, ready_for_review] + merge_group: schedule: # Weekly on Monday. - cron: '0 0 * * 1' diff --git a/.github/workflows/query-filters.yml b/.github/workflows/query-filters.yml index 90e702c93..3691a4990 100644 --- a/.github/workflows/query-filters.yml +++ b/.github/workflows/query-filters.yml @@ -11,9 +11,10 @@ on: - synchronize - reopened - ready_for_review + merge_group: schedule: - cron: '0 5 * * *' - workflow_dispatch: {} + workflow_dispatch: defaults: run: diff --git a/.github/workflows/test-codeql-bundle-all.yml b/.github/workflows/test-codeql-bundle-all.yml index 395288275..727cf7e03 100644 --- a/.github/workflows/test-codeql-bundle-all.yml +++ b/.github/workflows/test-codeql-bundle-all.yml @@ -13,9 +13,10 @@ on: - synchronize - reopened - ready_for_review + merge_group: schedule: - cron: '0 5 * * *' - workflow_dispatch: {} + workflow_dispatch: defaults: run: shell: bash diff --git a/pr-checks/sync.py b/pr-checks/sync.py index 77696b91f..7bee501c5 100755 --- a/pr-checks/sync.py +++ b/pr-checks/sync.py @@ -308,6 +308,7 @@ for file in sorted((this_dir / 'checks').glob('*.yml')): 'pull_request': { 'types': ["opened", "synchronize", "reopened", "ready_for_review"] }, + 'merge_group': {}, 'schedule': [{'cron': SingleQuotedScalarString('0 5 * * *')}], 'workflow_dispatch': { 'inputs': workflowInputs From f379c46d494968670a749cca71cb0c36a738167e Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 25 Feb 2026 15:26:48 +0000 Subject: [PATCH 09/14] Address review comments --- .github/workflows/__all-platform-bundle.yml | 4 +++- .github/workflows/__analysis-kinds.yml | 4 +++- .github/workflows/__analyze-ref-input.yml | 4 +++- .github/workflows/__autobuild-action.yml | 4 +++- .../__autobuild-direct-tracing-with-working-dir.yml | 4 +++- .github/workflows/__autobuild-working-dir.yml | 4 +++- .github/workflows/__build-mode-autobuild.yml | 4 +++- .github/workflows/__build-mode-manual.yml | 4 +++- .github/workflows/__build-mode-none.yml | 4 +++- .github/workflows/__build-mode-rollback.yml | 4 +++- .github/workflows/__bundle-from-nightly.yml | 4 +++- .github/workflows/__bundle-from-toolcache.yml | 4 +++- .github/workflows/__bundle-toolcache.yml | 4 +++- .github/workflows/__bundle-zstd.yml | 4 +++- .github/workflows/__cleanup-db-cluster-dir.yml | 4 +++- .github/workflows/__config-export.yml | 4 +++- .github/workflows/__config-input.yml | 4 +++- .github/workflows/__cpp-deptrace-disabled.yml | 4 +++- .github/workflows/__cpp-deptrace-enabled-on-macos.yml | 4 +++- .github/workflows/__cpp-deptrace-enabled.yml | 4 +++- .github/workflows/__diagnostics-export.yml | 4 +++- .github/workflows/__export-file-baseline-information.yml | 4 +++- .github/workflows/__extractor-ram-threads.yml | 4 +++- .github/workflows/__global-proxy.yml | 4 +++- .github/workflows/__go-custom-queries.yml | 4 +++- .../__go-indirect-tracing-workaround-diagnostic.yml | 4 +++- .../__go-indirect-tracing-workaround-no-file-program.yml | 4 +++- .github/workflows/__go-indirect-tracing-workaround.yml | 4 +++- .github/workflows/__go-tracing-autobuilder.yml | 4 +++- .github/workflows/__go-tracing-custom-build-steps.yml | 4 +++- .github/workflows/__go-tracing-legacy-workflow.yml | 4 +++- .github/workflows/__init-with-registries.yml | 4 +++- .github/workflows/__javascript-source-root.yml | 4 +++- .github/workflows/__job-run-uuid-sarif.yml | 4 +++- .github/workflows/__language-aliases.yml | 4 +++- .github/workflows/__local-bundle.yml | 4 +++- .github/workflows/__multi-language-autodetect.yml | 4 +++- .github/workflows/__overlay-init-fallback.yml | 4 +++- .../workflows/__packaging-codescanning-config-inputs-js.yml | 4 +++- .github/workflows/__packaging-config-inputs-js.yml | 4 +++- .github/workflows/__packaging-config-js.yml | 4 +++- .github/workflows/__packaging-inputs-js.yml | 4 +++- .github/workflows/__remote-config.yml | 4 +++- .github/workflows/__resolve-environment-action.yml | 4 +++- .github/workflows/__rubocop-multi-language.yml | 4 +++- .github/workflows/__ruby.yml | 4 +++- .github/workflows/__rust.yml | 4 +++- .github/workflows/__split-workflow.yml | 4 +++- .github/workflows/__start-proxy.yml | 4 +++- .github/workflows/__submit-sarif-failure.yml | 4 +++- .github/workflows/__swift-autobuild.yml | 4 +++- .github/workflows/__swift-custom-build.yml | 4 +++- .github/workflows/__unset-environment.yml | 4 +++- .github/workflows/__upload-ref-sha-input.yml | 4 +++- .github/workflows/__upload-sarif.yml | 4 +++- .github/workflows/__with-checkout-path.yml | 4 +++- .github/workflows/check-expected-release-files.yml | 1 - .github/workflows/codeql.yml | 1 + .github/workflows/codescanning-config-cli.yml | 5 +++-- .github/workflows/debug-artifacts-failure-safe.yml | 1 + .github/workflows/debug-artifacts-safe.yml | 1 + .github/workflows/pr-checks.yml | 3 ++- .github/workflows/python312-windows.yml | 1 + .github/workflows/query-filters.yml | 1 + .github/workflows/test-codeql-bundle-all.yml | 1 + pr-checks/sync.py | 4 +++- 66 files changed, 182 insertions(+), 61 deletions(-) diff --git a/.github/workflows/__all-platform-bundle.yml b/.github/workflows/__all-platform-bundle.yml index 6a1d0ab76..66700fd68 100644 --- a/.github/workflows/__all-platform-bundle.yml +++ b/.github/workflows/__all-platform-bundle.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__analysis-kinds.yml b/.github/workflows/__analysis-kinds.yml index 555d1d91f..e59c1576b 100644 --- a/.github/workflows/__analysis-kinds.yml +++ b/.github/workflows/__analysis-kinds.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__analyze-ref-input.yml b/.github/workflows/__analyze-ref-input.yml index 75392cce1..d28bbeb6a 100644 --- a/.github/workflows/__analyze-ref-input.yml +++ b/.github/workflows/__analyze-ref-input.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__autobuild-action.yml b/.github/workflows/__autobuild-action.yml index b7e6c3fb6..ce7fe4be7 100644 --- a/.github/workflows/__autobuild-action.yml +++ b/.github/workflows/__autobuild-action.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml b/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml index 3669f58f1..6711dc727 100644 --- a/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml +++ b/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__autobuild-working-dir.yml b/.github/workflows/__autobuild-working-dir.yml index b13e43b47..c9fb1e9e9 100644 --- a/.github/workflows/__autobuild-working-dir.yml +++ b/.github/workflows/__autobuild-working-dir.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__build-mode-autobuild.yml b/.github/workflows/__build-mode-autobuild.yml index 8ce6b2230..3d05b3963 100644 --- a/.github/workflows/__build-mode-autobuild.yml +++ b/.github/workflows/__build-mode-autobuild.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__build-mode-manual.yml b/.github/workflows/__build-mode-manual.yml index e98af266b..356c1b1fc 100644 --- a/.github/workflows/__build-mode-manual.yml +++ b/.github/workflows/__build-mode-manual.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__build-mode-none.yml b/.github/workflows/__build-mode-none.yml index 4ee2c5bc7..a570869ba 100644 --- a/.github/workflows/__build-mode-none.yml +++ b/.github/workflows/__build-mode-none.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__build-mode-rollback.yml b/.github/workflows/__build-mode-rollback.yml index 87f7bfdfc..a213bd267 100644 --- a/.github/workflows/__build-mode-rollback.yml +++ b/.github/workflows/__build-mode-rollback.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__bundle-from-nightly.yml b/.github/workflows/__bundle-from-nightly.yml index 31f1ccead..c052bff67 100644 --- a/.github/workflows/__bundle-from-nightly.yml +++ b/.github/workflows/__bundle-from-nightly.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__bundle-from-toolcache.yml b/.github/workflows/__bundle-from-toolcache.yml index bd9e68f2e..4c7f21a32 100644 --- a/.github/workflows/__bundle-from-toolcache.yml +++ b/.github/workflows/__bundle-from-toolcache.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__bundle-toolcache.yml b/.github/workflows/__bundle-toolcache.yml index d50e108db..7b5e8d139 100644 --- a/.github/workflows/__bundle-toolcache.yml +++ b/.github/workflows/__bundle-toolcache.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__bundle-zstd.yml b/.github/workflows/__bundle-zstd.yml index 5a905d86d..d1ddf108f 100644 --- a/.github/workflows/__bundle-zstd.yml +++ b/.github/workflows/__bundle-zstd.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__cleanup-db-cluster-dir.yml b/.github/workflows/__cleanup-db-cluster-dir.yml index b1ad35fc0..6d794e28c 100644 --- a/.github/workflows/__cleanup-db-cluster-dir.yml +++ b/.github/workflows/__cleanup-db-cluster-dir.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__config-export.yml b/.github/workflows/__config-export.yml index c629f5a31..72d76b93f 100644 --- a/.github/workflows/__config-export.yml +++ b/.github/workflows/__config-export.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__config-input.yml b/.github/workflows/__config-input.yml index 86f1dd894..a2e4dba2c 100644 --- a/.github/workflows/__config-input.yml +++ b/.github/workflows/__config-input.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__cpp-deptrace-disabled.yml b/.github/workflows/__cpp-deptrace-disabled.yml index cd8fa15ee..c73161cd8 100644 --- a/.github/workflows/__cpp-deptrace-disabled.yml +++ b/.github/workflows/__cpp-deptrace-disabled.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__cpp-deptrace-enabled-on-macos.yml b/.github/workflows/__cpp-deptrace-enabled-on-macos.yml index ef2f60f41..d2cce4936 100644 --- a/.github/workflows/__cpp-deptrace-enabled-on-macos.yml +++ b/.github/workflows/__cpp-deptrace-enabled-on-macos.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__cpp-deptrace-enabled.yml b/.github/workflows/__cpp-deptrace-enabled.yml index 60f865484..0539d4ce6 100644 --- a/.github/workflows/__cpp-deptrace-enabled.yml +++ b/.github/workflows/__cpp-deptrace-enabled.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__diagnostics-export.yml b/.github/workflows/__diagnostics-export.yml index daaa0456b..29c92d9ec 100644 --- a/.github/workflows/__diagnostics-export.yml +++ b/.github/workflows/__diagnostics-export.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index dd4a76cf8..395317ad2 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__extractor-ram-threads.yml b/.github/workflows/__extractor-ram-threads.yml index 37d12d7ad..eee08de58 100644 --- a/.github/workflows/__extractor-ram-threads.yml +++ b/.github/workflows/__extractor-ram-threads.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__global-proxy.yml b/.github/workflows/__global-proxy.yml index 27be1c465..08c4ad64a 100644 --- a/.github/workflows/__global-proxy.yml +++ b/.github/workflows/__global-proxy.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-custom-queries.yml b/.github/workflows/__go-custom-queries.yml index ef9067630..cc2120e86 100644 --- a/.github/workflows/__go-custom-queries.yml +++ b/.github/workflows/__go-custom-queries.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml b/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml index 0ad360368..9c2f42ec4 100644 --- a/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml +++ b/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml b/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml index 55430aa08..18645dcc3 100644 --- a/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml +++ b/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-indirect-tracing-workaround.yml b/.github/workflows/__go-indirect-tracing-workaround.yml index 3aee3af91..1259e7fa6 100644 --- a/.github/workflows/__go-indirect-tracing-workaround.yml +++ b/.github/workflows/__go-indirect-tracing-workaround.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-tracing-autobuilder.yml b/.github/workflows/__go-tracing-autobuilder.yml index dc64fda4e..4a6dc68e2 100644 --- a/.github/workflows/__go-tracing-autobuilder.yml +++ b/.github/workflows/__go-tracing-autobuilder.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-tracing-custom-build-steps.yml b/.github/workflows/__go-tracing-custom-build-steps.yml index 525b42af7..5576b561c 100644 --- a/.github/workflows/__go-tracing-custom-build-steps.yml +++ b/.github/workflows/__go-tracing-custom-build-steps.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__go-tracing-legacy-workflow.yml b/.github/workflows/__go-tracing-legacy-workflow.yml index b139ce943..3a85caeb0 100644 --- a/.github/workflows/__go-tracing-legacy-workflow.yml +++ b/.github/workflows/__go-tracing-legacy-workflow.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__init-with-registries.yml b/.github/workflows/__init-with-registries.yml index 6fec53262..81532e847 100644 --- a/.github/workflows/__init-with-registries.yml +++ b/.github/workflows/__init-with-registries.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__javascript-source-root.yml b/.github/workflows/__javascript-source-root.yml index c94c6322e..dc1a395ce 100644 --- a/.github/workflows/__javascript-source-root.yml +++ b/.github/workflows/__javascript-source-root.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__job-run-uuid-sarif.yml b/.github/workflows/__job-run-uuid-sarif.yml index c60f6dc53..da32ec432 100644 --- a/.github/workflows/__job-run-uuid-sarif.yml +++ b/.github/workflows/__job-run-uuid-sarif.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__language-aliases.yml b/.github/workflows/__language-aliases.yml index 91e2861c4..afdc089f3 100644 --- a/.github/workflows/__language-aliases.yml +++ b/.github/workflows/__language-aliases.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__local-bundle.yml b/.github/workflows/__local-bundle.yml index a9cab8443..bc3ab5ed6 100644 --- a/.github/workflows/__local-bundle.yml +++ b/.github/workflows/__local-bundle.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 11b0e6642..c0a573ffc 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__overlay-init-fallback.yml b/.github/workflows/__overlay-init-fallback.yml index 71b46f3e0..0871e6b44 100644 --- a/.github/workflows/__overlay-init-fallback.yml +++ b/.github/workflows/__overlay-init-fallback.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__packaging-codescanning-config-inputs-js.yml b/.github/workflows/__packaging-codescanning-config-inputs-js.yml index ffbf50d2a..43b70163a 100644 --- a/.github/workflows/__packaging-codescanning-config-inputs-js.yml +++ b/.github/workflows/__packaging-codescanning-config-inputs-js.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__packaging-config-inputs-js.yml b/.github/workflows/__packaging-config-inputs-js.yml index 812f09f4e..7ea2729c8 100644 --- a/.github/workflows/__packaging-config-inputs-js.yml +++ b/.github/workflows/__packaging-config-inputs-js.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__packaging-config-js.yml b/.github/workflows/__packaging-config-js.yml index e07ff1d31..7c921cecc 100644 --- a/.github/workflows/__packaging-config-js.yml +++ b/.github/workflows/__packaging-config-js.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__packaging-inputs-js.yml b/.github/workflows/__packaging-inputs-js.yml index 5c5c5e830..224b06305 100644 --- a/.github/workflows/__packaging-inputs-js.yml +++ b/.github/workflows/__packaging-inputs-js.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__remote-config.yml b/.github/workflows/__remote-config.yml index bc535280a..a026117a7 100644 --- a/.github/workflows/__remote-config.yml +++ b/.github/workflows/__remote-config.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__resolve-environment-action.yml b/.github/workflows/__resolve-environment-action.yml index c97ba6426..3acee8d64 100644 --- a/.github/workflows/__resolve-environment-action.yml +++ b/.github/workflows/__resolve-environment-action.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__rubocop-multi-language.yml b/.github/workflows/__rubocop-multi-language.yml index e27432488..3fec21e05 100644 --- a/.github/workflows/__rubocop-multi-language.yml +++ b/.github/workflows/__rubocop-multi-language.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__ruby.yml b/.github/workflows/__ruby.yml index 0198d5ea9..6d326ee88 100644 --- a/.github/workflows/__ruby.yml +++ b/.github/workflows/__ruby.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__rust.yml b/.github/workflows/__rust.yml index 037725328..92793f54a 100644 --- a/.github/workflows/__rust.yml +++ b/.github/workflows/__rust.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__split-workflow.yml b/.github/workflows/__split-workflow.yml index e2e63f08e..9e1cad8e0 100644 --- a/.github/workflows/__split-workflow.yml +++ b/.github/workflows/__split-workflow.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__start-proxy.yml b/.github/workflows/__start-proxy.yml index 3a3ecf153..438a99405 100644 --- a/.github/workflows/__start-proxy.yml +++ b/.github/workflows/__start-proxy.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__submit-sarif-failure.yml b/.github/workflows/__submit-sarif-failure.yml index d04c965d9..93553d18d 100644 --- a/.github/workflows/__submit-sarif-failure.yml +++ b/.github/workflows/__submit-sarif-failure.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 642d76d36..473c13644 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 333e17bd2..bc3e5d71f 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__unset-environment.yml b/.github/workflows/__unset-environment.yml index 7ccd088f2..b1918fe26 100644 --- a/.github/workflows/__unset-environment.yml +++ b/.github/workflows/__unset-environment.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__upload-ref-sha-input.yml b/.github/workflows/__upload-ref-sha-input.yml index 9464bd1e2..ad242dd7c 100644 --- a/.github/workflows/__upload-ref-sha-input.yml +++ b/.github/workflows/__upload-ref-sha-input.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__upload-sarif.yml b/.github/workflows/__upload-sarif.yml index 948f8224b..494731fa4 100644 --- a/.github/workflows/__upload-sarif.yml +++ b/.github/workflows/__upload-sarif.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/__with-checkout-path.yml b/.github/workflows/__with-checkout-path.yml index 535d15b14..c976b4e9b 100644 --- a/.github/workflows/__with-checkout-path.yml +++ b/.github/workflows/__with-checkout-path.yml @@ -18,7 +18,9 @@ on: - synchronize - reopened - ready_for_review - merge_group: {} + merge_group: + types: + - checks_requested schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/check-expected-release-files.yml b/.github/workflows/check-expected-release-files.yml index a8dac289d..c0dd21af6 100644 --- a/.github/workflows/check-expected-release-files.yml +++ b/.github/workflows/check-expected-release-files.yml @@ -8,7 +8,6 @@ on: # Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened # by other workflows. types: [opened, synchronize, reopened, ready_for_review] - merge_group: defaults: run: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 765212ced..154c21c7b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -8,6 +8,7 @@ on: # by other workflows. types: [opened, synchronize, reopened, ready_for_review] merge_group: + types: [checks_requested] schedule: # Weekly on Sunday. - cron: '30 1 * * 0' diff --git a/.github/workflows/codescanning-config-cli.yml b/.github/workflows/codescanning-config-cli.yml index 9cae63050..ca3b554a9 100644 --- a/.github/workflows/codescanning-config-cli.yml +++ b/.github/workflows/codescanning-config-cli.yml @@ -24,6 +24,7 @@ on: - reopened - ready_for_review merge_group: + types: [checks_requested] schedule: - cron: '0 5 * * *' workflow_dispatch: @@ -79,7 +80,7 @@ jobs: # On PRs, overlay analysis may change the config that is passed to the CLI. # Therefore, we have two variants of the following test, one for PRs and one for other events. - name: Empty file (non-PR) - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' && github.event_name != 'merge_group' uses: ./../action/.github/actions/check-codescanning-config with: expected-config-file-contents: "{}" @@ -87,7 +88,7 @@ jobs: tools: ${{ steps.prepare-test.outputs.tools-url }} - name: Empty file (PR) - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' || github.event_name == 'merge_group' uses: ./../action/.github/actions/check-codescanning-config with: expected-config-file-contents: | diff --git a/.github/workflows/debug-artifacts-failure-safe.yml b/.github/workflows/debug-artifacts-failure-safe.yml index 616b12b62..4d0433535 100644 --- a/.github/workflows/debug-artifacts-failure-safe.yml +++ b/.github/workflows/debug-artifacts-failure-safe.yml @@ -15,6 +15,7 @@ on: - reopened - ready_for_review merge_group: + types: [checks_requested] schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/debug-artifacts-safe.yml b/.github/workflows/debug-artifacts-safe.yml index 20a38241a..7886d44c7 100644 --- a/.github/workflows/debug-artifacts-safe.yml +++ b/.github/workflows/debug-artifacts-safe.yml @@ -14,6 +14,7 @@ on: - reopened - ready_for_review merge_group: + types: [checks_requested] schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index dfb3e046d..1c78da10f 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -7,6 +7,7 @@ on: # by other workflows. types: [opened, synchronize, reopened, ready_for_review] merge_group: + types: [checks_requested] workflow_dispatch: defaults: @@ -81,7 +82,7 @@ jobs: category: eslint check-node-version: - if: github.event.pull_request && github.triggering_actor != 'dependabot[bot]' + if: github.triggering_actor != 'dependabot[bot]' name: Check Action Node versions runs-on: ubuntu-latest timeout-minutes: 45 diff --git a/.github/workflows/python312-windows.yml b/.github/workflows/python312-windows.yml index 30af6377d..79602d056 100644 --- a/.github/workflows/python312-windows.yml +++ b/.github/workflows/python312-windows.yml @@ -8,6 +8,7 @@ on: # by other workflows. types: [opened, synchronize, reopened, ready_for_review] merge_group: + types: [checks_requested] schedule: # Weekly on Monday. - cron: '0 0 * * 1' diff --git a/.github/workflows/query-filters.yml b/.github/workflows/query-filters.yml index 3691a4990..7ef2e84bb 100644 --- a/.github/workflows/query-filters.yml +++ b/.github/workflows/query-filters.yml @@ -12,6 +12,7 @@ on: - reopened - ready_for_review merge_group: + types: [checks_requested] schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/.github/workflows/test-codeql-bundle-all.yml b/.github/workflows/test-codeql-bundle-all.yml index 727cf7e03..9ba7dbbab 100644 --- a/.github/workflows/test-codeql-bundle-all.yml +++ b/.github/workflows/test-codeql-bundle-all.yml @@ -14,6 +14,7 @@ on: - reopened - ready_for_review merge_group: + types: [checks_requested] schedule: - cron: '0 5 * * *' workflow_dispatch: diff --git a/pr-checks/sync.py b/pr-checks/sync.py index 7bee501c5..ded79c60a 100755 --- a/pr-checks/sync.py +++ b/pr-checks/sync.py @@ -308,7 +308,9 @@ for file in sorted((this_dir / 'checks').glob('*.yml')): 'pull_request': { 'types': ["opened", "synchronize", "reopened", "ready_for_review"] }, - 'merge_group': {}, + 'merge_group': { + 'types': ['checks_requested'] + }, 'schedule': [{'cron': SingleQuotedScalarString('0 5 * * *')}], 'workflow_dispatch': { 'inputs': workflowInputs From f657c4e1eb6ec1f5ef99e9cbeb6c01e33d7476e6 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 25 Feb 2026 17:43:15 +0000 Subject: [PATCH 10/14] Use `getDefaultCliVersion` for `start-proxy` --- lib/start-proxy-action.js | 16 +++-- src/start-proxy-action.ts | 4 +- src/start-proxy.test.ts | 143 +++++++++++++++++++++++++++++--------- src/start-proxy.ts | 25 +++++-- 4 files changed, 138 insertions(+), 50 deletions(-) diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index 6409ded79..9208971b1 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -121699,17 +121699,19 @@ function getProxyPackage() { function getFallbackUrl(proxyPackage) { return `${UPDATEJOB_PROXY_URL_PREFIX}${proxyPackage}`; } -async function getLinkedRelease() { +async function getReleaseByVersion(version) { return getApiClient().rest.repos.getReleaseByTag({ owner: "github", repo: "codeql-action", - tag: bundleVersion + tag: version }); } -async function getDownloadUrl(logger) { +async function getDownloadUrl(logger, features) { const proxyPackage = getProxyPackage(); try { - const cliRelease = await getLinkedRelease(); + const gitHubVersion = await getGitHubVersion(); + const versionInfo = await features.getDefaultCliVersion(gitHubVersion.type); + const cliRelease = await getReleaseByVersion(versionInfo.tagName); for (const asset of cliRelease.data.assets) { if (asset.name === proxyPackage) { logger.info( @@ -121781,9 +121783,9 @@ async function cacheProxy(logger, source, filename, version) { function getProxyFilename() { return process.platform === "win32" ? `${UPDATEJOB_PROXY}.exe` : UPDATEJOB_PROXY; } -async function getProxyBinaryPath(logger) { +async function getProxyBinaryPath(logger, features) { const proxyFileName = getProxyFilename(); - const proxyInfo = await getDownloadUrl(logger); + const proxyInfo = await getDownloadUrl(logger, features); let proxyBin = toolcache.find(proxyFileName, proxyInfo.version); if (!proxyBin) { const apiDetails = getApiDetails(); @@ -122141,7 +122143,7 @@ async function run(startedAt) { all_credentials: credentials, ca }; - const proxyBin = await getProxyBinaryPath(logger); + const proxyBin = await getProxyBinaryPath(logger, features); const proxyInfo = await startProxy( proxyBin, proxyConfig, diff --git a/src/start-proxy-action.ts b/src/start-proxy-action.ts index f95a16999..438d565ae 100644 --- a/src/start-proxy-action.ts +++ b/src/start-proxy-action.ts @@ -5,7 +5,7 @@ import * as core from "@actions/core"; import * as actionsUtil from "./actions-util"; import { getGitHubVersion } from "./api-client"; -import { Feature, FeatureEnablement, initFeatures } from "./feature-flags"; +import { FeatureEnablement, initFeatures } from "./feature-flags"; import { KnownLanguage } from "./languages"; import { getActionsLogger, Logger } from "./logging"; import { getRepositoryNwo } from "./repository"; @@ -98,7 +98,7 @@ async function run(startedAt: Date) { }; // Start the Proxy - const proxyBin = await getProxyBinaryPath(logger); + const proxyBin = await getProxyBinaryPath(logger, features); const proxyInfo = await startProxy( proxyBin, proxyConfig, diff --git a/src/start-proxy.test.ts b/src/start-proxy.test.ts index 321a41a29..514f0686c 100644 --- a/src/start-proxy.test.ts +++ b/src/start-proxy.test.ts @@ -7,6 +7,7 @@ import sinon from "sinon"; import * as apiClient from "./api-client"; import * as defaults from "./defaults.json"; +import { setUpFeatureFlagTests } from "./feature-flags/testing-util"; import { KnownLanguage } from "./languages"; import { getRunnerLogger, Logger } from "./logging"; import * as startProxyExports from "./start-proxy"; @@ -14,12 +15,19 @@ import { parseLanguage } from "./start-proxy"; import * as statusReport from "./status-report"; import { checkExpectedLogMessages, + createFeatures, getRecordingLogger, makeTestToken, + RecordingLogger, setupTests, withRecordingLoggerAsync, } from "./testing-utils"; -import { ConfigurationError } from "./util"; +import { + ConfigurationError, + GitHubVariant, + GitHubVersion, + withTmpDir, +} from "./util"; setupTests(test); @@ -347,8 +355,18 @@ test("parseLanguage", async (t) => { t.deepEqual(parseLanguage(""), undefined); }); -function mockGetReleaseByTag(assets?: Array<{ name: string; url?: string }>) { - const mockClient = sinon.stub(apiClient, "getApiClient"); +function mockGetApiClient(endpoints: any) { + return ( + sinon + .stub(apiClient, "getApiClient") + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + .returns({ rest: endpoints } as any) + ); +} + +type ReleaseAssets = Array<{ name: string; url?: string }>; + +function mockGetReleaseByTag(assets?: ReleaseAssets) { const getReleaseByTag = assets === undefined ? sinon.stub().rejects() @@ -359,21 +377,28 @@ function mockGetReleaseByTag(assets?: Array<{ name: string; url?: string }>) { url: "GET /repos/:owner/:repo/releases/tags/:tag", }); - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - mockClient.returns({ - rest: { - repos: { - getReleaseByTag, - }, - }, - } as any); - return mockClient; + return mockGetApiClient({ repos: { getReleaseByTag } }); } -test("getDownloadUrl returns fallback when `getLinkedRelease` rejects", async (t) => { +function mockOfflineFeatures(tempDir: string, logger: Logger) { + // Using GHES ensures that we are using `OfflineFeatures`. + const gitHubVersion = { + type: GitHubVariant.GHES, + version: "3.0.0", + }; + sinon.stub(apiClient, "getGitHubVersion").resolves(gitHubVersion); + + return setUpFeatureFlagTests(tempDir, logger, gitHubVersion); +} + +test("getDownloadUrl returns fallback when `getReleaseByVersion` rejects", async (t) => { mockGetReleaseByTag(); - const info = await startProxyExports.getDownloadUrl(getRunnerLogger(true)); + const features = createFeatures([]); + const info = await startProxyExports.getDownloadUrl( + getRunnerLogger(true), + features, + ); t.is(info.version, startProxyExports.UPDATEJOB_PROXY_VERSION); t.is( @@ -383,33 +408,48 @@ test("getDownloadUrl returns fallback when `getLinkedRelease` rejects", async (t }); test("getDownloadUrl returns fallback when there's no matching release asset", async (t) => { + const logger = new RecordingLogger(); const testAssets = [[], [{ name: "foo" }]]; - for (const assets of testAssets) { - const stub = mockGetReleaseByTag(assets); - const info = await startProxyExports.getDownloadUrl(getRunnerLogger(true)); + await withTmpDir(async (tempDir) => { + const features = mockOfflineFeatures(tempDir, logger); - t.is(info.version, startProxyExports.UPDATEJOB_PROXY_VERSION); - t.is( - info.url, - startProxyExports.getFallbackUrl(startProxyExports.getProxyPackage()), - ); + for (const assets of testAssets) { + const stub = mockGetReleaseByTag(assets); + const info = await startProxyExports.getDownloadUrl( + getRunnerLogger(true), + features, + ); - stub.restore(); - } + t.is(info.version, startProxyExports.UPDATEJOB_PROXY_VERSION); + t.is( + info.url, + startProxyExports.getFallbackUrl(startProxyExports.getProxyPackage()), + ); + + stub.restore(); + } + }); }); test("getDownloadUrl returns matching release asset", async (t) => { + const logger = new RecordingLogger(); const assets = [ { name: "foo", url: "other-url" }, { name: startProxyExports.getProxyPackage(), url: "url-we-want" }, ]; mockGetReleaseByTag(assets); - const info = await startProxyExports.getDownloadUrl(getRunnerLogger(true)); + await withTmpDir(async (tempDir) => { + const features = mockOfflineFeatures(tempDir, logger); + const info = await startProxyExports.getDownloadUrl( + getRunnerLogger(true), + features, + ); - t.is(info.version, defaults.cliVersion); - t.is(info.url, "url-we-want"); + t.is(info.version, defaults.cliVersion); + t.is(info.url, "url-we-want"); + }); }); test("credentialToStr - hides passwords", (t) => { @@ -560,13 +600,15 @@ test( ); test("getProxyBinaryPath - returns path from tool cache if available", async (t) => { + const logger = new RecordingLogger(); mockGetReleaseByTag(); - await withRecordingLoggerAsync(async (logger) => { + await withTmpDir(async (tempDir) => { const toolcachePath = "/path/to/proxy/dir"; sinon.stub(toolcache, "find").returns(toolcachePath); - const path = await startProxyExports.getProxyBinaryPath(logger); + const features = mockOfflineFeatures(tempDir, logger); + const path = await startProxyExports.getProxyBinaryPath(logger, features); t.assert(path); t.is( @@ -577,12 +619,31 @@ test("getProxyBinaryPath - returns path from tool cache if available", async (t) }); test("getProxyBinaryPath - downloads proxy if not in cache", async (t) => { + const logger = new RecordingLogger(); + const expectedTag = "codeql-bundle-v2.20.1"; + const expectedParams = { + owner: "github", + repo: "codeql-action", + tag: expectedTag, + }; const downloadUrl = "url-we-want"; - mockGetReleaseByTag([ - { name: startProxyExports.getProxyPackage(), url: downloadUrl }, - ]); + const assets = [ + { + name: startProxyExports.getProxyPackage(), + url: downloadUrl, + }, + ]; - await withRecordingLoggerAsync(async (logger) => { + const getReleaseByTag = sinon.stub(); + getReleaseByTag.withArgs(sinon.match(expectedParams)).resolves({ + status: 200, + data: { assets }, + headers: {}, + url: "GET /repos/:owner/:repo/releases/tags/:tag", + }); + mockGetApiClient({ repos: { getReleaseByTag } }); + + await withTmpDir(async (tempDir) => { const toolcachePath = "/path/to/proxy/dir"; const find = sinon.stub(toolcache, "find").returns(""); const getApiDetails = sinon.stub(apiClient, "getApiDetails").returns({ @@ -603,8 +664,22 @@ test("getProxyBinaryPath - downloads proxy if not in cache", async (t) => { .resolves(extractedPath); const cacheDir = sinon.stub(toolcache, "cacheDir").resolves(toolcachePath); - const path = await startProxyExports.getProxyBinaryPath(logger); + const gitHubVersion: GitHubVersion = { + type: GitHubVariant.DOTCOM, + }; + sinon.stub(apiClient, "getGitHubVersion").resolves(gitHubVersion); + const features = setUpFeatureFlagTests(tempDir, logger, gitHubVersion); + const getDefaultCliVersion = sinon + .stub(features, "getDefaultCliVersion") + .resolves({ cliVersion: "2.20.1", tagName: expectedTag }); + const path = await startProxyExports.getProxyBinaryPath(logger, features); + + t.assert(getDefaultCliVersion.calledOnce); + sinon.assert.calledOnceWithMatch( + getReleaseByTag, + sinon.match(expectedParams), + ); t.assert(find.calledOnce); t.assert(getApiDetails.calledOnce); t.assert(getAuthorizationHeaderFor.calledOnce); diff --git a/src/start-proxy.ts b/src/start-proxy.ts index 755c0a40c..43ff58ebf 100644 --- a/src/start-proxy.ts +++ b/src/start-proxy.ts @@ -7,10 +7,12 @@ import { getApiClient, getApiDetails, getAuthorizationHeaderFor, + getGitHubVersion, } from "./api-client"; import * as artifactScanner from "./artifact-scanner"; import { Config } from "./config-utils"; import * as defaults from "./defaults.json"; +import { FeatureEnablement } from "./feature-flags"; import { KnownLanguage } from "./languages"; import { Logger } from "./logging"; import { @@ -391,15 +393,15 @@ export function getFallbackUrl(proxyPackage: string): string { /** * Uses the GitHub API to obtain information about the CodeQL CLI bundle release - * that is pointed at by `defaults.json`. + * that is tagged by `version`. * * @returns The response from the GitHub API. */ -async function getLinkedRelease() { +async function getReleaseByVersion(version: string) { return getApiClient().rest.repos.getReleaseByTag({ owner: "github", repo: "codeql-action", - tag: defaults.bundleVersion, + tag: version, }); } @@ -412,12 +414,18 @@ async function getLinkedRelease() { */ export async function getDownloadUrl( logger: Logger, + features: FeatureEnablement, ): Promise<{ url: string; version: string }> { const proxyPackage = getProxyPackage(); try { - // Try to retrieve information about the CLI bundle release pointed at by `defaults.json`. - const cliRelease = await getLinkedRelease(); + // Retrieve information about the CLI version we should use. This will be either the linked + // version, or the one enabled by FFs. + const gitHubVersion = await getGitHubVersion(); + const versionInfo = await features.getDefaultCliVersion(gitHubVersion.type); + + // Try to retrieve information about the CLI bundle release identified by `versionInfo`. + const cliRelease = await getReleaseByVersion(versionInfo.tagName); // Search the release's assets to find the one we are looking for. for (const asset of cliRelease.data.assets) { @@ -548,9 +556,12 @@ export function getProxyFilename() { * @param logger The logger to use. * @returns The path to the proxy binary. */ -export async function getProxyBinaryPath(logger: Logger): Promise { +export async function getProxyBinaryPath( + logger: Logger, + features: FeatureEnablement, +): Promise { const proxyFileName = getProxyFilename(); - const proxyInfo = await getDownloadUrl(logger); + const proxyInfo = await getDownloadUrl(logger, features); let proxyBin = toolcache.find(proxyFileName, proxyInfo.version); if (!proxyBin) { From 1ec5b701fc83558619454257069725df30f64d38 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Thu, 26 Feb 2026 11:53:26 +0000 Subject: [PATCH 11/14] Reduce log levels for registry connection checks --- lib/start-proxy-action.js | 6 +++--- src/start-proxy/reachability.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index 6409ded79..bc334ea31 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -122076,9 +122076,9 @@ async function checkConnections(logger, proxy, backend) { result.add(registry); } catch (e) { if (e instanceof ReachabilityError && e.statusCode !== void 0) { - logger.error(`Connection test to ${url} failed. (${e.statusCode})`); + logger.info(`Connection test to ${url} failed. (${e.statusCode})`); } else { - logger.error( + logger.warning( `Connection test to ${url} failed: ${getErrorMessage(e)}` ); } @@ -122086,7 +122086,7 @@ async function checkConnections(logger, proxy, backend) { } logger.debug(`Finished testing connections to private registries.`); } catch (e) { - logger.error( + logger.warning( `Failed to test connections to private registries: ${getErrorMessage(e)}` ); } diff --git a/src/start-proxy/reachability.ts b/src/start-proxy/reachability.ts index 2951c8a0c..8ba5418e1 100644 --- a/src/start-proxy/reachability.ts +++ b/src/start-proxy/reachability.ts @@ -110,9 +110,9 @@ export async function checkConnections( result.add(registry); } catch (e) { if (e instanceof ReachabilityError && e.statusCode !== undefined) { - logger.error(`Connection test to ${url} failed. (${e.statusCode})`); + logger.info(`Connection test to ${url} failed. (${e.statusCode})`); } else { - logger.error( + logger.warning( `Connection test to ${url} failed: ${getErrorMessage(e)}`, ); } @@ -121,7 +121,7 @@ export async function checkConnections( logger.debug(`Finished testing connections to private registries.`); } catch (e) { - logger.error( + logger.warning( `Failed to test connections to private registries: ${getErrorMessage(e)}`, ); } From 3c911485edc62ce14114209c4c9ec282d1ae570d Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Thu, 26 Feb 2026 12:48:32 +0000 Subject: [PATCH 12/14] Address Copilot's review comments --- src/start-proxy.test.ts | 24 +++++++++++++----------- src/start-proxy.ts | 1 + 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/start-proxy.test.ts b/src/start-proxy.test.ts index 514f0686c..eb8fb5a5c 100644 --- a/src/start-proxy.test.ts +++ b/src/start-proxy.test.ts @@ -15,7 +15,6 @@ import { parseLanguage } from "./start-proxy"; import * as statusReport from "./status-report"; import { checkExpectedLogMessages, - createFeatures, getRecordingLogger, makeTestToken, RecordingLogger, @@ -392,19 +391,22 @@ function mockOfflineFeatures(tempDir: string, logger: Logger) { } test("getDownloadUrl returns fallback when `getReleaseByVersion` rejects", async (t) => { + const logger = new RecordingLogger(); mockGetReleaseByTag(); - const features = createFeatures([]); - const info = await startProxyExports.getDownloadUrl( - getRunnerLogger(true), - features, - ); + await withTmpDir(async (tempDir) => { + const features = mockOfflineFeatures(tempDir, logger); + const info = await startProxyExports.getDownloadUrl( + getRunnerLogger(true), + features, + ); - t.is(info.version, startProxyExports.UPDATEJOB_PROXY_VERSION); - t.is( - info.url, - startProxyExports.getFallbackUrl(startProxyExports.getProxyPackage()), - ); + t.is(info.version, startProxyExports.UPDATEJOB_PROXY_VERSION); + t.is( + info.url, + startProxyExports.getFallbackUrl(startProxyExports.getProxyPackage()), + ); + }); }); test("getDownloadUrl returns fallback when there's no matching release asset", async (t) => { diff --git a/src/start-proxy.ts b/src/start-proxy.ts index 43ff58ebf..03bdd7c9d 100644 --- a/src/start-proxy.ts +++ b/src/start-proxy.ts @@ -410,6 +410,7 @@ async function getReleaseByVersion(version: string) { * already in the toolcache, and its version. * * @param logger The logger to use. + * @param features Information about enabled features. * @returns Returns the download URL and version of the proxy package we plan to use. */ export async function getDownloadUrl( From db33d20bf4d9e52bf28614819f7d60f5cb9c9256 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Thu, 26 Feb 2026 13:10:52 +0000 Subject: [PATCH 13/14] Put change behind a FF --- lib/analyze-action-post.js | 5 ++++ lib/analyze-action.js | 5 ++++ lib/autobuild-action.js | 5 ++++ lib/init-action-post.js | 5 ++++ lib/init-action.js | 5 ++++ lib/resolve-environment-action.js | 5 ++++ lib/setup-codeql-action.js | 5 ++++ lib/start-proxy-action-post.js | 5 ++++ lib/start-proxy-action.js | 18 +++++++++-- lib/upload-lib.js | 5 ++++ lib/upload-sarif-action-post.js | 5 ++++ lib/upload-sarif-action.js | 5 ++++ src/feature-flags.ts | 6 ++++ src/start-proxy.test.ts | 50 +++++++++++++++++++++++++++++++ src/start-proxy.ts | 26 ++++++++++++++-- 15 files changed, 150 insertions(+), 5 deletions(-) diff --git a/lib/analyze-action-post.js b/lib/analyze-action-post.js index d95b97875..775ae41f5 100644 --- a/lib/analyze-action-post.js +++ b/lib/analyze-action-post.js @@ -161755,6 +161755,11 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", + minimumVersion: void 0 + }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { defaultValue: false, envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", diff --git a/lib/analyze-action.js b/lib/analyze-action.js index c490eaad7..4857bbb3b 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -107853,6 +107853,11 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", + minimumVersion: void 0 + }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { defaultValue: false, envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 664212ec8..500b3396d 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -104142,6 +104142,11 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", + minimumVersion: void 0 + }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { defaultValue: false, envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", diff --git a/lib/init-action-post.js b/lib/init-action-post.js index e4d4060d4..f53b7d367 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -165252,6 +165252,11 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", + minimumVersion: void 0 + }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { defaultValue: false, envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", diff --git a/lib/init-action.js b/lib/init-action.js index 74a627293..66de01afe 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -105371,6 +105371,11 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", + minimumVersion: void 0 + }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { defaultValue: false, envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", diff --git a/lib/resolve-environment-action.js b/lib/resolve-environment-action.js index 3df530b88..6483f98fe 100644 --- a/lib/resolve-environment-action.js +++ b/lib/resolve-environment-action.js @@ -104133,6 +104133,11 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", + minimumVersion: void 0 + }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { defaultValue: false, envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", diff --git a/lib/setup-codeql-action.js b/lib/setup-codeql-action.js index 179fbab6a..7f63d7b93 100644 --- a/lib/setup-codeql-action.js +++ b/lib/setup-codeql-action.js @@ -104042,6 +104042,11 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", + minimumVersion: void 0 + }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { defaultValue: false, envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", diff --git a/lib/start-proxy-action-post.js b/lib/start-proxy-action-post.js index 7ddcd2426..dffe7d2b1 100644 --- a/lib/start-proxy-action-post.js +++ b/lib/start-proxy-action-post.js @@ -161161,6 +161161,11 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", + minimumVersion: void 0 + }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { defaultValue: false, envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index 9208971b1..5db5e20e5 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -120834,6 +120834,11 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", + minimumVersion: void 0 + }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { defaultValue: false, envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", @@ -121706,11 +121711,20 @@ async function getReleaseByVersion(version) { tag: version }); } +async function getCliVersionFromFeatures(features) { + const gitHubVersion = await getGitHubVersion(); + return await features.getDefaultCliVersion(gitHubVersion.type); +} async function getDownloadUrl(logger, features) { const proxyPackage = getProxyPackage(); try { - const gitHubVersion = await getGitHubVersion(); - const versionInfo = await features.getDefaultCliVersion(gitHubVersion.type); + const useFeaturesToDetermineCLI = await features.getValue( + "start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */ + ); + const versionInfo = useFeaturesToDetermineCLI ? await getCliVersionFromFeatures(features) : { + cliVersion, + tagName: bundleVersion + }; const cliRelease = await getReleaseByVersion(versionInfo.tagName); for (const asset of cliRelease.data.assets) { if (asset.name === proxyPackage) { diff --git a/lib/upload-lib.js b/lib/upload-lib.js index f7e8206de..04d723f26 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -107301,6 +107301,11 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", + minimumVersion: void 0 + }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { defaultValue: false, envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", diff --git a/lib/upload-sarif-action-post.js b/lib/upload-sarif-action-post.js index 010dfa897..812e73e47 100644 --- a/lib/upload-sarif-action-post.js +++ b/lib/upload-sarif-action-post.js @@ -161323,6 +161323,11 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", + minimumVersion: void 0 + }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { defaultValue: false, envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 3459ded50..c14378e0d 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -107026,6 +107026,11 @@ var featureConfig = { // cannot be found when interpreting results. minimumVersion: void 0 }, + ["start_proxy_use_features_release" /* StartProxyUseFeaturesRelease */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", + minimumVersion: void 0 + }, ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { defaultValue: false, envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", diff --git a/src/feature-flags.ts b/src/feature-flags.ts index 6155950a4..546d2e0ff 100644 --- a/src/feature-flags.ts +++ b/src/feature-flags.ts @@ -77,6 +77,7 @@ export enum Feature { QaTelemetryEnabled = "qa_telemetry_enabled", /** Note that this currently only disables baseline file coverage information. */ SkipFileCoverageOnPrs = "skip_file_coverage_on_prs", + StartProxyUseFeaturesRelease = "start_proxy_use_features_release", UploadOverlayDbToApi = "upload_overlay_db_to_api", UseRepositoryProperties = "use_repository_properties_v2", ValidateDbConfig = "validate_db_config", @@ -327,6 +328,11 @@ export const featureConfig = { // cannot be found when interpreting results. minimumVersion: undefined, }, + [Feature.StartProxyUseFeaturesRelease]: { + defaultValue: false, + envVar: "CODEQL_ACTION_START_PROXY_USE_FEATURES_RELEASE", + minimumVersion: undefined, + }, [Feature.UploadOverlayDbToApi]: { defaultValue: false, envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", diff --git a/src/start-proxy.test.ts b/src/start-proxy.test.ts index eb8fb5a5c..d00061196 100644 --- a/src/start-proxy.test.ts +++ b/src/start-proxy.test.ts @@ -15,6 +15,7 @@ import { parseLanguage } from "./start-proxy"; import * as statusReport from "./status-report"; import { checkExpectedLogMessages, + createFeatures, getRecordingLogger, makeTestToken, RecordingLogger, @@ -621,6 +622,52 @@ test("getProxyBinaryPath - returns path from tool cache if available", async (t) }); test("getProxyBinaryPath - downloads proxy if not in cache", async (t) => { + const downloadUrl = "url-we-want"; + mockGetReleaseByTag([ + { name: startProxyExports.getProxyPackage(), url: downloadUrl }, + ]); + + await withRecordingLoggerAsync(async (logger) => { + const toolcachePath = "/path/to/proxy/dir"; + const find = sinon.stub(toolcache, "find").returns(""); + const getApiDetails = sinon.stub(apiClient, "getApiDetails").returns({ + auth: "", + url: "", + apiURL: "", + }); + const getAuthorizationHeaderFor = sinon + .stub(apiClient, "getAuthorizationHeaderFor") + .returns(undefined); + const archivePath = "/path/to/archive"; + const downloadTool = sinon + .stub(toolcache, "downloadTool") + .resolves(archivePath); + const extractedPath = "/path/to/extracted"; + const extractTar = sinon + .stub(toolcache, "extractTar") + .resolves(extractedPath); + const cacheDir = sinon.stub(toolcache, "cacheDir").resolves(toolcachePath); + + const path = await startProxyExports.getProxyBinaryPath( + logger, + createFeatures([]), + ); + + t.assert(find.calledOnce); + t.assert(getApiDetails.calledOnce); + t.assert(getAuthorizationHeaderFor.calledOnce); + t.assert(downloadTool.calledOnceWith(downloadUrl)); + t.assert(extractTar.calledOnceWith(archivePath)); + t.assert(cacheDir.calledOnceWith(extractedPath)); + t.assert(path); + t.is( + path, + filepath.join(toolcachePath, startProxyExports.getProxyFilename()), + ); + }); +}); + +test("getProxyBinaryPath - downloads proxy based on features if not in cache", async (t) => { const logger = new RecordingLogger(); const expectedTag = "codeql-bundle-v2.20.1"; const expectedParams = { @@ -672,6 +719,9 @@ test("getProxyBinaryPath - downloads proxy if not in cache", async (t) => { sinon.stub(apiClient, "getGitHubVersion").resolves(gitHubVersion); const features = setUpFeatureFlagTests(tempDir, logger, gitHubVersion); + sinon.stub(features, "getValue").callsFake(async (_feature, _codeql) => { + return true; + }); const getDefaultCliVersion = sinon .stub(features, "getDefaultCliVersion") .resolves({ cliVersion: "2.20.1", tagName: expectedTag }); diff --git a/src/start-proxy.ts b/src/start-proxy.ts index 03bdd7c9d..abc13a77a 100644 --- a/src/start-proxy.ts +++ b/src/start-proxy.ts @@ -12,7 +12,11 @@ import { import * as artifactScanner from "./artifact-scanner"; import { Config } from "./config-utils"; import * as defaults from "./defaults.json"; -import { FeatureEnablement } from "./feature-flags"; +import { + CodeQLDefaultVersionInfo, + Feature, + FeatureEnablement, +} from "./feature-flags"; import { KnownLanguage } from "./languages"; import { Logger } from "./logging"; import { @@ -405,6 +409,14 @@ async function getReleaseByVersion(version: string) { }); } +/** Uses `features` to determine the default CLI version. */ +async function getCliVersionFromFeatures( + features: FeatureEnablement, +): Promise { + const gitHubVersion = await getGitHubVersion(); + return await features.getDefaultCliVersion(gitHubVersion.type); +} + /** * Determines the URL of the proxy release asset that we should download if its not * already in the toolcache, and its version. @@ -420,10 +432,18 @@ export async function getDownloadUrl( const proxyPackage = getProxyPackage(); try { + const useFeaturesToDetermineCLI = await features.getValue( + Feature.StartProxyUseFeaturesRelease, + ); + // Retrieve information about the CLI version we should use. This will be either the linked // version, or the one enabled by FFs. - const gitHubVersion = await getGitHubVersion(); - const versionInfo = await features.getDefaultCliVersion(gitHubVersion.type); + const versionInfo = useFeaturesToDetermineCLI + ? await getCliVersionFromFeatures(features) + : { + cliVersion: defaults.cliVersion, + tagName: defaults.bundleVersion, + }; // Try to retrieve information about the CLI bundle release identified by `versionInfo`. const cliRelease = await getReleaseByVersion(versionInfo.tagName); From bce0deb953db43af59053310d09fa3aabd3c04c5 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Thu, 26 Feb 2026 13:55:47 +0000 Subject: [PATCH 14/14] Fix log message / returned version --- lib/start-proxy-action.js | 4 +- src/start-proxy.test.ts | 81 +++++++++++++++++++++------------------ src/start-proxy.ts | 4 +- 3 files changed, 48 insertions(+), 41 deletions(-) diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index 5db5e20e5..ca664e250 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -121729,14 +121729,14 @@ async function getDownloadUrl(logger, features) { for (const asset of cliRelease.data.assets) { if (asset.name === proxyPackage) { logger.info( - `Found '${proxyPackage}' in release '${bundleVersion}' at '${asset.url}'` + `Found '${proxyPackage}' in release '${versionInfo.tagName}' at '${asset.url}'` ); return { url: asset.url, // The `update-job-proxy` doesn't have a version as such. Since we now bundle it // with CodeQL CLI bundle releases, we use the corresponding CLI version to // differentiate between (potentially) different versions of `update-job-proxy`. - version: cliVersion + version: versionInfo.cliVersion }; } } diff --git a/src/start-proxy.test.ts b/src/start-proxy.test.ts index d00061196..b1c4926f8 100644 --- a/src/start-proxy.test.ts +++ b/src/start-proxy.test.ts @@ -622,49 +622,52 @@ test("getProxyBinaryPath - returns path from tool cache if available", async (t) }); test("getProxyBinaryPath - downloads proxy if not in cache", async (t) => { + const logger = new RecordingLogger(); const downloadUrl = "url-we-want"; mockGetReleaseByTag([ { name: startProxyExports.getProxyPackage(), url: downloadUrl }, ]); - await withRecordingLoggerAsync(async (logger) => { - const toolcachePath = "/path/to/proxy/dir"; - const find = sinon.stub(toolcache, "find").returns(""); - const getApiDetails = sinon.stub(apiClient, "getApiDetails").returns({ - auth: "", - url: "", - apiURL: "", - }); - const getAuthorizationHeaderFor = sinon - .stub(apiClient, "getAuthorizationHeaderFor") - .returns(undefined); - const archivePath = "/path/to/archive"; - const downloadTool = sinon - .stub(toolcache, "downloadTool") - .resolves(archivePath); - const extractedPath = "/path/to/extracted"; - const extractTar = sinon - .stub(toolcache, "extractTar") - .resolves(extractedPath); - const cacheDir = sinon.stub(toolcache, "cacheDir").resolves(toolcachePath); - - const path = await startProxyExports.getProxyBinaryPath( - logger, - createFeatures([]), - ); - - t.assert(find.calledOnce); - t.assert(getApiDetails.calledOnce); - t.assert(getAuthorizationHeaderFor.calledOnce); - t.assert(downloadTool.calledOnceWith(downloadUrl)); - t.assert(extractTar.calledOnceWith(archivePath)); - t.assert(cacheDir.calledOnceWith(extractedPath)); - t.assert(path); - t.is( - path, - filepath.join(toolcachePath, startProxyExports.getProxyFilename()), - ); + const toolcachePath = "/path/to/proxy/dir"; + const find = sinon.stub(toolcache, "find").returns(""); + const getApiDetails = sinon.stub(apiClient, "getApiDetails").returns({ + auth: "", + url: "", + apiURL: "", }); + const getAuthorizationHeaderFor = sinon + .stub(apiClient, "getAuthorizationHeaderFor") + .returns(undefined); + const archivePath = "/path/to/archive"; + const downloadTool = sinon + .stub(toolcache, "downloadTool") + .resolves(archivePath); + const extractedPath = "/path/to/extracted"; + const extractTar = sinon + .stub(toolcache, "extractTar") + .resolves(extractedPath); + const cacheDir = sinon.stub(toolcache, "cacheDir").resolves(toolcachePath); + + const path = await startProxyExports.getProxyBinaryPath( + logger, + createFeatures([]), + ); + + t.assert(find.calledOnce); + t.assert(getApiDetails.calledOnce); + t.assert(getAuthorizationHeaderFor.calledOnce); + t.assert(downloadTool.calledOnceWith(downloadUrl)); + t.assert(extractTar.calledOnceWith(archivePath)); + t.assert(cacheDir.calledOnceWith(extractedPath)); + t.assert(path); + t.is( + path, + filepath.join(toolcachePath, startProxyExports.getProxyFilename()), + ); + + checkExpectedLogMessages(t, logger.messages, [ + `Found '${startProxyExports.getProxyPackage()}' in release '${defaults.bundleVersion}' at '${downloadUrl}'`, + ]); }); test("getProxyBinaryPath - downloads proxy based on features if not in cache", async (t) => { @@ -745,4 +748,8 @@ test("getProxyBinaryPath - downloads proxy based on features if not in cache", a filepath.join(toolcachePath, startProxyExports.getProxyFilename()), ); }); + + checkExpectedLogMessages(t, logger.messages, [ + `Found '${startProxyExports.getProxyPackage()}' in release '${expectedTag}' at '${downloadUrl}'`, + ]); }); diff --git a/src/start-proxy.ts b/src/start-proxy.ts index abc13a77a..7ed466a41 100644 --- a/src/start-proxy.ts +++ b/src/start-proxy.ts @@ -452,14 +452,14 @@ export async function getDownloadUrl( for (const asset of cliRelease.data.assets) { if (asset.name === proxyPackage) { logger.info( - `Found '${proxyPackage}' in release '${defaults.bundleVersion}' at '${asset.url}'`, + `Found '${proxyPackage}' in release '${versionInfo.tagName}' at '${asset.url}'`, ); return { url: asset.url, // The `update-job-proxy` doesn't have a version as such. Since we now bundle it // with CodeQL CLI bundle releases, we use the corresponding CLI version to // differentiate between (potentially) different versions of `update-job-proxy`. - version: defaults.cliVersion, + version: versionInfo.cliVersion, }; } }