diff --git a/lib/entry-points.js b/lib/entry-points.js index 0e7010b990..12666b8f4b 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -149396,6 +149396,11 @@ var featureConfig = { legacyApi: true, minimumVersion: void 0 }, + ["force_jgit" /* ForceJGit */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_FORCE_JGIT", + minimumVersion: void 0 + }, ["force_nightly" /* ForceNightly */]: { defaultValue: false, envVar: "CODEQL_ACTION_FORCE_NIGHTLY", @@ -159348,6 +159353,9 @@ exec ${goBinaryPath} "$@"` if (await features.getValue("disable_kotlin_analysis_enabled" /* DisableKotlinAnalysisEnabled */)) { core21.exportVariable("CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN", "true"); } + if (await features.getValue("force_jgit" /* ForceJGit */)) { + core21.exportVariable("CODEQL_GIT_BACKEND", "jgit"); + } const kotlinLimitVar = "CODEQL_EXTRACTOR_KOTLIN_OVERRIDE_MAXIMUM_VERSION_LIMIT"; if (await codeQlVersionAtLeast(codeql, "2.20.3") && !await codeQlVersionAtLeast(codeql, "2.20.4")) { core21.exportVariable(kotlinLimitVar, "2.1.20"); diff --git a/src/feature-flags.ts b/src/feature-flags.ts index 6b40d04dab..05a2611426 100644 --- a/src/feature-flags.ts +++ b/src/feature-flags.ts @@ -82,6 +82,11 @@ export enum Feature { DisableJavaBuildlessEnabled = "disable_java_buildless_enabled", DisableKotlinAnalysisEnabled = "disable_kotlin_analysis_enabled", ExportDiagnosticsEnabled = "export_diagnostics_enabled", + /** + * Emergency override that forces the CodeQL CLI to use the JGit-based Git backend instead of its + * default backend selection. + */ + ForceJGit = "force_jgit", ForceNightly = "force_nightly", IgnoreGeneratedFiles = "ignore_generated_files", JavaNetworkDebugging = "java_network_debugging", @@ -224,6 +229,11 @@ export const featureConfig = { legacyApi: true, minimumVersion: undefined, }, + [Feature.ForceJGit]: { + defaultValue: false, + envVar: "CODEQL_ACTION_FORCE_JGIT", + minimumVersion: undefined, + }, [Feature.ForceNightly]: { defaultValue: false, envVar: "CODEQL_ACTION_FORCE_NIGHTLY", diff --git a/src/init-action.ts b/src/init-action.ts index 9d2619b1d1..b7593a51cc 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -614,6 +614,11 @@ async function run(startedAt: Date) { core.exportVariable("CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN", "true"); } + // Emergency override to force the CodeQL CLI back to the JGit-based Git backend. + if (await features.getValue(Feature.ForceJGit)) { + core.exportVariable("CODEQL_GIT_BACKEND", "jgit"); + } + const kotlinLimitVar = "CODEQL_EXTRACTOR_KOTLIN_OVERRIDE_MAXIMUM_VERSION_LIMIT"; if (