Skip to content

Conversation

@rupinSec
Copy link
Contributor

@rupinSec rupinSec commented Jun 17, 2025

Fixes https://github.com/devtron-labs/devops-sprint/issues/1786
Sonarqube v2 plugin with multi branch support

Summary by Bito

This pull request introduces a new Sonarqube plugin version with multi-branch scanning capabilities. It includes SQL migration scripts for upgrading and downgrading the plugin, adds new plugin entries, updates metadata, and configures environment-dependent settings to streamline deployment and management of Sonarqube v2.
@Shivam-nagar23
Copy link
Member

/review

@bito-code-review
Copy link

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
New Feature - New Sonarqube Plugin Enhancements

33703800_sonarqube_plugin_v2.down.sql - Removes legacy Sonarqube plugin records and resets metadata to prepare for the new plugin version.

33703800_sonarqube_plugin_v2.up.sql - Introduces new SQL migration scripts that add the Sonarqube v2 plugin with multi branch support, updating multiple tables including plugin metadata, pipeline scripts, and step variables.

Copy link

@bito-code-review bito-code-review bot left a comment

Choose a reason for hiding this comment

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

Code Review Agent Run #cdffed

Actionable Suggestions - 2
  • scripts/sql/33703800_sonarqube_plugin_v2.up.sql - 2
    • Incorrect sed syntax causes parsing error · Line 70-71
    • Missing exit code indicates wrong status · Line 108-108
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • scripts/sql/33703800_sonarqube_plugin_v2.down.sql - 1
    • Incorrect rollback logic for plugin metadata · Line 6-6
  • scripts/sql/33703800_sonarqube_plugin_v2.up.sql - 1
Review Details
  • Files reviewed - 2 · Commit Range: 10bb708..f9b84ee
    • scripts/sql/33703800_sonarqube_plugin_v2.down.sql
    • scripts/sql/33703800_sonarqube_plugin_v2.up.sql
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at shivam@devtron.ai.

Documentation & Help

AI Code Review powered by Bito Logo

Comment on lines +70 to +71
repo_name=$(echo "$data" | sed -n ''1p'')
branch_name=$(echo "$data" | sed -n ''3p'')

Choose a reason for hiding this comment

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

Incorrect sed syntax causes parsing error

Incorrect sed syntax: sed -n ''1p'' uses double quotes around single quotes which will cause parsing errors. Fix by using proper single quotes: sed -n '1p'.

Code suggestion
Check the AI-generated fix before applying
Suggested change
repo_name=$(echo "$data" | sed -n ''1p'')
branch_name=$(echo "$data" | sed -n ''3p'')
repo_name=$(echo "$data" | sed -n '1p')
branch_name=$(echo "$data" | sed -n '3p')

Code Review Run #cdffed


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them
then
echo "********* SonarQube Policy Violated *********"
echo "********* Exiting Build *********"
exit

Choose a reason for hiding this comment

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

Missing exit code indicates wrong status

Missing exit code: exit without a code defaults to 0 (success) when policy check fails. This will incorrectly indicate success when the pipeline should fail. Add exit 1 to properly indicate failure.

Code suggestion
Check the AI-generated fix before applying
Suggested change
exit
exit 1

Code Review Run #cdffed


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants