Skip to content

Commit db0d062

Browse files
Merge pull request #3618 from github/robertbrignull/delete-ghec-dr-flag
Remove the enableGhecDr flag
2 parents 2208b42 + 673ea13 commit db0d062

File tree

3 files changed

+7
-47
lines changed

3 files changed

+7
-47
lines changed

extensions/ql-vscode/src/config.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -680,11 +680,6 @@ export function getVariantAnalysisDefaultResultsSort(): SortKey {
680680
*/
681681
const ACTION_BRANCH = new Setting("actionBranch", VARIANT_ANALYSIS_SETTING);
682682

683-
export const VARIANT_ANALYSIS_ENABLE_GHEC_DR = new Setting(
684-
"enableGhecDr",
685-
VARIANT_ANALYSIS_SETTING,
686-
);
687-
688683
export function getActionBranch(): string {
689684
return ACTION_BRANCH.getValue<string>() || "main";
690685
}
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
import {
2-
VARIANT_ANALYSIS_ENABLE_GHEC_DR,
3-
hasEnterpriseUri,
4-
hasGhecDrUri,
5-
} from "../config";
1+
import { hasEnterpriseUri, hasGhecDrUri } from "../config";
62

73
/**
84
* Determines whether MRVA should be enabled or not for the current GitHub host.
5+
* MRVA is enabled on github.com and GHEC-DR.
96
* This is based on the `github-enterprise.uri` setting.
107
*/
118
export function isVariantAnalysisEnabledForGitHubHost(): boolean {
12-
return (
13-
// MRVA is always enabled on github.com
14-
!hasEnterpriseUri() ||
15-
// MRVA can be enabled on GHEC-DR using a feature flag
16-
(hasGhecDrUri() && !!VARIANT_ANALYSIS_ENABLE_GHEC_DR.getValue<boolean>())
17-
);
9+
return !hasEnterpriseUri() || hasGhecDrUri();
1810
}
Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,25 @@
11
import { ConfigurationTarget } from "vscode";
2-
import {
3-
VARIANT_ANALYSIS_ENABLE_GHEC_DR,
4-
VSCODE_GITHUB_ENTERPRISE_URI_SETTING,
5-
} from "../../../../src/config";
2+
import { VSCODE_GITHUB_ENTERPRISE_URI_SETTING } from "../../../../src/config";
63
import { isVariantAnalysisEnabledForGitHubHost } from "../../../../src/variant-analysis/ghec-dr";
74

85
describe("checkVariantAnalysisEnabled", () => {
9-
it("returns cleanly when no enterprise URI is set", async () => {
6+
it("returns true when no enterprise URI is set", async () => {
107
expect(isVariantAnalysisEnabledForGitHubHost()).toBe(true);
118
});
129

13-
it("returns false when GHES enterprise URI is set and variant analysis feature flag is not set", async () => {
10+
it("returns false when GHES enterprise URI is set", async () => {
1411
await VSCODE_GITHUB_ENTERPRISE_URI_SETTING.updateValue(
1512
"https://github.example.com",
1613
ConfigurationTarget.Global,
1714
);
1815
expect(isVariantAnalysisEnabledForGitHubHost()).toBe(false);
1916
});
2017

21-
it("returns false when GHES enterprise URI is set and variant analysis feature flag is set", async () => {
22-
await VSCODE_GITHUB_ENTERPRISE_URI_SETTING.updateValue(
23-
"https://github.example.com",
24-
ConfigurationTarget.Global,
25-
);
26-
await VARIANT_ANALYSIS_ENABLE_GHEC_DR.updateValue(
27-
"true",
28-
ConfigurationTarget.Global,
29-
);
30-
expect(isVariantAnalysisEnabledForGitHubHost()).toBe(false);
31-
});
32-
33-
it("returns false when GHEC-DR URI is set and variant analysis feature flag is not set", async () => {
18+
it("returns true when a GHEC-DR URI is set", async () => {
3419
await VSCODE_GITHUB_ENTERPRISE_URI_SETTING.updateValue(
3520
"https://example.ghe.com",
3621
ConfigurationTarget.Global,
3722
);
38-
expect(isVariantAnalysisEnabledForGitHubHost()).toBe(false);
39-
});
40-
41-
it("returns true when GHEC-DR URI is set and variant analysis feature flag is set", async () => {
42-
await VSCODE_GITHUB_ENTERPRISE_URI_SETTING.updateValue(
43-
"https://example.ghe.com",
44-
ConfigurationTarget.Global,
45-
);
46-
await VARIANT_ANALYSIS_ENABLE_GHEC_DR.updateValue(
47-
"true",
48-
ConfigurationTarget.Global,
49-
);
5023
expect(isVariantAnalysisEnabledForGitHubHost()).toBe(true);
5124
});
5225
});

0 commit comments

Comments
 (0)