Fix name of Python stdlib extraction feature flag
This commit is contained in:
parent
c4700633cb
commit
d591d172c8
9 changed files with 43 additions and 19 deletions
17
lib/feature-flags.js
generated
17
lib/feature-flags.js
generated
|
|
@ -45,18 +45,21 @@ exports.CODEQL_VERSION_ZSTD_BUNDLE = "2.19.0";
|
||||||
/**
|
/**
|
||||||
* Feature enablement as returned by the GitHub API endpoint.
|
* Feature enablement as returned by the GitHub API endpoint.
|
||||||
*
|
*
|
||||||
|
* Do not include the `codeql_action_` prefix as this is stripped by the API
|
||||||
|
* endpoint.
|
||||||
|
*
|
||||||
* Legacy features should end with `_enabled`.
|
* Legacy features should end with `_enabled`.
|
||||||
*/
|
*/
|
||||||
var Feature;
|
var Feature;
|
||||||
(function (Feature) {
|
(function (Feature) {
|
||||||
Feature["ArtifactV4Upgrade"] = "artifact_v4_upgrade";
|
Feature["ArtifactV4Upgrade"] = "artifact_v4_upgrade";
|
||||||
Feature["CleanupTrapCaches"] = "cleanup_trap_caches";
|
Feature["CleanupTrapCaches"] = "cleanup_trap_caches";
|
||||||
Feature["CodeqlActionPythonDefaultIsToNotExtractStdlib"] = "codeql_action_python_default_is_to_not_extract_stdlib";
|
|
||||||
Feature["CppDependencyInstallation"] = "cpp_dependency_installation_enabled";
|
Feature["CppDependencyInstallation"] = "cpp_dependency_installation_enabled";
|
||||||
Feature["DisableCsharpBuildless"] = "disable_csharp_buildless";
|
Feature["DisableCsharpBuildless"] = "disable_csharp_buildless";
|
||||||
Feature["DisableJavaBuildlessEnabled"] = "disable_java_buildless_enabled";
|
Feature["DisableJavaBuildlessEnabled"] = "disable_java_buildless_enabled";
|
||||||
Feature["DisableKotlinAnalysisEnabled"] = "disable_kotlin_analysis_enabled";
|
Feature["DisableKotlinAnalysisEnabled"] = "disable_kotlin_analysis_enabled";
|
||||||
Feature["ExportDiagnosticsEnabled"] = "export_diagnostics_enabled";
|
Feature["ExportDiagnosticsEnabled"] = "export_diagnostics_enabled";
|
||||||
|
Feature["PythonDefaultIsToNotExtractStdlib"] = "python_default_is_to_not_extract_stdlib";
|
||||||
Feature["QaTelemetryEnabled"] = "qa_telemetry_enabled";
|
Feature["QaTelemetryEnabled"] = "qa_telemetry_enabled";
|
||||||
Feature["ZstdBundle"] = "zstd_bundle";
|
Feature["ZstdBundle"] = "zstd_bundle";
|
||||||
Feature["ZstdBundleStreamingExtraction"] = "zstd_bundle_streaming_extraction";
|
Feature["ZstdBundleStreamingExtraction"] = "zstd_bundle_streaming_extraction";
|
||||||
|
|
@ -72,12 +75,6 @@ exports.featureConfig = {
|
||||||
envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES",
|
envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES",
|
||||||
minimumVersion: undefined,
|
minimumVersion: undefined,
|
||||||
},
|
},
|
||||||
[Feature.CodeqlActionPythonDefaultIsToNotExtractStdlib]: {
|
|
||||||
defaultValue: false,
|
|
||||||
envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION",
|
|
||||||
minimumVersion: undefined,
|
|
||||||
toolsFeature: tools_features_1.ToolsFeature.PythonDefaultIsToNotExtractStdlib,
|
|
||||||
},
|
|
||||||
[Feature.CppDependencyInstallation]: {
|
[Feature.CppDependencyInstallation]: {
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES",
|
envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES",
|
||||||
|
|
@ -107,6 +104,12 @@ exports.featureConfig = {
|
||||||
legacyApi: true,
|
legacyApi: true,
|
||||||
minimumVersion: undefined,
|
minimumVersion: undefined,
|
||||||
},
|
},
|
||||||
|
[Feature.PythonDefaultIsToNotExtractStdlib]: {
|
||||||
|
defaultValue: false,
|
||||||
|
envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION",
|
||||||
|
minimumVersion: undefined,
|
||||||
|
toolsFeature: tools_features_1.ToolsFeature.PythonDefaultIsToNotExtractStdlib,
|
||||||
|
},
|
||||||
[Feature.QaTelemetryEnabled]: {
|
[Feature.QaTelemetryEnabled]: {
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
envVar: "CODEQL_ACTION_QA_TELEMETRY",
|
envVar: "CODEQL_ACTION_QA_TELEMETRY",
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
7
lib/feature-flags.test.js
generated
7
lib/feature-flags.test.js
generated
|
|
@ -318,6 +318,13 @@ for (const feature of Object.keys(feature_flags_1.featureConfig)) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
(0, ava_1.default)("non-legacy feature flags should not start with codeql_action_", async (t) => {
|
||||||
|
for (const [feature, config] of Object.entries(feature_flags_1.featureConfig)) {
|
||||||
|
if (!config.legacyApi) {
|
||||||
|
t.false(feature.startsWith("codeql_action_"), `non-legacy feature ${feature} should not start with 'codeql_action_'`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
function assertAllFeaturesUndefinedInApi(t, loggedMessages) {
|
function assertAllFeaturesUndefinedInApi(t, loggedMessages) {
|
||||||
for (const feature of Object.keys(feature_flags_1.featureConfig)) {
|
for (const feature of Object.keys(feature_flags_1.featureConfig)) {
|
||||||
t.assert(loggedMessages.find((v) => v.type === "debug" &&
|
t.assert(loggedMessages.find((v) => v.type === "debug" &&
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
2
lib/init-action.js
generated
2
lib/init-action.js
generated
|
|
@ -344,7 +344,7 @@ async function run() {
|
||||||
}
|
}
|
||||||
if (await codeql.supportsFeature(tools_features_1.ToolsFeature.PythonDefaultIsToNotExtractStdlib)) {
|
if (await codeql.supportsFeature(tools_features_1.ToolsFeature.PythonDefaultIsToNotExtractStdlib)) {
|
||||||
// We are in the case where the default has switched to not extracting the stdlib.
|
// We are in the case where the default has switched to not extracting the stdlib.
|
||||||
if (!(await features.getValue(feature_flags_1.Feature.CodeqlActionPythonDefaultIsToNotExtractStdlib, codeql))) {
|
if (!(await features.getValue(feature_flags_1.Feature.PythonDefaultIsToNotExtractStdlib, codeql))) {
|
||||||
// We are in a situation where the feature flag is not rolled out,
|
// We are in a situation where the feature flag is not rolled out,
|
||||||
// so we need to suppress the new default behavior.
|
// so we need to suppress the new default behavior.
|
||||||
core.exportVariable("CODEQL_EXTRACTOR_PYTHON_EXTRACT_STDLIB", "true");
|
core.exportVariable("CODEQL_EXTRACTOR_PYTHON_EXTRACT_STDLIB", "true");
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -495,6 +495,17 @@ test("non-legacy feature flags should not end with _enabled", async (t) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("non-legacy feature flags should not start with codeql_action_", async (t) => {
|
||||||
|
for (const [feature, config] of Object.entries(featureConfig)) {
|
||||||
|
if (!config.legacyApi) {
|
||||||
|
t.false(
|
||||||
|
feature.startsWith("codeql_action_"),
|
||||||
|
`non-legacy feature ${feature} should not start with 'codeql_action_'`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function assertAllFeaturesUndefinedInApi(
|
function assertAllFeaturesUndefinedInApi(
|
||||||
t: ExecutionContext<unknown>,
|
t: ExecutionContext<unknown>,
|
||||||
loggedMessages: LoggedMessage[],
|
loggedMessages: LoggedMessage[],
|
||||||
|
|
|
||||||
|
|
@ -42,17 +42,20 @@ export interface FeatureEnablement {
|
||||||
/**
|
/**
|
||||||
* Feature enablement as returned by the GitHub API endpoint.
|
* Feature enablement as returned by the GitHub API endpoint.
|
||||||
*
|
*
|
||||||
|
* Do not include the `codeql_action_` prefix as this is stripped by the API
|
||||||
|
* endpoint.
|
||||||
|
*
|
||||||
* Legacy features should end with `_enabled`.
|
* Legacy features should end with `_enabled`.
|
||||||
*/
|
*/
|
||||||
export enum Feature {
|
export enum Feature {
|
||||||
ArtifactV4Upgrade = "artifact_v4_upgrade",
|
ArtifactV4Upgrade = "artifact_v4_upgrade",
|
||||||
CleanupTrapCaches = "cleanup_trap_caches",
|
CleanupTrapCaches = "cleanup_trap_caches",
|
||||||
CodeqlActionPythonDefaultIsToNotExtractStdlib = "codeql_action_python_default_is_to_not_extract_stdlib",
|
|
||||||
CppDependencyInstallation = "cpp_dependency_installation_enabled",
|
CppDependencyInstallation = "cpp_dependency_installation_enabled",
|
||||||
DisableCsharpBuildless = "disable_csharp_buildless",
|
DisableCsharpBuildless = "disable_csharp_buildless",
|
||||||
DisableJavaBuildlessEnabled = "disable_java_buildless_enabled",
|
DisableJavaBuildlessEnabled = "disable_java_buildless_enabled",
|
||||||
DisableKotlinAnalysisEnabled = "disable_kotlin_analysis_enabled",
|
DisableKotlinAnalysisEnabled = "disable_kotlin_analysis_enabled",
|
||||||
ExportDiagnosticsEnabled = "export_diagnostics_enabled",
|
ExportDiagnosticsEnabled = "export_diagnostics_enabled",
|
||||||
|
PythonDefaultIsToNotExtractStdlib = "python_default_is_to_not_extract_stdlib",
|
||||||
QaTelemetryEnabled = "qa_telemetry_enabled",
|
QaTelemetryEnabled = "qa_telemetry_enabled",
|
||||||
ZstdBundle = "zstd_bundle",
|
ZstdBundle = "zstd_bundle",
|
||||||
ZstdBundleStreamingExtraction = "zstd_bundle_streaming_extraction",
|
ZstdBundleStreamingExtraction = "zstd_bundle_streaming_extraction",
|
||||||
|
|
@ -99,12 +102,6 @@ export const featureConfig: Record<
|
||||||
envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES",
|
envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES",
|
||||||
minimumVersion: undefined,
|
minimumVersion: undefined,
|
||||||
},
|
},
|
||||||
[Feature.CodeqlActionPythonDefaultIsToNotExtractStdlib]: {
|
|
||||||
defaultValue: false,
|
|
||||||
envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION",
|
|
||||||
minimumVersion: undefined,
|
|
||||||
toolsFeature: ToolsFeature.PythonDefaultIsToNotExtractStdlib,
|
|
||||||
},
|
|
||||||
[Feature.CppDependencyInstallation]: {
|
[Feature.CppDependencyInstallation]: {
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES",
|
envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES",
|
||||||
|
|
@ -134,6 +131,12 @@ export const featureConfig: Record<
|
||||||
legacyApi: true,
|
legacyApi: true,
|
||||||
minimumVersion: undefined,
|
minimumVersion: undefined,
|
||||||
},
|
},
|
||||||
|
[Feature.PythonDefaultIsToNotExtractStdlib]: {
|
||||||
|
defaultValue: false,
|
||||||
|
envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION",
|
||||||
|
minimumVersion: undefined,
|
||||||
|
toolsFeature: ToolsFeature.PythonDefaultIsToNotExtractStdlib,
|
||||||
|
},
|
||||||
[Feature.QaTelemetryEnabled]: {
|
[Feature.QaTelemetryEnabled]: {
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
envVar: "CODEQL_ACTION_QA_TELEMETRY",
|
envVar: "CODEQL_ACTION_QA_TELEMETRY",
|
||||||
|
|
|
||||||
|
|
@ -597,7 +597,7 @@ async function run() {
|
||||||
// We are in the case where the default has switched to not extracting the stdlib.
|
// We are in the case where the default has switched to not extracting the stdlib.
|
||||||
if (
|
if (
|
||||||
!(await features.getValue(
|
!(await features.getValue(
|
||||||
Feature.CodeqlActionPythonDefaultIsToNotExtractStdlib,
|
Feature.PythonDefaultIsToNotExtractStdlib,
|
||||||
codeql,
|
codeql,
|
||||||
))
|
))
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue