Skip to content

Commit

Permalink
JENKINS-48808 - allow path auto-match: ui fixes
Browse files Browse the repository at this point in the history
Change-Id: I8bf541ff14dbf6400edcf7c18fb4db784b4dccbb
  • Loading branch information
aquarellian committed Jan 4, 2018
1 parent f861463 commit c711c24
Show file tree
Hide file tree
Showing 30 changed files with 84 additions and 56 deletions.
Expand Up @@ -15,6 +15,8 @@
import java.io.IOException;
import java.util.List;

import static org.jenkinsci.plugins.sonargerrit.util.Localization.getLocalized;

/**
* Project: Sonar-Gerrit Plugin
* Author: Tatiana Didik
Expand Down Expand Up @@ -59,16 +61,16 @@ public FormValidation doTestConnection(@QueryParameter("username") final String

IGerritHudsonTriggerConfig gerritConfig = GerritManagement.getConfig(serverName);
if (gerritConfig == null) {
return FormValidation.error("jenkins.plugin.error.gerrit.config.empty");
return FormValidation.error(getLocalized("jenkins.plugin.error.gerrit.config.empty"));
}

if (!gerritConfig.isUseRestApi()) {
return FormValidation.error("jenkins.plugin.error.gerrit.restapi.off");
return FormValidation.error(getLocalized("jenkins.plugin.error.gerrit.restapi.off"));
}

GerritServer server = PluginImpl.getServer_(serverName);
if (server == null) {
return FormValidation.error("jenkins.plugin.error.gerrit.server.empty");
return FormValidation.error(getLocalized("jenkins.plugin.error.gerrit.server.empty"));
}
return server.getDescriptor().doTestRestConnection(gerritConfig.getGerritFrontEndUrl(), username, password/*, gerritConfig.isUseRestApi()*/);

Expand Down
Expand Up @@ -5,9 +5,9 @@
<f:property title="${%jenkins.plugin.settings.inspection.settings}" field="inspectionConfig"/>
</f:section>

<f:advanced>
<f:advanced title="${%jenkins.plugin.settings.gerrit}">

<f:section title="${%jenkins.plugin.settings.gerrit}">
<!--<f:section title="${%jenkins.plugin.settings.gerrit}">-->

<f:section title="${%jenkins.plugin.settings.gerrit.credentials}">
<f:optionalProperty title="${%jenkins.plugin.settings.gerrit.credentials}" field="authConfig"/>
Expand All @@ -25,6 +25,6 @@
<f:property title="${%jenkins.plugin.settings.gerrit.notification.settings}"
field="notificationConfig"/>
</f:section>
</f:section>
<!--</f:section>-->
</f:advanced>
</j:jelly>
@@ -0,0 +1,3 @@
<div>
<b>Override</b> HTTP credentials specified in Gerrit Trigger settings to be used for review posting
</div>
@@ -0,0 +1,3 @@
<div>
Configure accordance of SonarQube report(s) and project or module(s) path(s)
</div>
@@ -0,0 +1,3 @@
<div>
Issues filter and review templates for Gerrit review
</div>
@@ -0,0 +1,3 @@
<div>
Gerrit score configuration and separate issue filter
</div>
Expand Up @@ -11,7 +11,7 @@
</f:entry>

<j:set var="servers" value="${descriptor.getGerritServerNames()}"/>
<f:entry title="${%jenkins.plugin.settings.gerrit.credentials.server}">
<f:entry title="${%jenkins.plugin.settings.gerrit.credentials.server}" help="/help-serverName.html">
<select name="serverName">
<j:forEach var="inst" items="${servers}">
<f:option>${inst}</f:option>
Expand Down
Expand Up @@ -4,12 +4,6 @@
<f:textbox default="${descriptor.SONAR_URL}" placeholder="${descriptor.SONAR_URL}"/>
</f:entry>

${instance}
${instance.baseConfig.autoMatch}
${baseConfig.autoMatch}
${baseConfig.autoMatch == null}
${baseConfig}
${baseConfig == null}
<f:radioBlock name="type"
title="${%jenkins.plugin.settings.inspection.base.config}"
value="${descriptor.BASE_TYPE}"
Expand Down
@@ -0,0 +1,4 @@
<div>
Allow plugin to match inspection and review system file names automatically
(useful for projects with several nested modules)
</div>
@@ -0,0 +1,3 @@
<div>
Provides settings for the whole project
</div>
@@ -0,0 +1,3 @@
<div>
URL of the SonarQube instance used for static code analysis
</div>

This file was deleted.

@@ -0,0 +1,3 @@
<div>
Provides separate settings for each module
</div>
@@ -1,7 +1,7 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">

<f:entry title="${%jenkins.plugin.settings.gerrit.filter.severity}">
<f:entry title="${%jenkins.plugin.settings.gerrit.filter.severity}" field="severity">
<select name="severity" field="severity" value="${instance.severity}" default="${descriptor.SEVERITY}">
<f:option value="INFO" selected="${instance.severity == 'INFO'}">
${%INFO}
Expand Down Expand Up @@ -32,6 +32,6 @@
field="changedLinesOnly"
value="${changedLinesOnly}"
description="${%jenkins.plugin.settings.gerrit.filter.lines.changed.description}">
<f:checkbox default="descriptor.CHANGED_LINES_ONLY"/>
<f:checkbox selected="${changedLinesOnly}" default="descriptor.CHANGED_LINES_ONLY"/>
</f:entry>
</j:jelly>
@@ -1,4 +1,4 @@
<div>
Check if you want only <b>changed in current commit</b> lines to be commented by Gerrit.
If you want modified files to be commented with <b>all issues</b> leave this control unchecked.
Only <b>changed in current commit</b> lines to be commented by Gerrit when checked.
Modified files to be commented with <b>all issues</b> if this control unchecked.
</div>
@@ -1,4 +1,4 @@
<div>
Check if you want only <b>new</b> SonarQube issues to be commented in Gerrit.
If you want modified files to be commented with <b>all</b> corresponding issues leave this control unchecked.
Only <b>new</b> SonarQube issues to be commented in Gerrit when checked.
Modified files to be commented with <b>all</b> corresponding issues when unchecked.
</div>
Expand Up @@ -3,27 +3,26 @@

