Skip to content

Commit d591d17

Browse files
committed
Fix name of Python stdlib extraction feature flag
1 parent c470063 commit d591d17

9 files changed

+43
-19
lines changed

lib/feature-flags.js

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

lib/feature-flags.js.map

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

lib/feature-flags.test.js

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

lib/feature-flags.test.js.map

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

lib/init-action.js.map

Lines changed: 1 addition & 1 deletion
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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,17 @@ test("non-legacy feature flags should not end with _enabled", async (t) => {
495495
}
496496
});
497497

498+
test("non-legacy feature flags should not start with codeql_action_", async (t) => {
499+
for (const [feature, config] of Object.entries(featureConfig)) {
500+
if (!config.legacyApi) {
501+
t.false(
502+
feature.startsWith("codeql_action_"),
503+
`non-legacy feature ${feature} should not start with 'codeql_action_'`,
504+
);
505+
}
506+
}
507+
});
508+
498509
function assertAllFeaturesUndefinedInApi(
499510
t: ExecutionContext<unknown>,
500511
loggedMessages: LoggedMessage[],

src/feature-flags.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,20 @@ export interface FeatureEnablement {
4242
/**
4343
* Feature enablement as returned by the GitHub API endpoint.
4444
*
45+
* Do not include the `codeql_action_` prefix as this is stripped by the API
46+
* endpoint.
47+
*
4548
* Legacy features should end with `_enabled`.
4649
*/
4750
export enum Feature {
4851
ArtifactV4Upgrade = "artifact_v4_upgrade",
4952
CleanupTrapCaches = "cleanup_trap_caches",
50-
CodeqlActionPythonDefaultIsToNotExtractStdlib = "codeql_action_python_default_is_to_not_extract_stdlib",
5153
CppDependencyInstallation = "cpp_dependency_installation_enabled",
5254
DisableCsharpBuildless = "disable_csharp_buildless",
5355
DisableJavaBuildlessEnabled = "disable_java_buildless_enabled",
5456
DisableKotlinAnalysisEnabled = "disable_kotlin_analysis_enabled",
5557
ExportDiagnosticsEnabled = "export_diagnostics_enabled",
58+
PythonDefaultIsToNotExtractStdlib = "python_default_is_to_not_extract_stdlib",
5659
QaTelemetryEnabled = "qa_telemetry_enabled",
5760
ZstdBundle = "zstd_bundle",
5861
ZstdBundleStreamingExtraction = "zstd_bundle_streaming_extraction",
@@ -99,12 +102,6 @@ export const featureConfig: Record<
99102
envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES",
100103
minimumVersion: undefined,
101104
},
102-
[Feature.CodeqlActionPythonDefaultIsToNotExtractStdlib]: {
103-
defaultValue: false,
104-
envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION",
105-
minimumVersion: undefined,
106-
toolsFeature: ToolsFeature.PythonDefaultIsToNotExtractStdlib,
107-
},
108105
[Feature.CppDependencyInstallation]: {
109106
defaultValue: false,
110107
envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES",
@@ -134,6 +131,12 @@ export const featureConfig: Record<
134131
legacyApi: true,
135132
minimumVersion: undefined,
136133
},
134+
[Feature.PythonDefaultIsToNotExtractStdlib]: {
135+
defaultValue: false,
136+
envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION",
137+
minimumVersion: undefined,
138+
toolsFeature: ToolsFeature.PythonDefaultIsToNotExtractStdlib,
139+
},
137140
[Feature.QaTelemetryEnabled]: {
138141
defaultValue: false,
139142
envVar: "CODEQL_ACTION_QA_TELEMETRY",

src/init-action.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ async function run() {
597597
// We are in the case where the default has switched to not extracting the stdlib.
598598
if (
599599
!(await features.getValue(
600-
Feature.CodeqlActionPythonDefaultIsToNotExtractStdlib,
600+
Feature.PythonDefaultIsToNotExtractStdlib,
601601
codeql,
602602
))
603603
) {

0 commit comments

Comments
 (0)