Skip to content

Commit 1c78264

Browse files
committed
Abstract over FeatureEnablement implementations with initFeatures
1 parent 40fb3a7 commit 1c78264

17 files changed

+64
-30
lines changed

lib/analyze-action.js

Lines changed: 5 additions & 2 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: 4 additions & 1 deletion
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: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js

Lines changed: 4 additions & 1 deletion
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: 4 additions & 1 deletion
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: 4 additions & 1 deletion
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: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/analyze-action.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
} from "./dependency-caching";
3131
import { getDiffInformedAnalysisBranches } from "./diff-informed-analysis-utils";
3232
import { EnvVar } from "./environment";
33-
import { Features } from "./feature-flags";
33+
import { initFeatures } from "./feature-flags";
3434
import { KnownLanguage } from "./languages";
3535
import { getActionsLogger, Logger } from "./logging";
3636
import { cleanupAndUploadOverlayBaseDatabaseToCache } from "./overlay-database-utils";
@@ -293,7 +293,7 @@ async function run(startedAt: Date) {
293293

294294
util.checkActionVersion(actionsUtil.getActionVersion(), gitHubVersion);
295295

296-
const features = new Features(
296+
const features = initFeatures(
297297
gitHubVersion,
298298
repositoryNwo,
299299
actionsUtil.getTemporaryDirectory(),

src/autobuild.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { CodeQL, getCodeQL } from "./codeql";
66
import * as configUtils from "./config-utils";
77
import { DocUrl } from "./doc-url";
88
import { EnvVar } from "./environment";
9-
import { Feature, featureConfig, Features } from "./feature-flags";
9+
import { Feature, featureConfig, initFeatures } from "./feature-flags";
1010
import { KnownLanguage, Language } from "./languages";
1111
import { Logger } from "./logging";
1212
import { getRepositoryNwo } from "./repository";
@@ -117,7 +117,7 @@ export async function setupCppAutobuild(codeql: CodeQL, logger: Logger) {
117117
const featureName = "C++ automatic installation of dependencies";
118118
const gitHubVersion = await getGitHubVersion();
119119
const repositoryNwo = getRepositoryNwo();
120-
const features = new Features(
120+
const features = initFeatures(
121121
gitHubVersion,
122122
repositoryNwo,
123123
getTemporaryDirectory(),

src/diff-informed-analysis-utils.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
shouldPerformDiffInformedAnalysis,
99
exportedForTesting,
1010
} from "./diff-informed-analysis-utils";
11-
import { Feature, Features } from "./feature-flags";
11+
import { Feature, initFeatures } from "./feature-flags";
1212
import { getRunnerLogger } from "./logging";
1313
import { parseRepositoryNwo } from "./repository";
1414
import {
@@ -63,7 +63,7 @@ const testShouldPerformDiffInformedAnalysis = test.macro({
6363
delete process.env.CODEQL_ACTION_DIFF_INFORMED_QUERIES;
6464
}
6565

66-
const features = new Features(
66+
const features = initFeatures(
6767
testCase.gitHubVersion,
6868
parseRepositoryNwo("github/example"),
6969
tmpDir,

0 commit comments

Comments
 (0)