Skip to content
Merged
Next Next commit
Add support for the code_scanning_codeql_java_lombok feature flag
  • Loading branch information
igfoo committed Jul 27, 2023
commit 097823f389aaef75932401b5aeced66441d909fa
6 changes: 6 additions & 0 deletions src/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export interface FeatureEnablement {
*/
export enum Feature {
CliConfigFileEnabled = "cli_config_file_enabled",
CodeqlJavaLombokEnabled = "codeql_java_lombok_enabled",
DisableKotlinAnalysisEnabled = "disable_kotlin_analysis_enabled",
DisablePythonDependencyInstallationEnabled = "disable_python_dependency_installation_enabled",
ExportDiagnosticsEnabled = "export_diagnostics_enabled",
Expand All @@ -58,6 +59,11 @@ export const featureConfig: Record<
Feature,
{ envVar: string; minimumVersion: string | undefined; defaultValue: boolean }
> = {
[Feature.CodeqlJavaLombokEnabled]: {
envVar: "CODEQL_JAVA_LOMBOK_ENABLED",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with the others environment variable overrides for the feature flag!

Suggested change
envVar: "CODEQL_JAVA_LOMBOK_ENABLED",
envVar: "CODEQL_JAVA_LOMBOK",

minimumVersion: "2.14.0",
defaultValue: false,
},
[Feature.DisableKotlinAnalysisEnabled]: {
envVar: "CODEQL_DISABLE_KOTLIN_ANALYSIS",
minimumVersion: undefined,
Expand Down
8 changes: 8 additions & 0 deletions src/init-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,14 @@ async function run() {
core.exportVariable("CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN", "true");
}

if (await features.getValue(Feature.CodeqlJavaLombokEnabled)) {
logger.info("Enabling CodeQL Java Lombok support");
core.exportVariable("CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS", "true");
} else {
logger.info("Disabling CodeQL Java Lombok support");
core.exportVariable("CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS", "false");
}

// Disable Python dependency extraction if feature flag set
if (
await features.getValue(
Expand Down