jenkinsci / jenkinsci/gerrit-trigger-plugin
[JENKINS-16470] gerrit trigger does not deal with ref-updated very well
- Dominant language
- Java
- Stars
- 226
- Forks
- 289
- PR merge metrics
- No merged PRs in 30d
Description
When configuring the Gerrit Trigger to act on ref-updated Gerrit events on a push-direct branch (i.e. for a push to refs/heads/master rather than refs/for/master) it does not deal with multiple commit pushes very well.
The Gerrit stream event looks like:
{"type":"ref-updated","submitter":
{"name":"John Doe","email":"john@example.com"}
,"refUpdate":{"oldRev":"a9...","newRev":"72...","refName":"FOO-1234","project":"foo"}}
where there can be any number of actual commits between oldRev and newRev. The jenkins reporting for such a build is misleading in that it only lists 1 of the commits (can't remember if it was first or last) in the changelog. Further the "parameters" are also typically wrong. They seem to reflect the parameters for perhaps the previous job.
I strongly suggest whoever is assigned this bug to actually try this use-case and reproduce the problem to see the various issues.
---
Originally reported by brian, imported from: gerrit trigger does not deal with ref-updated very well
rsandell
Raw content of original issue
When configuring the Gerrit Trigger to act on ref-updated Gerrit events on a push-direct branch (i.e. for a push to refs/heads/master rather than refs/for/master) it does not deal with multiple commit pushes very well.
The Gerrit stream event looks like:
{"type":"ref-updated","submitter":
{"name":"John Doe","email":"john@example.com"},"refUpdate":{"oldRev":"a9...","newRev":"72...","refName":"FOO-1234","project":"foo"}}
where there can be any number of actual commits between oldRev and newRev. The jenkins reporting for such a build is misleading in that it only lists 1 of the commits (can't remember if it was first or last) in the changelog. Further the "parameters" are also typically wrong. They seem to reflect the parameters for perhaps the previous job.
I strongly suggest whoever is assigned this bug to actually try this use-case and reproduce the problem to see the various issues.
environment
```
Jenkins 1.498
Gerrit-Trigger: 2.7.0
```
Contributor guide
Research direction
Start by reproducing a push-direct ref-updated event with multiple commits using the Gerrit Trigger configuration described in the issue. Inspect how the event's oldRev and newRev are handled, then verify that the Jenkins changelog includes every commit and that the build parameters belong to the current job rather than a previous one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- ci-cd, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100