Add FF to force JGit-based Git backend

This commit is contained in:
Henry Mercer
2026-06-01 15:20:13 +01:00
parent d1eb1207b4
commit 948a63aed1
3 changed files with 23 additions and 0 deletions
+8
View File
@@ -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");
+10
View File
@@ -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",
+5
View File
@@ -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 (