[JENKINS-49777] Abort running build if Gerrit patchset is abandoned #483
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to JENKINS-49777.
Providing an option to abort running builds if the patchset is abandoned by the developer in the meantime on Gerrit side.
Since the current implementation of the Gerrit Trigger plugin takes events and processes them by checking whether a build should be triggered or not the order now has slightly changed.
Within the
EventListener
after checking whether the event is of interest we first abort the build(s) and check whether the event should re-trigger another build.Note: One open point might be the feedback back to Gerrit. Right now if a Gerrit patchset has the state "change-closed" (Abandoned / Merged) the feedback via SSH raises an Exception due to this fact and not comment nor feedback is provided.