The following plugin provides functionality available through
Pipeline-compatible steps. Read more about how to integrate steps into your
Pipeline in the
Steps
section of the
Pipeline Syntax
page.
For a list of other such plugins, see the
Pipeline Steps Reference
page.
Sonar Gerrit Plugin
authConfig
(optional)
Override HTTP credentials specified in Gerrit Trigger settings to be used for review posting
Nested Object
password
(optional)
This field will override the HTTP password from Gerrit Trigger settings and will be used for plugin purposes only.
username
(optional)
This field will override the HTTP username from Gerrit Trigger settings and will be used for plugin purposes only.
category
(optional)
changedLinesOnly
(optional)
httpPassword
(optional)
httpUsername
(optional)
inspectionConfig
(optional)
Configure accordance of SonarQube report(s) and project or module(s) path(s)
Nested Object
autoMatch
(optional)
Allow plugin to match inspection and review system file names automatically (useful for projects with several nested modules)
baseConfig
(optional)
Provides settings for the whole project
Nested Object
autoMatch
(optional)
projectPath
(optional)
Provides module prefix for a file path for multi-module projects
sonarReportPath
(optional)
Path to SonarQube report on Jenkins server. Default value is "target/sonar/sonar-report.json"
serverURL
(optional)
URL of the SonarQube instance used for static code analysis
subJobConfigs
(optional)
Provides separate settings for each module
Array / List of Nested Object
autoMatch
(optional)
projectPath
(optional)
Provides module prefix for a file path for multi-module projects
sonarReportPath
(optional)
Path to SonarQube report on Jenkins server. Default value is "target/sonar/sonar-report.json"
type
(optional)
issueComment
(optional)
issuesNotification
(optional)
issuesScore
(optional)
newIssuesOnly
(optional)
noIssuesNotification
(optional)
noIssuesScore
(optional)
noIssuesToPostText
(optional)
notificationConfig
(optional)
Nested Object
commentedIssuesNotificationRecipient
(optional)
This setting allow to determine who will be notified in case there are several SonarQube issues matching filter settings found in particular commit.
An e-mails sent to recipients will contain review information: title of review and list of comments (issues). Recipient settings:
* None - No one;
* Owner - Owner (i.e. author of the commit);
* Owner and Reviewers - Owner (i.e. author of the commit) and all Reviewers (people who was added to reviewer list of the commit);
* All - everyone in the project list.
negativeScoreNotificationRecipient
(optional)
This setting allow to determine who will be notified in case if the build got a negative score due to issues matching score filter settings are found. An e-mails sent to recipients will contain review information: title of review and list of comments (issues). Recipient settings:
* None - No one;
* Owner - Owner (i.e. author of the commit);
* Owner and Reviewers - Owner (i.e. author of the commit) and all Reviewers (people who was added to reviewer list of the commit);
* All - everyone in the project list.
noIssuesNotificationRecipient
(optional)
This setting allow to determine who will be notified in case there are no SonarQube issues matching filter settings found in particular commit.
An e-mails sent to recipients will contain review information: title of review. Recipient settings:
* None - No one;
* Owner - Owner (i.e. author of the commit);
* Owner and Reviewers - Owner (i.e. author of the commit) and all Reviewers (people who was added to reviewer list of the commit);
* All - everyone in the project list.
overrideCredentials
(optional)
path
(optional)
postScore
(optional)
projectPath
(optional)
reviewConfig
(optional)
Nested Object
issueCommentTemplate
(optional)
This text will appear as comment for a line with SonarQube issue in Gerrit review.
There are some tags available:
* <key> - will be replaced with issue key;
* <component> - will be replaced with issue component info;
* <message> - will be replaced with issue message;
* <severity> - will be replaced with issue severity;
* <rule> - will be replaced with issue rule name;
* <rule_url> - will be replaced with link to rule description on SonarQube if SonarQube URL is provided in SonarQube settings section or rule name if URL is not provided;
* <status> - will be replaced with issue status;
* <creation_date> - will be replaced with issue creation date.
Please note that only filtered by severity level issues and their counts will be shown in report.
issueFilterConfig
(optional)
Issue filter to specify issues to be commented in Gerrit
Nested Object
changedLinesOnly
(optional)
Only changed in current commit lines to be commented by Gerrit when checked. Modified files to be commented with all issues if this control unchecked.
newIssuesOnly
(optional)
Only new SonarQube issues to be commented in Gerrit when checked. Modified files to be commented with all corresponding issues when unchecked.
severity
(optional)
Minimum level of SonarQube severity to be reported to Gerrit.
noIssuesTitleTemplate
(optional)
This text will appear as title of Gerrit review in case when no issues matching filter settings found.
There are some tags available:
* <info_count> - will be replaced with count of issues having INFO severity level;
* <minor_count> - will be replaced with count of issues having MINOR severity level;
* <major_count> - will be replaced with count of issues having MAJOR severity level;
* <critical_count> - will be replaced with count of issues having CRITICAL severity level;
* <blocker_count> - will be replaced with count of issues having BLOCKER severity level;
* <min_minor_count> - will be replaced with count of issues having MINOR severity level or higher;
* <min_major_count> - will be replaced with count of issues having MAJOR severity level or higher;
* <min_critical_count> - will be replaced with count of issues having CRITICAL severity level or higher;
* <total_count> - will be replaced with total count of issues.
Please note that only filtered by severity level issues and their counts will be shown in report.
someIssuesTitleTemplate
(optional)
This text will appear as title of Gerrit review in case when there are several issues matching filter settings found.
There are some tags available:
* <info_count> - will be replaced with count of issues having INFO severity level;
* <minor_count> - will be replaced with count of issues having MINOR severity level;
* <major_count> - will be replaced with count of issues having MAJOR severity level;
* <critical_count> - will be replaced with count of issues having CRITICAL severity level;
* <blocker_count> - will be replaced with count of issues having BLOCKER severity level;
* <min_minor_count> - will be replaced with count of issues having MINOR severity level or higher;
* <min_major_count> - will be replaced with count of issues having MAJOR severity level or higher;
* <min_critical_count> - will be replaced with count of issues having CRITICAL severity level or higher;
* <total_count> - will be replaced with total count of issues.
Please note that only filtered by severity level issues and their counts will be shown in report.
scoreConfig
(optional)
Nested Object
category
(optional)
This field describes under what category score will appear in Gerrit. This category should match one of existent Gerrit categories.
issueFilterConfig
(optional)
Issue filter to specify issues to affect score in Gerrit
Nested Object
changedLinesOnly
(optional)
Only changed in current commit lines to be commented by Gerrit when checked. Modified files to be commented with all issues if this control unchecked.
newIssuesOnly
(optional)
Only new SonarQube issues to be commented in Gerrit when checked. Modified files to be commented with all corresponding issues when unchecked.
severity
(optional)
Minimum level of SonarQube severity to be reported to Gerrit.
issuesScore
(optional)
Score to be posted to Gerrit in case when there are SonarQube violations found
noIssuesScore
(optional)
Score to be posted to Gerrit in case when there are no SonarQube violations found
severity
(optional)
someIssuesToPostText
(optional)
sonarURL
(optional)
subJobConfigs
(optional)
Array / List of Nested Object
autoMatch
(optional)
projectPath
(optional)
Provides module prefix for a file path for multi-module projects
sonarReportPath
(optional)
Path to SonarQube report on Jenkins server. Default value is "target/sonar/sonar-report.json"
Was this page helpful?
Please submit your feedback about this page through this
quick form.
Alternatively, if you don't wish to complete the quick form, you can simply
indicate if you found this page helpful?
See existing feedback here.