Skip to content

Commit b1f7a90

Browse files
Merge pull request #46 from gitbito/release/1.7.2
Update bito-cra.ps1 - default branch and acceptable suggestions
2 parents 532c3e2 + 35a4723 commit b1f7a90

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

cra-scripts/bito-cra.ps1

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

406406
$optional_params_cli = @(
407+
"acceptable_suggestions_enabled",
407408
"review_comments",
408409
"static_analysis",
409410
"static_analysis_tool",
410411
"linters_feedback",
411412
"secret_scanner_feedback",
412413
"review_scope",
414+
"enable_default_branch",
413415
"exclude_branches",
414416
"exclude_files",
415417
"exclude_draft_pr",
@@ -438,6 +440,7 @@ $required_params_server = @(
438440
)
439441

440442
$optional_params_server = @(
443+
"acceptable_suggestions_enabled",
441444
"git.provider",
442445
"git.access_token",
443446
"bito_cli.bito.access_key",
@@ -447,6 +450,7 @@ $optional_params_server = @(
447450
"linters_feedback",
448451
"secret_scanner_feedback",
449452
"review_scope",
453+
"enable_default_branch",
450454
"exclude_branches",
451455
"exclude_files",
452456
"exclude_draft_pr",
@@ -534,7 +538,7 @@ foreach ($param in $required_params) {
534538
foreach ($param in $optional_params) {
535539
if ($param -eq "dependency_check.snyk_auth_token" -and $props["dependency_check"] -eq "True") {
536540
Ask-For-Param $param $false
537-
} 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") {
541+
} 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") {
538542
Ask-For-Param $param $false
539543
}
540544
}
@@ -566,9 +570,15 @@ foreach ($param in $required_params + $bee_params + $optional_params) {
566570
} elseif ($param -eq "secret_scanner_feedback") {
567571
$validated_boolean = Validate-Boolean $props[$param]
568572
$docker_cmd += " --$param=$validated_boolean"
573+
} elseif ($param -eq "acceptable_suggestions_enabled") {
574+
$validated_boolean = Validate-Boolean $props[$param]
575+
$docker_cmd += " --$param=$validated_boolean"
569576
} elseif ($param -eq "review_scope") {
570577
$scopes = $($props[$param]) -replace ',\s*', ','
571578
$docker_cmd += " --$param='[$scopes]'"
579+
} elseif ($param -eq "enable_default_branch") {
580+
$validated_boolean = Validate-Boolean $props[$param]
581+
$docker_cmd += " --$param=$validated_boolean"
572582
} elseif ($param -eq "exclude_branches") {
573583
$docker_cmd += " --exclude_branches='$($props[$param])'"
574584
} elseif ($param -eq "exclude_files") {

cra-scripts/bito-cra.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,12 +413,14 @@ required_params_cli=(
413413
)
414414

415415
optional_params_cli=(
416+
"acceptable_suggestions_enabled"
416417
"review_comments"
417418
"static_analysis"
418419
"static_analysis_tool"
419420
"linters_feedback"
420421
"secret_scanner_feedback"
421422
"review_scope"
423+
"enable_default_branch"
422424
"exclude_branches"
423425
"exclude_files"
424426
"exclude_draft_pr"
@@ -451,12 +453,14 @@ optional_params_server=(
451453
"git.provider"
452454
"git.access_token"
453455
"bito_cli.bito.access_key"
456+
"acceptable_suggestions_enabled"
454457
"review_comments"
455458
"static_analysis"
456459
"static_analysis_tool"
457460
"linters_feedback"
458461
"secret_scanner_feedback"
459462
"review_scope"
463+
"enable_default_branch"
460464
"exclude_branches"
461465
"exclude_files"
462466
"exclude_draft_pr"
@@ -542,7 +546,7 @@ done
542546
for param in "${optional_params[@]}"; do
543547
if [ "$param" == "dependency_check.snyk_auth_token" ] && [ "${props["dependency_check"]}" == "True" ]; then
544548
ask_for_param "$param" "False"
545-
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
549+
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
546550
ask_for_param "$param" "False"
547551
fi
548552
done
@@ -580,9 +584,15 @@ for param in "${required_params[@]}" "${bee_params[@]}" "${optional_params[@]}";
580584
elif [ "$param" == "secret_scanner_feedback" ]; then
581585
props[$param]=$(validate_boolean "${props[$param]}")
582586
docker_cmd+=" --secret_scanner_feedback=${props[$param]}"
587+
elif [ "$param" == "acceptable_suggestions_enabled" ]; then
588+
props[$param]=$(validate_boolean "${props[$param]}")
589+
docker_cmd+=" --acceptable_suggestions_enabled=${props[$param]}"
583590
elif [ "$param" == "review_scope" ]; then
584591
scopes=$(echo ${props[$param]} | sed 's/, */,/g')
585592
docker_cmd+=" --review_scope='[$scopes]'"
593+
elif [ "$param" == "enable_default_branch" ]; then
594+
props[$param]=$(validate_boolean "${props[$param]}")
595+
docker_cmd+=" --enable_default_branch=${props[$param]}"
586596
elif [ "$param" == "exclude_branches" ]; then
587597
docker_cmd+=" --exclude_branches='${props[$param]}'"
588598
elif [ "$param" == "exclude_files" ]; then

0 commit comments

Comments
 (0)