Extract GitHubFeatureFlags to a separate class

Internal refactoring so that `GitHubFeatureFlags` is
private only. The public facing class is `Features`.
This commit is contained in:
Andrew Eisenberg
2022-10-06 14:42:57 -07:00
parent 5915e70486
commit b27aed78f5
15 changed files with 149 additions and 110 deletions
+3 -8
View File
@@ -5,7 +5,7 @@ import {
Feature,
featureConfig,
FeatureFlags,
GitHubFeatureFlags,
Features,
} from "./feature-flags";
import { getRunnerLogger } from "./logging";
import { parseRepositoryNwo } from "./repository";
@@ -217,7 +217,7 @@ for (const featureFlag of Object.keys(featureConfig)) {
await t.throwsAsync(
async () => featureFlags.getValue(featureFlag as Feature),
{
message: `A minimum version is specified for feature flag ${featureFlag}, but no instance of CodeQL was provided.`,
message: `Internal error: A minimum version is specified for feature flag ${featureFlag}, but no instance of CodeQL was provided.`,
}
);
});
@@ -288,12 +288,7 @@ function setUpTests(
): FeatureFlags {
setupActionsVars(tmpDir, tmpDir);
return new GitHubFeatureFlags(
gitHubVersion,
testApiDetails,
testRepositoryNwo,
logger
);
return new Features(gitHubVersion, testApiDetails, testRepositoryNwo, logger);
}
function includeCodeQlIfRequired(featureFlag: string) {