Skip to content

Commit

Permalink
Add support for the code_scanning_codeql_java_lombok feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Lynagh committed Jul 27, 2023
1 parent 6276217 commit 097823f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
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",
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

0 comments on commit 097823f

Please sign in to comment.