From 171d9f352eb76f36fa3c3bc1d1bd88b2c7100dc0 Mon Sep 17 00:00:00 2001 From: Ravi Kumar Jha Date: Wed, 21 May 2025 16:08:36 +0530 Subject: [PATCH 1/3] BITO-8939 Add support for agentic cra flag - add a new property agentic_cra_enabled to run cra in agentic mode if set to True --- cra-scripts/bito-cra.properties | 1 + cra-scripts/bito-cra.ps1 | 6 +++++- cra-scripts/bito-cra.sh | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cra-scripts/bito-cra.properties b/cra-scripts/bito-cra.properties index 842e41d..2f0a1c6 100644 --- a/cra-scripts/bito-cra.properties +++ b/cra-scripts/bito-cra.properties @@ -14,6 +14,7 @@ dependency_check=False code_context=True dependency_check.snyk_auth_token= review_comments=2 +agentic_cra=False server_port=10051 cra_version=latest include_source_branches= diff --git a/cra-scripts/bito-cra.ps1 b/cra-scripts/bito-cra.ps1 index a409b48..1b4707c 100755 --- a/cra-scripts/bito-cra.ps1 +++ b/cra-scripts/bito-cra.ps1 @@ -404,6 +404,7 @@ $required_params_cli = @( ) $optional_params_cli = @( + "agentic_cra_enabled", "acceptable_suggestions_enabled", "review_comments", "static_analysis", @@ -442,6 +443,7 @@ $required_params_server = @( ) $optional_params_server = @( + "agentic_cra_enabled", "acceptable_suggestions_enabled", "git.provider", "git.access_token", @@ -542,7 +544,7 @@ foreach ($param in $required_params) { foreach ($param in $optional_params) { if ($param -eq "dependency_check.snyk_auth_token" -and $props["dependency_check"] -eq "True") { Ask-For-Param $param $false - } elseif ($param -ne "acceptable_suggestions_enabled" -and $param -ne "dependency_check.snyk_auth_token" -and $param -ne "env" -and $param -ne "cli_path" -and $param -ne "output_path" -and $param -ne "static_analysis_tool" -and $param -ne "linters_feedback" -and $param -ne "secret_scanner_feedback" -and $param -ne "enable_default_branch" -and $param -ne "git.domain" -and $param -ne "review_scope" -and $param -ne "exclude_branches" -and $param -ne "include_source_branches" -and $param -ne "include_target_branches" -and $param -ne "exclude_files" -and $param -ne "exclude_draft_pr" -and $param -ne "cr_event_type" -and $param -ne "posting_to_pr" -and $param -ne "custom_rules.configured_ws_ids" -and $param -ne "custom_rules.aws_access_key_id" -and $param -ne "custom_rules.aws_secret_access_key" -and $param -ne "custom_rules.region_name" -and $param -ne "custom_rules.bucket_name" -and $param -ne "custom_rules.aes_key" -and $param -ne "code_context_config.partial_timeout" -and $param -ne "code_context_config.max_depth" -and $param -ne "code_context_config.kill_timeout_sec") { + } elseif ($param -ne "agentic_cra_enabled" -and $param -ne "acceptable_suggestions_enabled" -and $param -ne "dependency_check.snyk_auth_token" -and $param -ne "env" -and $param -ne "cli_path" -and $param -ne "output_path" -and $param -ne "static_analysis_tool" -and $param -ne "linters_feedback" -and $param -ne "secret_scanner_feedback" -and $param -ne "enable_default_branch" -and $param -ne "git.domain" -and $param -ne "review_scope" -and $param -ne "exclude_branches" -and $param -ne "include_source_branches" -and $param -ne "include_target_branches" -and $param -ne "exclude_files" -and $param -ne "exclude_draft_pr" -and $param -ne "cr_event_type" -and $param -ne "posting_to_pr" -and $param -ne "custom_rules.configured_ws_ids" -and $param -ne "custom_rules.aws_access_key_id" -and $param -ne "custom_rules.aws_secret_access_key" -and $param -ne "custom_rules.region_name" -and $param -ne "custom_rules.bucket_name" -and $param -ne "custom_rules.aes_key" -and $param -ne "code_context_config.partial_timeout" -and $param -ne "code_context_config.max_depth" -and $param -ne "code_context_config.kill_timeout_sec") { Ask-For-Param $param $false } } @@ -593,6 +595,8 @@ foreach ($param in $required_params + $bee_params + $optional_params) { $docker_cmd += " --exclude_files='$($props[$param])'" } elseif ($param -eq "exclude_draft_pr") { $docker_cmd += " --exclude_draft_pr=$($props[$param])" + } elseif ($param -eq "agentic_cra_enabled") { + $docker_cmd += " --agentic_cra_enabled=$($props[$param])" } elseif ($param -eq "dependency_check") { $validated_boolean = Validate-Boolean $props[$param] $docker_cmd += " --dependency_check.enabled=$validated_boolean" diff --git a/cra-scripts/bito-cra.sh b/cra-scripts/bito-cra.sh index 053e9bb..3449914 100755 --- a/cra-scripts/bito-cra.sh +++ b/cra-scripts/bito-cra.sh @@ -413,6 +413,7 @@ required_params_cli=( ) optional_params_cli=( + "agentic_cra_enabled" "acceptable_suggestions_enabled" "review_comments" "static_analysis" @@ -455,6 +456,7 @@ optional_params_server=( "git.provider" "git.access_token" "bito_cli.bito.access_key" + "agentic_cra_enabled" "acceptable_suggestions_enabled" "review_comments" "static_analysis" @@ -550,7 +552,7 @@ done for param in "${optional_params[@]}"; do if [ "$param" == "dependency_check.snyk_auth_token" ] && [ "${props["dependency_check"]}" == "True" ]; then ask_for_param "$param" "False" - elif [ "$param" != "acceptable_suggestions_enabled" ] && [ "$param" != "dependency_check.snyk_auth_token" ] && [ "$param" != "env" ] && [ "$param" != "cli_path" ] && [ "$param" != "output_path" ] && [ "$param" != "static_analysis_tool" ] && [ "$param" != "linters_feedback" ] && [ "$param" != "secret_scanner_feedback" ] && [ "$param" != "enable_default_branch" ] && [ "$param" != "git.domain" ] && [ "$param" != "review_scope" ] && [ "$param" != "exclude_branches" ] && [ "$param" != "include_source_branches" ] && [ "$param" != "include_target_branches" ] && [ "$param" != "nexus_url" ] && [ "$param" != "exclude_files" ] && [ "$param" != "exclude_draft_pr" ] && [ "$param" != "cr_event_type" ] && [ "$param" != "posting_to_pr" ] && [ "$param" != "custom_rules.configured_ws_ids" ] && [ "$param" != "custom_rules.aws_access_key_id" ] && [ "$param" != "custom_rules.aws_secret_access_key" ] && [ "$param" != "custom_rules.region_name" ] && [ "$param" != "custom_rules.bucket_name" ] && [ "$param" != "custom_rules.aes_key" ] && [ "$param" != "code_context_config.partial_timeout" ] && [ "$param" != "code_context_config.max_depth" ] && [ "$param" != "code_context_config.kill_timeout_sec" ]; then + elif [ "$param" != "agentic_cra_enabled" ] && "$param" != "acceptable_suggestions_enabled" ] && [ "$param" != "dependency_check.snyk_auth_token" ] && [ "$param" != "env" ] && [ "$param" != "cli_path" ] && [ "$param" != "output_path" ] && [ "$param" != "static_analysis_tool" ] && [ "$param" != "linters_feedback" ] && [ "$param" != "secret_scanner_feedback" ] && [ "$param" != "enable_default_branch" ] && [ "$param" != "git.domain" ] && [ "$param" != "review_scope" ] && [ "$param" != "exclude_branches" ] && [ "$param" != "include_source_branches" ] && [ "$param" != "include_target_branches" ] && [ "$param" != "nexus_url" ] && [ "$param" != "exclude_files" ] && [ "$param" != "exclude_draft_pr" ] && [ "$param" != "cr_event_type" ] && [ "$param" != "posting_to_pr" ] && [ "$param" != "custom_rules.configured_ws_ids" ] && [ "$param" != "custom_rules.aws_access_key_id" ] && [ "$param" != "custom_rules.aws_secret_access_key" ] && [ "$param" != "custom_rules.region_name" ] && [ "$param" != "custom_rules.bucket_name" ] && [ "$param" != "custom_rules.aes_key" ] && [ "$param" != "code_context_config.partial_timeout" ] && [ "$param" != "code_context_config.max_depth" ] && [ "$param" != "code_context_config.kill_timeout_sec" ]; then ask_for_param "$param" "False" fi done @@ -607,6 +609,8 @@ for param in "${required_params[@]}" "${bee_params[@]}" "${optional_params[@]}"; docker_cmd+=" --exclude_files='${props[$param]}'" elif [ "$param" == "exclude_draft_pr" ]; then docker_cmd+=" --exclude_draft_pr=${props[$param]}" + elif [ "$param" == "agentic_cra_enabled" ]; then + docker_cmd+=" --agentic_cra_enabled=${props[$param]}" elif [ "$param" == "dependency_check" ]; then #validate the dependency check boolean value props[$param]=$(validate_boolean "${props[$param]}") From a6386c2045474a91d3a5f0af6bcef0ca6c540caf Mon Sep 17 00:00:00 2001 From: Ravi Kumar Jha Date: Thu, 22 May 2025 19:05:43 +0530 Subject: [PATCH 2/3] fix property name in properties file --- cra-scripts/bito-cra.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cra-scripts/bito-cra.properties b/cra-scripts/bito-cra.properties index 2f0a1c6..c7be392 100644 --- a/cra-scripts/bito-cra.properties +++ b/cra-scripts/bito-cra.properties @@ -14,7 +14,7 @@ dependency_check=False code_context=True dependency_check.snyk_auth_token= review_comments=2 -agentic_cra=False +agentic_cra_enabled=False server_port=10051 cra_version=latest include_source_branches= From 94df3f466a04b73f19a2a1e847ddfa7d5b407588 Mon Sep 17 00:00:00 2001 From: Ravi Kumar Jha Date: Thu, 22 May 2025 20:23:10 +0530 Subject: [PATCH 3/3] fix missing bracket --- cra-scripts/bito-cra.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cra-scripts/bito-cra.sh b/cra-scripts/bito-cra.sh index 3449914..d8fca18 100755 --- a/cra-scripts/bito-cra.sh +++ b/cra-scripts/bito-cra.sh @@ -552,7 +552,7 @@ done for param in "${optional_params[@]}"; do if [ "$param" == "dependency_check.snyk_auth_token" ] && [ "${props["dependency_check"]}" == "True" ]; then ask_for_param "$param" "False" - elif [ "$param" != "agentic_cra_enabled" ] && "$param" != "acceptable_suggestions_enabled" ] && [ "$param" != "dependency_check.snyk_auth_token" ] && [ "$param" != "env" ] && [ "$param" != "cli_path" ] && [ "$param" != "output_path" ] && [ "$param" != "static_analysis_tool" ] && [ "$param" != "linters_feedback" ] && [ "$param" != "secret_scanner_feedback" ] && [ "$param" != "enable_default_branch" ] && [ "$param" != "git.domain" ] && [ "$param" != "review_scope" ] && [ "$param" != "exclude_branches" ] && [ "$param" != "include_source_branches" ] && [ "$param" != "include_target_branches" ] && [ "$param" != "nexus_url" ] && [ "$param" != "exclude_files" ] && [ "$param" != "exclude_draft_pr" ] && [ "$param" != "cr_event_type" ] && [ "$param" != "posting_to_pr" ] && [ "$param" != "custom_rules.configured_ws_ids" ] && [ "$param" != "custom_rules.aws_access_key_id" ] && [ "$param" != "custom_rules.aws_secret_access_key" ] && [ "$param" != "custom_rules.region_name" ] && [ "$param" != "custom_rules.bucket_name" ] && [ "$param" != "custom_rules.aes_key" ] && [ "$param" != "code_context_config.partial_timeout" ] && [ "$param" != "code_context_config.max_depth" ] && [ "$param" != "code_context_config.kill_timeout_sec" ]; then + elif [ "$param" != "agentic_cra_enabled" ] && [ "$param" != "acceptable_suggestions_enabled" ] && [ "$param" != "dependency_check.snyk_auth_token" ] && [ "$param" != "env" ] && [ "$param" != "cli_path" ] && [ "$param" != "output_path" ] && [ "$param" != "static_analysis_tool" ] && [ "$param" != "linters_feedback" ] && [ "$param" != "secret_scanner_feedback" ] && [ "$param" != "enable_default_branch" ] && [ "$param" != "git.domain" ] && [ "$param" != "review_scope" ] && [ "$param" != "exclude_branches" ] && [ "$param" != "include_source_branches" ] && [ "$param" != "include_target_branches" ] && [ "$param" != "nexus_url" ] && [ "$param" != "exclude_files" ] && [ "$param" != "exclude_draft_pr" ] && [ "$param" != "cr_event_type" ] && [ "$param" != "posting_to_pr" ] && [ "$param" != "custom_rules.configured_ws_ids" ] && [ "$param" != "custom_rules.aws_access_key_id" ] && [ "$param" != "custom_rules.aws_secret_access_key" ] && [ "$param" != "custom_rules.region_name" ] && [ "$param" != "custom_rules.bucket_name" ] && [ "$param" != "custom_rules.aes_key" ] && [ "$param" != "code_context_config.partial_timeout" ] && [ "$param" != "code_context_config.max_depth" ] && [ "$param" != "code_context_config.kill_timeout_sec" ]; then ask_for_param "$param" "False" fi done