Skip to content

Commit ea1a400

Browse files
committed
Revert "Merge pull request #3476 from github/henrymercer/retry-auth-errors"
This reverts commit 9658e23, reversing changes made to 2d6b98c.
1 parent ef618fe commit ea1a400

File tree

9 files changed

+23
-127
lines changed

9 files changed

+23
-127
lines changed

lib/analyze-action.js

Lines changed: 1 addition & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/autobuild-action.js

Lines changed: 1 addition & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action-post.js

Lines changed: 1 addition & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js

Lines changed: 1 addition & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/setup-codeql-action.js

Lines changed: 1 addition & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/start-proxy-action.js

Lines changed: 1 addition & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-sarif-action.js

Lines changed: 1 addition & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/feature-flags.test.ts

Lines changed: 15 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import * as path from "path";
44
import test, { ExecutionContext } from "ava";
55

66
import * as defaults from "./defaults.json";
7-
import { EnvVar } from "./environment";
87
import {
98
Feature,
109
featureConfig,
@@ -38,39 +37,29 @@ test.beforeEach(() => {
3837

3938
const testRepositoryNwo = parseRepositoryNwo("github/example");
4039

41-
test(`All features use default values if running against GHES`, async (t) => {
40+
test(`All features are disabled if running against GHES`, async (t) => {
4241
await withTmpDir(async (tmpDir) => {
43-
const loggedMessages: LoggedMessage[] = [];
42+
const loggedMessages = [];
4443
const features = setUpFeatureFlagTests(
4544
tmpDir,
4645
getRecordingLogger(loggedMessages),
4746
{ type: GitHubVariant.GHES, version: "3.0.0" },
4847
);
4948

50-
await assertAllFeaturesHaveDefaultValues(t, features);
51-
assertLoggedMessage(
52-
t,
53-
loggedMessages,
54-
"Not running against github.com. Using default values for all features.",
55-
);
56-
});
57-
});
58-
59-
test(`All features use default values if running in CCR`, async (t) => {
60-
await withTmpDir(async (tmpDir) => {
61-
const loggedMessages: LoggedMessage[] = [];
62-
const features = setUpFeatureFlagTests(
63-
tmpDir,
64-
getRecordingLogger(loggedMessages),
65-
);
66-
67-
process.env[EnvVar.ANALYSIS_KEY] = "dynamic/copilot-pull-request-reviewer";
49+
for (const feature of Object.values(Feature)) {
50+
t.deepEqual(
51+
await getFeatureIncludingCodeQlIfRequired(features, feature),
52+
featureConfig[feature].defaultValue,
53+
);
54+
}
6855

69-
await assertAllFeaturesHaveDefaultValues(t, features);
70-
assertLoggedMessage(
71-
t,
72-
loggedMessages,
73-
"Feature flags are not supported in Copilot Code Review. Using default values for all features.",
56+
t.assert(
57+
loggedMessages.find(
58+
(v: LoggedMessage) =>
59+
v.type === "debug" &&
60+
v.message ===
61+
"Not running against github.com. Disabling all toggleable features.",
62+
) !== undefined,
7463
);
7564
});
7665
});
@@ -553,30 +542,6 @@ test("non-legacy feature flags should not start with codeql_action_", async (t)
553542
}
554543
});
555544

556-
async function assertAllFeaturesHaveDefaultValues(
557-
t: ExecutionContext<unknown>,
558-
features: FeatureEnablement,
559-
) {
560-
for (const feature of Object.values(Feature)) {
561-
t.deepEqual(
562-
await getFeatureIncludingCodeQlIfRequired(features, feature),
563-
featureConfig[feature].defaultValue,
564-
);
565-
}
566-
}
567-
568-
function assertLoggedMessage(
569-
t: ExecutionContext<unknown>,
570-
loggedMessages: LoggedMessage[],
571-
expectedMessage: string,
572-
) {
573-
t.assert(
574-
loggedMessages.find(
575-
(v: LoggedMessage) => v.type === "debug" && v.message === expectedMessage,
576-
) !== undefined,
577-
);
578-
}
579-
580545
function assertAllFeaturesUndefinedInApi(
581546
t: ExecutionContext<unknown>,
582547
loggedMessages: LoggedMessage[],

src/feature-flags.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import * as path from "path";
33

44
import * as semver from "semver";
55

6-
import { isCCR } from "./actions-util";
76
import { getApiClient } from "./api-client";
87
import type { CodeQL } from "./codeql";
98
import * as defaults from "./defaults.json";
@@ -665,14 +664,7 @@ class GitHubFeatureFlags {
665664
// Do nothing when not running against github.com
666665
if (!supportsFeatureFlags(this.gitHubVersion.type)) {
667666
this.logger.debug(
668-
"Not running against github.com. Using default values for all features.",
669-
);
670-
this.hasAccessedRemoteFeatureFlags = false;
671-
return {};
672-
}
673-
if (isCCR()) {
674-
this.logger.debug(
675-
"Feature flags are not supported in Copilot Code Review. Using default values for all features.",
667+
"Not running against github.com. Disabling all toggleable features.",
676668
);
677669
this.hasAccessedRemoteFeatureFlags = false;
678670
return {};

0 commit comments

Comments
 (0)