Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: In "Pipeleine overridden settings example" was mistake. Should be autoMatch insted allowAutoMatch. Plugin doesn't work with allowAutoMatch

...

Code Block
[access "refs/heads/*"]
    label-Sonar-Verified = -1..+1 group Project Owners
    label-Sonar-Verified = -1..+1 group Non-Interactive Users

 


Credentials

To override the credentials used to post comments on the job level set up section "Override default HTTP credentials". (Global credentials on the Gerrit Trigger Server level should be set up as well for Gerrit Trigger needs.)

 


  1. Override default HTTP credentials? - This setting describes whether it is necessary to override Gerrit credentials from the Gerrit Trigger Server settings or not.
  2. HTTP Username - Username to be used to post review result to Gerrit.
  3. HTTP Password - Password to be used to post review result to Gerrit.
  4. Gerrit Server - The server used to check connection with overridden credentials. The value does not affect plugin settings and only used to verify credentials. 

...

Code Block
	sonarToGerrit (
		inspectionConfig: [
			serverURL: 'http://localhost:9000',
		    baseConfig: [
				projectPath: '',
				sonarReportPath: 'target/sonar/sonar-report.json',
				allowAutoMatchautoMatch: true
			]
			// OR
			//subJobConfigs : [
			//	[
			//		projectPath: 'module0',
			//		sonarReportPath: 'target/sonar/sonar-report.json'
			//	],
			//	[
			//		projectPath: 'module1',
			//		sonarReportPath: 'target/module1/sonar/sonar-report.json'
			//	]
			//]
		],
        reviewConfig: [ 
            issueFilterConfig: [
                severity: 'INFO', 
                newIssuesOnly: false, 
                changedLinesOnly: false
                ], 
            noIssuesTitleTemplate: 'SonarQube violations have not been found.', 
            someIssuesTitleTemplate: '<total_count> SonarQube violations have been found.',
            issueCommentTemplate: '<severity> SonarQube violation:\n\n\n<message>\n\n\nRead more: <rule_url>'
        ],
        scoreConfig: [ 
            issueFilterConfig: [
                severity: 'INFO', 
                newIssuesOnly: false, 
                changedLinesOnly: false
                ], 
            category: 'Code-Review', 
            noIssuesScore: 0,
            issuesScore: -1
        ],
		notificationConfig: [
			noIssuesNotificationRecipient: 'NONE',
			commentedIssuesNotificationRecipient: 'OWNER',
			negativeScoreNotificationRecipient: 'OWNER'
		],
		authConfig: [
			username: 'Jenkins',
			password: 'HTTP Password of user called Jenkins'
		]
    )

 



Known issues:

Jira
serverJenkins JIRA
serverIddd058dce-0c66-3b77-8b09-71b1d7728747
keyJENKINS-43804
 - Overriding Gerrit credentials is unsafe (2.0)

...