@@ -69,6 +69,16 @@ validate_boolean() {
69
69
fi
70
70
}
71
71
72
+ # Function to validate suggestion mode
73
+ validate_suggestion_mode () {
74
+ local suggestion_mode=" $( echo " $1 " | awk ' {print tolower($0)}' ) "
75
+ if [ " $suggestion_mode " == " comprehensive" ]; then
76
+ echo " comprehensive"
77
+ else
78
+ echo " essential"
79
+ fi
80
+ }
81
+
72
82
# Function to validate a mode value i.e. cli or server
73
83
validate_mode () {
74
84
local mode_val=" $1 "
@@ -424,6 +434,9 @@ optional_params_cli=(
424
434
" exclude_branches"
425
435
" include_source_branches"
426
436
" include_target_branches"
437
+ " post_as_request_changes"
438
+ " suggestion_mode"
439
+ " locale"
427
440
" exclude_files"
428
441
" exclude_draft_pr"
429
442
" dependency_check"
@@ -443,6 +456,7 @@ optional_params_cli=(
443
456
" custom_rules.region_name"
444
457
" custom_rules.bucket_name"
445
458
" custom_rules.aes_key"
459
+ " support_email"
446
460
)
447
461
448
462
# Parameters that are required/optional in mode server
@@ -466,6 +480,9 @@ optional_params_server=(
466
480
" exclude_branches"
467
481
" include_source_branches"
468
482
" include_target_branches"
483
+ " post_as_request_changes"
484
+ " suggestion_mode"
485
+ " locale"
469
486
" exclude_files"
470
487
" exclude_draft_pr"
471
488
" dependency_check"
@@ -485,6 +502,7 @@ optional_params_server=(
485
502
" custom_rules.bucket_name"
486
503
" custom_rules.aes_key"
487
504
" output_path"
505
+ " support_email"
488
506
)
489
507
490
508
bee_params=(
550
568
for param in " ${optional_params[@]} " ; do
551
569
if [ " $param " == " dependency_check.snyk_auth_token" ] && [ " ${props["dependency_check"]} " == " True" ]; then
552
570
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
571
+ 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" != "suggestion_mode" ] && [ "$param" != "locale" ] && [ "$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" ] && [ "$param" != "post_as_request_changes" ] && [ "$param" != "support_email" ]; then
554
572
ask_for_param " $param " " False"
555
573
fi
556
574
done
@@ -585,6 +603,9 @@ for param in "${required_params[@]}" "${bee_params[@]}" "${optional_params[@]}";
585
603
elif [ " $param " == " linters_feedback" ]; then
586
604
props[$param ]=$( validate_boolean " ${props[$param]} " )
587
605
docker_cmd+=" --linters_feedback=${props[$param]} "
606
+ elif [ " $param " == " post_as_request_changes" ]; then
607
+ props[$param ]=$( validate_boolean " ${props[$param]} " )
608
+ docker_cmd+=" --post_as_request_changes=${props[$param]} "
588
609
elif [ " $param " == " secret_scanner_feedback" ]; then
589
610
props[$param ]=$( validate_boolean " ${props[$param]} " )
590
611
docker_cmd+=" --secret_scanner_feedback=${props[$param]} "
@@ -603,6 +624,11 @@ for param in "${required_params[@]}" "${bee_params[@]}" "${optional_params[@]}";
603
624
docker_cmd+=" --include_source_branches='${props[$param]} '"
604
625
elif [ " $param " == " include_target_branches" ]; then
605
626
docker_cmd+=" --include_target_branches='${props[$param]} '"
627
+ elif [ " $param " == " suggestion_mode" ]; then
628
+ props[$param ]=$( validate_suggestion_mode " ${props[$param]} " )
629
+ docker_cmd+=" --suggestion_mode='${props[$param]} '"
630
+ elif [ " $param " == " locale" ]; then
631
+ docker_cmd+=" --locale='${props[$param]} '"
606
632
elif [ " $param " == " exclude_files" ]; then
607
633
docker_cmd+=" --exclude_files='${props[$param]} '"
608
634
elif [ " $param " == " exclude_draft_pr" ]; then
@@ -655,6 +681,8 @@ for param in "${required_params[@]}" "${bee_params[@]}" "${optional_params[@]}";
655
681
validate_cr_event_type " ${props[$param]} "
656
682
elif [ " $param " == " posting_to_pr" ]; then
657
683
validate_posting_to_pr " ${props[$param]} "
684
+ elif [ " $param " == " support_email" ]; then
685
+ docker_cmd+=" --support_email='${props[$param]} '"
658
686
else
659
687
docker_cmd+=" --$param =${props[$param]} "
660
688
fi
0 commit comments