Skip to content

Commit 171d9f3

Browse files
committed
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
1 parent bae3b3d commit 171d9f3

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

cra-scripts/bito-cra.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dependency_check=False
1414
code_context=True
1515
dependency_check.snyk_auth_token=
1616
review_comments=2
17+
agentic_cra=False
1718
server_port=10051
1819
cra_version=latest
1920
include_source_branches=

cra-scripts/bito-cra.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ $required_params_cli = @(
404404
)
405405

406406
$optional_params_cli = @(
407+
"agentic_cra_enabled",
407408
"acceptable_suggestions_enabled",
408409
"review_comments",
409410
"static_analysis",
@@ -442,6 +443,7 @@ $required_params_server = @(
442443
)
443444

444445
$optional_params_server = @(
446+
"agentic_cra_enabled",
445447
"acceptable_suggestions_enabled",
446448
"git.provider",
447449
"git.access_token",
@@ -542,7 +544,7 @@ foreach ($param in $required_params) {
542544
foreach ($param in $optional_params) {
543545
if ($param -eq "dependency_check.snyk_auth_token" -and $props["dependency_check"] -eq "True") {
544546
Ask-For-Param $param $false
545-
} 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") {
547+
} 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") {
546548
Ask-For-Param $param $false
547549
}
548550
}
@@ -593,6 +595,8 @@ foreach ($param in $required_params + $bee_params + $optional_params) {
593595
$docker_cmd += " --exclude_files='$($props[$param])'"
594596
} elseif ($param -eq "exclude_draft_pr") {
595597
$docker_cmd += " --exclude_draft_pr=$($props[$param])"
598+
} elseif ($param -eq "agentic_cra_enabled") {
599+
$docker_cmd += " --agentic_cra_enabled=$($props[$param])"
596600
} elseif ($param -eq "dependency_check") {
597601
$validated_boolean = Validate-Boolean $props[$param]
598602
$docker_cmd += " --dependency_check.enabled=$validated_boolean"

cra-scripts/bito-cra.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ required_params_cli=(
413413
)
414414

415415
optional_params_cli=(
416+
"agentic_cra_enabled"
416417
"acceptable_suggestions_enabled"
417418
"review_comments"
418419
"static_analysis"
@@ -455,6 +456,7 @@ optional_params_server=(
455456
"git.provider"
456457
"git.access_token"
457458
"bito_cli.bito.access_key"
459+
"agentic_cra_enabled"
458460
"acceptable_suggestions_enabled"
459461
"review_comments"
460462
"static_analysis"
@@ -550,7 +552,7 @@ done
550552
for param in "${optional_params[@]}"; do
551553
if [ "$param" == "dependency_check.snyk_auth_token" ] && [ "${props["dependency_check"]}" == "True" ]; then
552554
ask_for_param "$param" "False"
553-
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
555+
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
554556
ask_for_param "$param" "False"
555557
fi
556558
done
@@ -607,6 +609,8 @@ for param in "${required_params[@]}" "${bee_params[@]}" "${optional_params[@]}";
607609
docker_cmd+=" --exclude_files='${props[$param]}'"
608610
elif [ "$param" == "exclude_draft_pr" ]; then
609611
docker_cmd+=" --exclude_draft_pr=${props[$param]}"
612+
elif [ "$param" == "agentic_cra_enabled" ]; then
613+
docker_cmd+=" --agentic_cra_enabled=${props[$param]}"
610614
elif [ "$param" == "dependency_check" ]; then
611615
#validate the dependency check boolean value
612616
props[$param]=$(validate_boolean "${props[$param]}")

0 commit comments

Comments
 (0)