File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ export interface FeatureEnablement {
47
47
export enum Feature {
48
48
ArtifactV4Upgrade = "artifact_v4_upgrade" ,
49
49
CleanupTrapCaches = "cleanup_trap_caches" ,
50
+ CodeqlActionPythonDefaultIsToNotExtractStdlib = "codeql_action_python_default_is_to_not_extract_stdlib" ,
50
51
CppDependencyInstallation = "cpp_dependency_installation_enabled" ,
51
52
DisableCsharpBuildless = "disable_csharp_buildless" ,
52
53
DisableJavaBuildlessEnabled = "disable_java_buildless_enabled" ,
@@ -97,6 +98,12 @@ export const featureConfig: Record<
97
98
envVar : "CODEQL_ACTION_CLEANUP_TRAP_CACHES" ,
98
99
minimumVersion : undefined ,
99
100
} ,
101
+ [ Feature . CodeqlActionPythonDefaultIsToNotExtractStdlib ] : {
102
+ defaultValue : false ,
103
+ envVar : "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION" ,
104
+ minimumVersion : undefined ,
105
+ toolsFeature : ToolsFeature . PythonDefaultIsToNotExtractStdlib ,
106
+ } ,
100
107
[ Feature . CppDependencyInstallation ] : {
101
108
defaultValue : false ,
102
109
envVar : "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES" ,
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ import {
65
65
getErrorMessage ,
66
66
} from "./util" ;
67
67
import { validateWorkflow } from "./workflow" ;
68
+ import { isFeatureAvailable } from "@actions/cache" ;
68
69
69
70
/** Fields of the init status report that can be sent before `config` is populated. */
70
71
interface InitStatusReport extends StatusReportBase {
@@ -611,6 +612,15 @@ async function run() {
611
612
) ;
612
613
}
613
614
615
+ if ( await codeql . supportsFeature ( ToolsFeature . PythonDefaultIsToNotExtractStdlib ) ) {
616
+ // We are in the case where the default has switched to not extracting the stdlib.
617
+ if ( ! ( await features . getValue ( Feature . CodeqlActionPythonDefaultIsToNotExtractStdlib , codeql ) ) ) {
618
+ // We are in a situation where the feature flag is not rolled out,
619
+ // so we need to suppress the new default behavior.
620
+ core . exportVariable ( "CODEQL_EXTRACTOR_PYTHON_EXTRACT_STDLIB" , "true" ) ;
621
+ }
622
+ }
623
+
614
624
const sourceRoot = path . resolve (
615
625
getRequiredEnvParam ( "GITHUB_WORKSPACE" ) ,
616
626
getOptionalInput ( "source-root" ) || "" ,
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export enum ToolsFeature {
10
10
TraceCommandUseBuildMode = "traceCommandUseBuildMode" ,
11
11
SarifMergeRunsFromEqualCategory = "sarifMergeRunsFromEqualCategory" ,
12
12
ForceOverwrite = "forceOverwrite" ,
13
+ PythonDefaultIsToNotExtractStdlib = "pythonDefaultIsToNotExtractStdlib" ,
13
14
}
14
15
15
16
/**
You can’t perform that action at this time.
0 commit comments