Skip to content

Commit

Permalink
Add warning message and extend help text
Browse files Browse the repository at this point in the history
  • Loading branch information
ckreisl committed Oct 31, 2022
1 parent 1bbe407 commit 9f8f222
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,18 @@ public void setVoteSameTopic(boolean voteSameTopic) {
this.voteSameTopic = voteSameTopic;
}

/**
* Returns the description message for the jelly entry.
*
* @return descriptionMsg for jelly.
*/
public String getVoteSameTopicDescription() {
return "<b>Warning:</b>"
+ " The current implementation takes into account that 'Build Current Patches Only'"
+ " with 'Abort new patch sets' and 'Abort patch sets with same topic' are <b>enabled</b>"
+ " (see help for more).";
}

@Override
public String getGerritCmdBuildSuccessful() {
return gerritVerifiedCmdBuildSuccessful;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
</f:entry>
</f:optionalBlock>
<f:entry title="${%Vote patch sets with same topic}"
help="/plugin/gerrit-trigger/help-GerritVotePatchSetsWithSameTopic.html">
help="/plugin/gerrit-trigger/help-GerritVotePatchSetsWithSameTopic.html"
description="${it.config.voteSameTopicDescription}">
<f:checkbox name="voteSameTopic"
field="voteSameTopic"
checked="${it.config.voteSameTopic}"
Expand Down
25 changes: 24 additions & 1 deletion src/main/webapp/help-GerritVotePatchSetsWithSameTopic.html
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
<p>If this is enabled, build notifications and votes will be sent to patchsets with the same topic.</p>
<p>
If this option is enabled, build notifications and votes will be sent to all patch sets within a Gerrit topic.
<br><br>
<b>Drawback with current implementation</b>
<br><br>
In order to not overwrite the results the following options should be enabled
<ul>
<li>Build Current Patches Only</li>
<li>Abort new patch sets</li>
<li>Abort patch sets with same topic</li>
</ul>
Otherwise commands are send multiple times to the same patch set in Gerrit.
<br><br>
Example:
<br><br>
Patch set 1 on Repository A (triggers) -> verify-a<br>
Patch set 2 on Repository B (triggers) -> verify-b<br>
<br>
Both patch sets are combined as a Gerrit topic. If the mentioned options are disabled the feedback will result in:<br>
verify-a (reports result to) -> Patch set 1 & Patch set 2 (due to isVoteSameTopic: true)<br>
verify-b (reports result to) -> Patch set 2 & Patch set 1 (due to isVoteSameTopic: true)<br>
<br>
The fastest job wins. In this case it could happen that one reports a -1 Verified in the first place and the second one +1 Verified overriding the previous result.
</p>

0 comments on commit 9f8f222

Please sign in to comment.