<f:property
title="${%jenkins.plugin.settings.gerrit.review.filter}"
field="issueFilterConfig" />
field="issueFilterConfig"/>

<f:entry title="${%jenkins.plugin.settings.gerrit.review.template.title.no.issues}"
field="noIssuesTitleTemplate">
<f:textbox
default="${descriptor.NO_ISSUES_TITLE_TEMPLATE}"
placeholder="${descriptor.NO_ISSUES_TITLE_TEMPLATE}"/>
</f:entry>
<f:entry title="${%jenkins.plugin.settings.gerrit.review.template.title.issues}"
field="someIssuesTitleTemplate">
<f:textbox
default="${descriptor.SOME_ISSUES_TITLE_TEMPLATE}"
placeholder="${descriptor.SOME_ISSUES_TITLE_TEMPLATE}"/>
</f:entry>
<f:entry
title="${%jenkins.plugin.settings.gerrit.review.template.body}"
field="issueCommentTemplate">
<f:textarea
default="${descriptor.ISSUE_COMMENT_TEMPLATE}"
placeholder="${descriptor.ISSUE_COMMENT_TEMPLATE}"/>
</f:entry>

<f:section title="${%jenkins.plugin.settings.gerrit.review.template}">
<f:entry title="${%jenkins.plugin.settings.gerrit.review.template.title.no.issues}"
field="noIssuesTitleTemplate">
<f:textbox
default="${descriptor.NO_ISSUES_TITLE_TEMPLATE}"
placeholder="${descriptor.NO_ISSUES_TITLE_TEMPLATE}"/>
</f:entry>
<f:entry title="${%jenkins.plugin.settings.gerrit.review.template.title.issues}"
field="someIssuesTitleTemplate">
<f:textbox
default="${descriptor.SOME_ISSUES_TITLE_TEMPLATE}"
placeholder="${descriptor.SOME_ISSUES_TITLE_TEMPLATE}"/>
</f:entry>
<f:entry
title="${%jenkins.plugin.settings.gerrit.review.template.body}"
field="issueCommentTemplate">
<f:textarea
default="${descriptor.ISSUE_COMMENT_TEMPLATE}"
placeholder="${descriptor.ISSUE_COMMENT_TEMPLATE}"/>
</f:entry>
</f:section>
</j:jelly>
@@ -0,0 +1,3 @@
<div>
Issue filter to specify issues to be <b>commented</b> in Gerrit
</div>
@@ -1,16 +1,21 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">

<f:property
title="${%jenkins.plugin.settings.gerrit.score.filter}"
field="issueFilterConfig"/>

<f:entry
title="${%jenkins.plugin.settings.gerrit.score.category}"
field="category"
required="true">
<f:textbox default="${descriptor.CATEGORY}"
placeholder="${descriptor.CATEGORY}"/>
</f:entry>

<f:entry title="${%jenkins.plugin.settings.gerrit.score.no.issues}"
field="noIssuesScore"
required="true">
required="true">
<f:number
clazz="number"
min="-2"
Expand All @@ -19,6 +24,7 @@
default="${descriptor.NO_ISSUES_SCORE}"
placeholder="${descriptor.NO_ISSUES_SCORE}"/>
</f:entry>

<f:entry
title="${%jenkins.plugin.settings.gerrit.score.issues}"
field="issuesScore"
Expand All @@ -32,7 +38,4 @@
placeholder="${descriptor.SOME_ISSUES_SCORE}"/>
</f:entry>

<f:property
title="${%jenkins.plugin.settings.gerrit.score.filter}"
field="issueFilterConfig"/>
</j:jelly>
@@ -0,0 +1,3 @@
<div>
Issue filter to specify issues to affect <b>score</b> in Gerrit
</div>
@@ -1,14 +1,16 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">

<f:entry title="${%jenkins.plugin.settings.inspection.project.report.path}">
<f:textbox field="sonarReportPath" value="${subJobConfigs.sonarReportPath}"
<f:entry field="sonarReportPath"
title="${%jenkins.plugin.settings.inspection.project.report.path}">
<f:textbox value="${subJobConfigs.sonarReportPath}"
default="${descriptor.SONAR_REPORT_PATH}"
placeholder="${descriptor.SONAR_REPORT_PATH}"/>
</f:entry>

<f:entry title="${%jenkins.plugin.settings.inspection.project.base.path}">
<f:textbox field="projectPath" value="${subJobConfigs.projectPath}"
<f:entry field="projectPath"
title="${%jenkins.plugin.settings.inspection.project.base.path}">
<f:textbox value="${subJobConfigs.projectPath}"
default="${descriptor.PROJECT_PATH}"
placeholder="${descriptor.PROJECT_PATH}"/>
</f:entry>
Expand Down

This file was deleted.

@@ -1,3 +1,3 @@
<div>
Path to project base dir
Provides module prefix for a file path for multi-module projects
</div>
@@ -0,0 +1,3 @@
<div>
Path to SonarQube report on Jenkins server. Default value is "target/sonar/sonar-report.json"
</div>

0 comments on commit c711c24

Please sign in to comment.