Skip to content

Commit 3434fbb

Browse files
authored
Merge pull request #4044 from github/mbg/ff/promote-toolcache
Promote `AllowToolcacheInput` feature
2 parents 4c0a1f0 + 3013ac0 commit 3434fbb

4 files changed

Lines changed: 11 additions & 49 deletions

File tree

lib/entry-points.js

Lines changed: 4 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/feature-flags.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ export enum Feature {
7474
AllowMergeConfigFiles = "allow_merge_config_files",
7575
/** Controls whether we allow multiple values for the `analysis-kinds` input. */
7676
AllowMultipleAnalysisKinds = "allow_multiple_analysis_kinds",
77-
AllowToolcacheInput = "allow_toolcache_input",
7877
CleanupTrapCaches = "cleanup_trap_caches",
7978
/** Whether to allow the `config-file` input to be specified via a repository property. */
8079
ConfigFileRepositoryProperty = "config_file_repository_property",
@@ -187,11 +186,6 @@ export const featureConfig = {
187186
envVar: "CODEQL_ACTION_ALLOW_MULTIPLE_ANALYSIS_KINDS",
188187
minimumVersion: undefined,
189188
},
190-
[Feature.AllowToolcacheInput]: {
191-
defaultValue: false,
192-
envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT",
193-
minimumVersion: undefined,
194-
},
195189
[Feature.CleanupTrapCaches]: {
196190
defaultValue: false,
197191
envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES",

src/setup-codeql.test.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ test.serial(
451451
async (t) => {
452452
const loggedMessages: LoggedMessage[] = [];
453453
const logger = getRecordingLogger(loggedMessages);
454-
const features = createFeatures([Feature.AllowToolcacheInput]);
454+
const features = createFeatures([]);
455455

456456
const latestToolcacheVersion = "3.2.1";
457457
const latestVersionPath = "/path/to/latest";
@@ -580,7 +580,7 @@ const toolcacheInputFallbackMacro = makeMacro({
580580

581581
toolcacheInputFallbackMacro.serial(
582582
"the toolcache doesn't have a CodeQL CLI when tools == toolcache",
583-
[Feature.AllowToolcacheInput],
583+
[],
584584
{ GITHUB_EVENT_NAME: "dynamic" },
585585
[],
586586
[
@@ -591,22 +591,14 @@ toolcacheInputFallbackMacro.serial(
591591

592592
toolcacheInputFallbackMacro.serial(
593593
"the workflow trigger is not `dynamic`",
594-
[Feature.AllowToolcacheInput],
594+
[],
595595
{ GITHUB_EVENT_NAME: "pull_request" },
596596
[],
597597
[
598598
`Ignoring 'tools: toolcache' because the workflow was not triggered dynamically.`,
599599
],
600600
);
601601

602-
toolcacheInputFallbackMacro.serial(
603-
"the feature flag is not enabled",
604-
[],
605-
{ GITHUB_EVENT_NAME: "dynamic" },
606-
[],
607-
[`Ignoring 'tools: toolcache' because the feature is not enabled.`],
608-
);
609-
610602
test.serial(
611603
'tryGetTagNameFromUrl extracts the right tag name for a repo name containing "codeql-bundle"',
612604
(t) => {

src/setup-codeql.ts

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -533,11 +533,7 @@ export async function getCodeQLSource(
533533
// We only allow `toolsInput === "toolcache"` for `dynamic` events. In general, using `toolsInput === "toolcache"`
534534
// can lead to alert wobble and so it shouldn't be used for an analysis where results are intended to be uploaded.
535535
// We also allow this in test mode.
536-
const allowToolcacheValueFF = await features.getValue(
537-
Feature.AllowToolcacheInput,
538-
);
539-
const allowToolcacheValue =
540-
allowToolcacheValueFF && (isDynamicWorkflow() || util.isInTestMode());
536+
const allowToolcacheValue = isDynamicWorkflow() || util.isInTestMode();
541537
if (allowToolcacheValue) {
542538
// If `toolsInput === "toolcache"`, try to find the latest version of the CLI that's available in the toolcache
543539
// and use that. We perform this check here since we can set `cliVersion` directly and don't want to default to
@@ -558,15 +554,9 @@ export async function getCodeQLSource(
558554
`Found no CodeQL CLI in the toolcache, ignoring 'tools: ${toolsInput}'...`,
559555
);
560556
} else {
561-
if (allowToolcacheValueFF) {
562-
logger.warning(
563-
`Ignoring 'tools: ${toolsInput}' because the workflow was not triggered dynamically.`,
564-
);
565-
} else {
566-
logger.info(
567-
`Ignoring 'tools: ${toolsInput}' because the feature is not enabled.`,
568-
);
569-
}
557+
logger.warning(
558+
`Ignoring 'tools: ${toolsInput}' because the workflow was not triggered dynamically.`,
559+
);
570560
}
571561

572562
const version = await resolveDefaultCliVersion(

0 commit comments

Comments
 (0)