-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update bito-cra.ps1 - default branch and acceptable suggestions #46
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider refactoring long parameter check condition
The condition check contains a long chain of Code suggestionCheck the AI-generated fix before applying
Code Review Run #9f0e9d Is this a valid issue, or was it incorrectly flagged by the Agent?
|
||
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]}" | ||
Comment on lines
+587
to
+589
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider consolidating boolean parameter handling
Consider consolidating the boolean parameter handling into a helper function to reduce code duplication. The pattern Code suggestionCheck the AI-generated fix before applying
Code Review Run #9f0e9d Is this a valid issue, or was it incorrectly flagged by the Agent?
|
||
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider breaking down the long condition into multiple lines or extracting it into a helper function for better readability. The current line exceeds recommended line length and makes code maintenance difficult.
Code suggestion
Code Review Run #9f0e9d
Is this a valid issue, or was it incorrectly flagged by the Agent?