Use feature flag to enable evaluator intra-layer parallelism

This commit is contained in:
Nick Rolfe
2023-07-31 09:44:35 +01:00
parent 81ae676e79
commit bc068d74aa
9 changed files with 33 additions and 6 deletions

View File

@@ -487,6 +487,7 @@ export async function runQueries(
querySuitePath,
queryFlags,
optimizeForLastQueryRun,
features,
);
logger.debug(`BQRS results produced for ${language} (queries: ${type})"`);
@@ -521,6 +522,7 @@ export async function runQueries(
querySuitePath,
queryFlags,
optimizeForLastQueryRun,
features,
);
return querySuitePath;

View File

@@ -160,6 +160,7 @@ export interface CodeQL {
querySuitePath: string | undefined,
flags: string[],
optimizeForLastQueryRun: boolean,
features: FeatureEnablement,
): Promise<void>;
/**
* Run 'codeql database interpret-results'.
@@ -756,6 +757,7 @@ export async function getCodeQLForCmd(
querySuitePath: string | undefined,
flags: string[],
optimizeForLastQueryRun: boolean,
features: FeatureEnablement,
): Promise<void> {
const codeqlArgs = [
"database",
@@ -778,6 +780,14 @@ export async function getCodeQLForCmd(
if (querySuitePath) {
codeqlArgs.push(querySuitePath);
}
if (
await features.getValue(
Feature.EvaluatorIntraLayerParallelismEnabled,
this,
)
) {
codeqlArgs.push("--intra-layer-parallelism");
}
await runTool(cmd, codeqlArgs);
},
async databaseInterpretResults(

View File

@@ -46,6 +46,7 @@ export enum Feature {
CliConfigFileEnabled = "cli_config_file_enabled",
DisableKotlinAnalysisEnabled = "disable_kotlin_analysis_enabled",
DisablePythonDependencyInstallationEnabled = "disable_python_dependency_installation_enabled",
EvaluatorIntraLayerParallelismEnabled = "evaluator_intra_layer_parallelism_enabled",
ExportDiagnosticsEnabled = "export_diagnostics_enabled",
MlPoweredQueriesEnabled = "ml_powered_queries_enabled",
NewAnalysisSummaryEnabled = "new_analysis_summary_enabled",
@@ -68,6 +69,11 @@ export const featureConfig: Record<
minimumVersion: "2.11.6",
defaultValue: true,
},
[Feature.EvaluatorIntraLayerParallelismEnabled]: {
envVar: "CODEQL_EVALUATOR_INTRA_LAYER_PARALLELISM",
minimumVersion: "2.14.0",
defaultValue: false,
},
[Feature.ExportDiagnosticsEnabled]: {
envVar: "CODEQL_ACTION_EXPORT_DIAGNOSTICS",
minimumVersion: "2.12.4",