Code changed in jenkins
User: Jacob Keller
JENKINS-38675 use refspec instead of branch name for the revision
Add support to the GerritTriggerBuildChooser enabling it to report the
gerrit change refspec instead of simply reporting the branch this change
is destined to. This improves readability of the resulting changelog
entry on the Jenkins build page, as the user can see exactly which ref
To do so, we need to not only ask for the revision, but the refname. Add
a context callback in order to determine in a similar way as we do the
revision. Although it might be possible to replace the revision handling
to use git.revParse() on the refname instead, this may not be as
accurate as the change event, so we leave this in place.
The result of this change is that we should see something like:
The resulting display is easier to understand and more accurately
points out the refname that got built.
Add a test to ensure that this behaves as expected. The current test can
probably be improved as it relies heavily on mock objects and does not
actually generate a trigger event or anything of that sort.
Signed-off-by: Jacob Keller <email@example.com>