Skip to content

Commit bae3b3d

Browse files
Merge pull request #51 from gitbito/release/2.2.3
Update bito-cra.properties and .sh & .ps1 script to support include-source and include-target branches as 2 separate configuration parameters.
2 parents b0d8855 + 9c6f34f commit bae3b3d

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

cra-scripts/bito-cra.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dependency_check.snyk_auth_token=
1616
review_comments=2
1717
server_port=10051
1818
cra_version=latest
19-
include_branches=
19+
include_source_branches=
20+
include_target_branches=
2021
exclude_files=*.xml,*.json,*.properties,.gitignore,*.yml,*.md
2122
exclude_draft_pr=True

cra-scripts/bito-cra.ps1

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,8 @@ $optional_params_cli = @(
413413
"review_scope",
414414
"enable_default_branch",
415415
"exclude_branches",
416-
"include_branches",
416+
"include_source_branches",
417+
"include_target_branches",
417418
"exclude_files",
418419
"exclude_draft_pr",
419420
"dependency_check",
@@ -453,7 +454,8 @@ $optional_params_server = @(
453454
"review_scope",
454455
"enable_default_branch",
455456
"exclude_branches",
456-
"include_branches",
457+
"include_source_branches",
458+
"include_target_branches",
457459
"exclude_files",
458460
"exclude_draft_pr",
459461
"dependency_check",
@@ -540,7 +542,7 @@ foreach ($param in $required_params) {
540542
foreach ($param in $optional_params) {
541543
if ($param -eq "dependency_check.snyk_auth_token" -and $props["dependency_check"] -eq "True") {
542544
Ask-For-Param $param $false
543-
} 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_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") {
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") {
544546
Ask-For-Param $param $false
545547
}
546548
}
@@ -583,8 +585,10 @@ foreach ($param in $required_params + $bee_params + $optional_params) {
583585
$docker_cmd += " --$param=$validated_boolean"
584586
} elseif ($param -eq "exclude_branches") {
585587
$docker_cmd += " --exclude_branches='$($props[$param])'"
586-
} elseif ($param -eq "include_branches") {
587-
$docker_cmd += " --include_branches='$($props[$param])'"
588+
} elseif ($param -eq "include_source_branches") {
589+
$docker_cmd += " --include_source_branches='$($props[$param])'"
590+
} elseif ($param -eq "include_target_branches") {
591+
$docker_cmd += " --include_target_branches='$($props[$param])'"
588592
} elseif ($param -eq "exclude_files") {
589593
$docker_cmd += " --exclude_files='$($props[$param])'"
590594
} elseif ($param -eq "exclude_draft_pr") {

cra-scripts/bito-cra.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,8 @@ optional_params_cli=(
422422
"review_scope"
423423
"enable_default_branch"
424424
"exclude_branches"
425-
"include_branches"
425+
"include_source_branches"
426+
"include_target_branches"
426427
"exclude_files"
427428
"exclude_draft_pr"
428429
"dependency_check"
@@ -463,7 +464,8 @@ optional_params_server=(
463464
"review_scope"
464465
"enable_default_branch"
465466
"exclude_branches"
466-
"include_branches"
467+
"include_source_branches"
468+
"include_target_branches"
467469
"exclude_files"
468470
"exclude_draft_pr"
469471
"dependency_check"
@@ -548,7 +550,7 @@ done
548550
for param in "${optional_params[@]}"; do
549551
if [ "$param" == "dependency_check.snyk_auth_token" ] && [ "${props["dependency_check"]}" == "True" ]; then
550552
ask_for_param "$param" "False"
551-
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_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
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
552554
ask_for_param "$param" "False"
553555
fi
554556
done
@@ -597,8 +599,10 @@ for param in "${required_params[@]}" "${bee_params[@]}" "${optional_params[@]}";
597599
docker_cmd+=" --enable_default_branch=${props[$param]}"
598600
elif [ "$param" == "exclude_branches" ]; then
599601
docker_cmd+=" --exclude_branches='${props[$param]}'"
600-
elif [ "$param" == "include_branches" ]; then
601-
docker_cmd+=" --include_branches='${props[$param]}'"
602+
elif [ "$param" == "include_source_branches" ]; then
603+
docker_cmd+=" --include_source_branches='${props[$param]}'"
604+
elif [ "$param" == "include_target_branches" ]; then
605+
docker_cmd+=" --include_target_branches='${props[$param]}'"
602606
elif [ "$param" == "exclude_files" ]; then
603607
docker_cmd+=" --exclude_files='${props[$param]}'"
604608
elif [ "$param" == "exclude_draft_pr" ]; then

0 commit comments

Comments
 (0)