From 5787cf9322e13a8337b487891c32ba3b2913527b Mon Sep 17 00:00:00 2001 From: rishabhbohra-bito <157113574+rishabhbohra-bito@users.noreply.github.com> Date: Wed, 11 Dec 2024 18:23:47 +0530 Subject: [PATCH 1/2] Update bito-cra.ps1 - default branch and acceptable suggestions --- cra-scripts/bito-cra.ps1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cra-scripts/bito-cra.ps1 b/cra-scripts/bito-cra.ps1 index 0f90aea..4361749 100755 --- a/cra-scripts/bito-cra.ps1 +++ b/cra-scripts/bito-cra.ps1 @@ -404,12 +404,14 @@ $required_params_cli = @( ) $optional_params_cli = @( + "acceptable_suggestions_enabled", "review_comments", "static_analysis", "static_analysis_tool", "linters_feedback", "secret_scanner_feedback", "review_scope", + "enable_default_branch", "exclude_branches", "exclude_files", "exclude_draft_pr", @@ -438,6 +440,7 @@ $required_params_server = @( ) $optional_params_server = @( + "acceptable_suggestions_enabled", "git.provider", "git.access_token", "bito_cli.bito.access_key", @@ -447,6 +450,7 @@ $optional_params_server = @( "linters_feedback", "secret_scanner_feedback", "review_scope", + "enable_default_branch", "exclude_branches", "exclude_files", "exclude_draft_pr", @@ -534,7 +538,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 "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 "git.domain" -and $param -ne "review_scope" -and $param -ne "exclude_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 "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 "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 } } @@ -566,9 +570,15 @@ foreach ($param in $required_params + $bee_params + $optional_params) { } elseif ($param -eq "secret_scanner_feedback") { $validated_boolean = Validate-Boolean $props[$param] $docker_cmd += " --$param=$validated_boolean" + } elseif ($param -eq "acceptable_suggestions_enabled") { + $validated_boolean = Validate-Boolean $props[$param] + $docker_cmd += " --$param=$validated_boolean" } elseif ($param -eq "review_scope") { $scopes = $($props[$param]) -replace ',\s*', ',' $docker_cmd += " --$param='[$scopes]'" + } elseif ($param -eq "enable_default_branch") { + $validated_boolean = Validate-Boolean $props[$param] + $docker_cmd += " --$param=$validated_boolean" } elseif ($param -eq "exclude_branches") { $docker_cmd += " --exclude_branches='$($props[$param])'" } elseif ($param -eq "exclude_files") { From 35a47238641d8d8d9f5188ab71db08d5d7c96987 Mon Sep 17 00:00:00 2001 From: rishabhbohra-bito <157113574+rishabhbohra-bito@users.noreply.github.com> Date: Wed, 11 Dec 2024 18:25:42 +0530 Subject: [PATCH 2/2] Update bito-cra.sh --- cra-scripts/bito-cra.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cra-scripts/bito-cra.sh b/cra-scripts/bito-cra.sh index 60eedd5..539fb6d 100755 --- a/cra-scripts/bito-cra.sh +++ b/cra-scripts/bito-cra.sh @@ -413,12 +413,14 @@ required_params_cli=( ) optional_params_cli=( + "acceptable_suggestions_enabled" "review_comments" "static_analysis" "static_analysis_tool" "linters_feedback" "secret_scanner_feedback" "review_scope" + "enable_default_branch" "exclude_branches" "exclude_files" "exclude_draft_pr" @@ -451,12 +453,14 @@ optional_params_server=( "git.provider" "git.access_token" "bito_cli.bito.access_key" + "acceptable_suggestions_enabled" "review_comments" "static_analysis" "static_analysis_tool" "linters_feedback" "secret_scanner_feedback" "review_scope" + "enable_default_branch" "exclude_branches" "exclude_files" "exclude_draft_pr" @@ -542,7 +546,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" != "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" != "git.domain" ] && [ "$param" != "review_scope" ] && [ "$param" != "exclude_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" != "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" != "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 @@ -580,9 +584,15 @@ for param in "${required_params[@]}" "${bee_params[@]}" "${optional_params[@]}"; elif [ "$param" == "secret_scanner_feedback" ]; then props[$param]=$(validate_boolean "${props[$param]}") docker_cmd+=" --secret_scanner_feedback=${props[$param]}" + elif [ "$param" == "acceptable_suggestions_enabled" ]; then + props[$param]=$(validate_boolean "${props[$param]}") + docker_cmd+=" --acceptable_suggestions_enabled=${props[$param]}" elif [ "$param" == "review_scope" ]; then scopes=$(echo ${props[$param]} | sed 's/, */,/g') docker_cmd+=" --review_scope='[$scopes]'" + elif [ "$param" == "enable_default_branch" ]; then + props[$param]=$(validate_boolean "${props[$param]}") + docker_cmd+=" --enable_default_branch=${props[$param]}" elif [ "$param" == "exclude_branches" ]; then docker_cmd+=" --exclude_branches='${props[$param]}'" elif [ "$param" == "exclude_files" ]; then