Skip to content

Commit 895941f

Browse files
Merge pull request #18 from gitbito/release/1.2.7
Update bito-cra.sh
2 parents 05ab131 + 1527465 commit 895941f

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

cra-scripts/bito-cra.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ git.access_token=
77
git.domain=
88
static_analysis=True
99
static_analysis_tool=fb_infer,astral_ruff,mypy
10+
review_scope=
1011
dependency_check=False
1112
code_context=True
1213
dependency_check.snyk_auth_token=

cra-scripts/bito-cra.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ $optional_params_cli = @(
354354
"review_comments",
355355
"static_analysis",
356356
"static_analysis_tool",
357+
"review_scope",
357358
"dependency_check",
358359
"dependency_check.snyk_auth_token",
359360
"cra_version",
@@ -377,6 +378,7 @@ $optional_params_server = @(
377378
"review_comments",
378379
"static_analysis",
379380
"static_analysis_tool",
381+
"review_scope",
380382
"dependency_check",
381383
"dependency_check.snyk_auth_token",
382384
"server_port",
@@ -452,7 +454,7 @@ foreach ($param in $required_params) {
452454
foreach ($param in $optional_params) {
453455
if ($param -eq "dependency_check.snyk_auth_token" -and $props["dependency_check"] -eq "True") {
454456
Ask-For-Param $param $false
455-
} 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 "git.domain") {
457+
} 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 "git.domain" -and $param -ne "review_scope") {
456458
Ask-For-Param $param $false
457459
}
458460
}
@@ -478,6 +480,9 @@ foreach ($param in $required_params + $bee_params + $optional_params) {
478480
$docker_cmd += " --static_analysis.fb_infer.enabled=$validated_boolean"
479481
} elseif ($param -eq "static_analysis_tool") {
480482
$docker_cmd += " --$param=$($props[$param])"
483+
} elseif ($param -eq "review_scope") {
484+
$scopes = $($props[$param]) -replace ',\s*', ','
485+
$docker_cmd += " --$param='[$scopes]'"
481486
} elseif ($param -eq "dependency_check") {
482487
$validated_boolean = Validate-Boolean $props[$param]
483488
$docker_cmd += " --dependency_check.enabled=$validated_boolean"

cra-scripts/bito-cra.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ optional_params_cli=(
371371
"review_comments"
372372
"static_analysis"
373373
"static_analysis_tool"
374+
"review_scope"
374375
"dependency_check"
375376
"dependency_check.snyk_auth_token"
376377
"cra_version"
@@ -394,6 +395,7 @@ optional_params_server=(
394395
"review_comments"
395396
"static_analysis"
396397
"static_analysis_tool"
398+
"review_scope"
397399
"dependency_check"
398400
"dependency_check.snyk_auth_token"
399401
"server_port"
@@ -463,7 +465,7 @@ done
463465
for param in "${optional_params[@]}"; do
464466
if [ "$param" == "dependency_check.snyk_auth_token" ] && [ "${props["dependency_check"]}" == "True" ]; then
465467
ask_for_param "$param" "False"
466-
elif [ "$param" != "dependency_check.snyk_auth_token" ] && [ "$param" != "env" ] && [ "$param" != "cli_path" ] && [ "$param" != "output_path" ] && [ "$param" != "static_analysis_tool" ] && [ "$param" != "git.domain" ]; then
468+
elif [ "$param" != "dependency_check.snyk_auth_token" ] && [ "$param" != "env" ] && [ "$param" != "cli_path" ] && [ "$param" != "output_path" ] && [ "$param" != "static_analysis_tool" ] && [ "$param" != "git.domain" ] && [ "$param" != "review_scope" ]; then
467469
ask_for_param "$param" "False"
468470
fi
469471
done
@@ -495,6 +497,9 @@ for param in "${required_params[@]}" "${bee_params[@]}" "${optional_params[@]}";
495497
docker_cmd+=" --static_analysis.fb_infer.enabled=${props[$param]}"
496498
elif [ "$param" == "static_analysis_tool" ]; then
497499
docker_cmd+=" --static_analysis_tool=${props[$param]}"
500+
elif [ "$param" == "review_scope" ]; then
501+
scopes=$(echo ${props[$param]} | sed 's/, */,/g')
502+
docker_cmd+=" --review_scope='[$scopes]'"
498503
elif [ "$param" == "dependency_check" ]; then
499504
#validate the dependency check boolean value
500505
props[$param]=$(validate_boolean "${props[$param]}")

0 commit comments

Comments
 (0)