Skip to content
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

Added support for linter feedback enable/disable and output path for … #43

Merged
merged 3 commits into from
Nov 7, 2024

Conversation

adhirpotdarbito
Copy link
Collaborator

@adhirpotdarbito adhirpotdarbito commented Nov 7, 2024

Summary by Bito

This PR adds support for enabling/disabling linter feedback and specifying an output path in the CRA tool. It updates configuration properties and scripts to handle new parameters for linter feedback and custom rules. The changes primarily affect the configuration file and PowerShell/shell scripts used to run the CRA.

Unit tests added: False

Estimated effort to review (1-5, lower is better): 2

@BitoAgent
Copy link
Collaborator

Code Review Agent Run Status

  • Limitations and other issues: ❌ Failure - The AI Code Review Agent skipped reviewing this change because it is configured to exclude certain pull requests based on the source/target branch or the pull request status. You can change the settings here, or contact the agent instance creator at [email protected].

@adhirpotdarbito
Copy link
Collaborator Author

/review

@BitoAgent
Copy link
Collaborator

BitoAgent commented Nov 7, 2024

Code Review Agent Run #1c80ad

Actionable Suggestions - 1
  • cra-scripts/bito-cra.ps1 - 1
Review Details
  • Files reviewed - 3 · Commit Range: eed1a0c..eed1a0c
    • cra-scripts/bito-cra.properties
    • cra-scripts/bito-cra.ps1
    • cra-scripts/bito-cra.sh
  • Files skipped - 0

AI Code Review powered by Bito Logo

@BitoAgent
Copy link
Collaborator

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Feature Improvement - Enhanced Configuration Options for Code Review Assistant

bito-cra.properties - Added new configuration options for linters feedback and custom rules

bito-cra.ps1 - Updated script to handle new linters feedback and output path options

bito-cra.sh - Modified shell script to support new linters feedback and output path parameters

@@ -528,7 +532,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 "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") {
} 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 "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") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long condition may affect readability

Consider breaking down the long condition into smaller, more manageable parts. This could improve readability and maintainability. You might consider using an array of parameters to check against or a separate function for parameter validation. A similar issue was also found in cra-scripts/bito-cra.sh (line 543).

Code suggestion
 @@ -535,1 +535,10 @@
 -    } 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 "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 (Is-ValidParam $param) {
 +
 +function Is-ValidParam($param) {
 +    $excludedParams = @("dependency_check.snyk_auth_token", "env", "cli_path", "output_path", "static_analysis_tool", "linters_feedback", "git.domain", "review_scope", "exclude_branches", "exclude_files", "exclude_draft_pr", "cr_event_type", "posting_to_pr", "custom_rules.configured_ws_ids", "custom_rules.aws_access_key_id", "custom_rules.aws_secret_access_key", "custom_rules.region_name", "custom_rules.bucket_name", "custom_rules.aes_key", "code_context_config.partial_timeout", "code_context_config.max_depth", "code_context_config.kill_timeout_sec")
 +    return $excludedParams -notcontains $param
 +}

Code Review Run #1c80ad


Is this a valid issue, or was it incorrectly flagged by the Agent?

  • it was incorrectly flagged

@BitoAgent
Copy link
Collaborator

Code Review Agent Run Status

  • Limitations and other issues: ❌ Failure - The AI Code Review Agent skipped reviewing this change because it is configured to exclude certain pull requests based on the source/target branch or the pull request status. You can change the settings here, or contact the agent instance creator at [email protected].

@BitoAgent
Copy link
Collaborator

Code Review Agent Run Status

  • Limitations and other issues: ❌ Failure - The AI Code Review Agent skipped reviewing this change because it is configured to exclude certain pull requests based on the source/target branch or the pull request status. You can change the settings here, or contact the agent instance creator at [email protected].

@adhirpotdarbito adhirpotdarbito merged commit 227bbdb into main Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants