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.
This adds several parameters to the builds to reflect usernames, namely:
GERRIT_TOPIC_CHANGER_USERNAME
GERRIT_CHANGE_ABANDONER_USERNAME
GERRIT_CHANGE_OWNER_USERNAME
GERRIT_CHANGE_RESTORER_USERNAME
GERRIT_PATCHSET_UPLOADER_USERNAME
GERRIT_EVENT_ACCOUNT_USERNAME
GERRIT_SUBMITTER_USERNAME
Each parameter contains the Gerrit login for the related account, as a companion parameter for the already-existing
GERRIT_*_NAME
andGERRIT_*_EMAIL
parameters.The reason I added these parameters is because we want to send notifications to users when a build succeeds/fails and the notification tool we use requires users to be identified using their username.
Currently, the lack of this information forces us to do a separate HTTP query against the gerrit server to retrieve the username based on the value of the
GERRIT_CHANGE_OWNER_EMAIL
parameter. This additional query causes issues for us because the connection with the gerrit server is sometimes unstable.Testing done
I updated
src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTriggerTest.java
to include the new parameters and ran the tests in that file.Unfortunately, I don't have access to a Jenkins installation where I could do detailed testing of this change at the moment.
However the additions are very similar to existing code and should be easy to audit if needed.
I also ran the checkstyle & findbugs targets.
Logs for each of the targets can be found as attachments :
checkstyle.txt
findbugs.txt
test.txt
Submitter checklist