mirror of
https://github.com/github/codeql-action.git
synced 2026-01-07 15:10:07 +08:00
Fix name of Python stdlib extraction feature flag
This commit is contained in:
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.
|
||||
*
|
||||
* Do not include the `codeql_action_` prefix as this is stripped by the API
|
||||
* endpoint.
|
||||
*
|
||||
* Legacy features should end with `_enabled`.
|
||||
*/
|
||||
var Feature;
|
||||
(function (Feature) {
|
||||
Feature["ArtifactV4Upgrade"] = "artifact_v4_upgrade";
|
||||
Feature["CleanupTrapCaches"] = "cleanup_trap_caches";
|
||||
Feature["CodeqlActionPythonDefaultIsToNotExtractStdlib"] = "codeql_action_python_default_is_to_not_extract_stdlib";
|
||||
Feature["CppDependencyInstallation"] = "cpp_dependency_installation_enabled";
|
||||
Feature["DisableCsharpBuildless"] = "disable_csharp_buildless";
|
||||
Feature["DisableJavaBuildlessEnabled"] = "disable_java_buildless_enabled";
|
||||
Feature["DisableKotlinAnalysisEnabled"] = "disable_kotlin_analysis_enabled";
|
||||
Feature["ExportDiagnosticsEnabled"] = "export_diagnostics_enabled";
|
||||
Feature["PythonDefaultIsToNotExtractStdlib"] = "python_default_is_to_not_extract_stdlib";
|
||||
Feature["QaTelemetryEnabled"] = "qa_telemetry_enabled";
|
||||
Feature["ZstdBundle"] = "zstd_bundle";
|
||||
Feature["ZstdBundleStreamingExtraction"] = "zstd_bundle_streaming_extraction";
|
||||
@@ -72,12 +75,6 @@ exports.featureConfig = {
|
||||
envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES",
|
||||
minimumVersion: undefined,
|
||||
},
|
||||
[Feature.CodeqlActionPythonDefaultIsToNotExtractStdlib]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION",
|
||||
minimumVersion: undefined,
|
||||
toolsFeature: tools_features_1.ToolsFeature.PythonDefaultIsToNotExtractStdlib,
|
||||
},
|
||||
[Feature.CppDependencyInstallation]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES",
|
||||
@@ -107,6 +104,12 @@ exports.featureConfig = {
|
||||
legacyApi: true,
|
||||
minimumVersion: undefined,
|
||||
},
|
||||
[Feature.PythonDefaultIsToNotExtractStdlib]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION",
|
||||
minimumVersion: undefined,
|
||||
toolsFeature: tools_features_1.ToolsFeature.PythonDefaultIsToNotExtractStdlib,
|
||||
},
|
||||
[Feature.QaTelemetryEnabled]: {
|
||||
defaultValue: false,
|
||||
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) {
|
||||
for (const feature of Object.keys(feature_flags_1.featureConfig)) {
|
||||
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)) {
|
||||
// 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,
|
||||
// so we need to suppress the new default behavior.
|
||||
core.exportVariable("CODEQL_EXTRACTOR_PYTHON_EXTRACT_STDLIB", "true");
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user