Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-26323] Fix "Build Current Patches Only" by scanning for event
The "Build Current Patches Only" feature currently identifies previous builds based on their parameters as they were present when the build was first scheduled. If you use a plugin that alters the parameters after the job has started, the cancelling of previous builds does not work, since the GerritTrigger#cancelJob() method does not find the job anymore. This is easily and trivially fixed, by not scanning for the parameters, but instead for the GerritEvent that is stored in the GerritCause used to start a build. The only downside to this is, that the current patch-set scans for identity, but not equality of the two events. After a Jenkins restart, they might not be identical anymore, since Jenkins reschedules queued builds and can't unify the two events via Stapler; as they are stored in separate files. It'd be trivially easy to alter this to Event.equals(otherEvent), in case this degradation is not wanted.
- Loading branch information
1 parent
c3899ea
commit 97b08ee
Showing
1 changed file
with
50 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters