Return OfflineFeatures for CCR

This commit is contained in:
Michael B. Gale
2026-02-12 18:00:19 +00:00
parent 2c9bc45d46
commit 9dcfdf2c9c
9 changed files with 70 additions and 8 deletions
+5 -1
View File
@@ -108115,7 +108115,11 @@ function supportsFeatureFlags(githubVariant) {
return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */;
}
function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) {
return new Features(gitHubVersion, repositoryNwo, tempDir, logger);
if (isCCR()) {
return new OfflineFeatures(logger);
} else {
return new Features(gitHubVersion, repositoryNwo, tempDir, logger);
}
}
// src/diff-informed-analysis-utils.ts
+9 -1
View File
@@ -103130,6 +103130,10 @@ function getWorkflowRunAttempt() {
function isSelfHostedRunner() {
return process.env.RUNNER_ENVIRONMENT === "self-hosted";
}
var CCR_KEY_PREFIX = "dynamic/copilot-pull-request-reviewer";
function isCCR() {
return process.env["CODEQL_ACTION_ANALYSIS_KEY" /* ANALYSIS_KEY */]?.startsWith(CCR_KEY_PREFIX) || false;
}
function prettyPrintInvocation(cmd, args) {
return [cmd, ...args].map((x) => x.includes(" ") ? `'${x}'` : x).join(" ");
}
@@ -104448,7 +104452,11 @@ function supportsFeatureFlags(githubVariant) {
return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */;
}
function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) {
return new Features(gitHubVersion, repositoryNwo, tempDir, logger);
if (isCCR()) {
return new OfflineFeatures(logger);
} else {
return new Features(gitHubVersion, repositoryNwo, tempDir, logger);
}
}
// src/trap-caching.ts
+5 -1
View File
@@ -165441,7 +165441,11 @@ function supportsFeatureFlags(githubVariant) {
return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */;
}
function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) {
return new Features(gitHubVersion, repositoryNwo, tempDir, logger);
if (isCCR()) {
return new OfflineFeatures(logger);
} else {
return new Features(gitHubVersion, repositoryNwo, tempDir, logger);
}
}
// src/diff-informed-analysis-utils.ts
+5 -1
View File
@@ -105648,7 +105648,11 @@ function supportsFeatureFlags(githubVariant) {
return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */;
}
function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) {
return new Features(gitHubVersion, repositoryNwo, tempDir, logger);
if (isCCR()) {
return new OfflineFeatures(logger);
} else {
return new Features(gitHubVersion, repositoryNwo, tempDir, logger);
}
}
// src/diff-informed-analysis-utils.ts
+9 -1
View File
@@ -103247,6 +103247,10 @@ function isSelfHostedRunner() {
function isDynamicWorkflow() {
return getWorkflowEventName() === "dynamic";
}
var CCR_KEY_PREFIX = "dynamic/copilot-pull-request-reviewer";
function isCCR() {
return process.env["CODEQL_ACTION_ANALYSIS_KEY" /* ANALYSIS_KEY */]?.startsWith(CCR_KEY_PREFIX) || false;
}
function prettyPrintInvocation(cmd, args) {
return [cmd, ...args].map((x) => x.includes(" ") ? `'${x}'` : x).join(" ");
}
@@ -104349,7 +104353,11 @@ function supportsFeatureFlags(githubVariant) {
return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */;
}
function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) {
return new Features(gitHubVersion, repositoryNwo, tempDir, logger);
if (isCCR()) {
return new OfflineFeatures(logger);
} else {
return new Features(gitHubVersion, repositoryNwo, tempDir, logger);
}
}
// src/init.ts
+9 -1
View File
@@ -120267,6 +120267,10 @@ function getWorkflowRunAttempt() {
function isSelfHostedRunner() {
return process.env.RUNNER_ENVIRONMENT === "self-hosted";
}
var CCR_KEY_PREFIX = "dynamic/copilot-pull-request-reviewer";
function isCCR() {
return process.env["CODEQL_ACTION_ANALYSIS_KEY" /* ANALYSIS_KEY */]?.startsWith(CCR_KEY_PREFIX) || false;
}
var persistedInputsKey = "persisted_inputs";
var persistInputs = function() {
const inputEnvironmentVariables = Object.entries(process.env).filter(
@@ -121142,7 +121146,11 @@ function supportsFeatureFlags(githubVariant) {
return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */;
}
function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) {
return new Features(gitHubVersion, repositoryNwo, tempDir, logger);
if (isCCR()) {
return new OfflineFeatures(logger);
} else {
return new Features(gitHubVersion, repositoryNwo, tempDir, logger);
}
}
// src/start-proxy.ts
+5 -1
View File
@@ -107303,7 +107303,11 @@ function supportsFeatureFlags(githubVariant) {
return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */;
}
function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) {
return new Features(gitHubVersion, repositoryNwo, tempDir, logger);
if (isCCR()) {
return new OfflineFeatures(logger);
} else {
return new Features(gitHubVersion, repositoryNwo, tempDir, logger);
}
}
// src/status-report.ts