Force GoCD to build every commit (WIP) #76
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.
I've been working on a fix for a major issue with Gerrit plugin. At this phase I wanted know what other people are thinking about this feature since it is a workaround to a problem that I think should be solved in GoCD itself. This feature is still WIP. It has been tested in production but it still needs couple of finishing touches:
At the moment GoCD merges commits if it sees that there are multiple related incoming commits. This causes GoCD to skip building and testing some of the commits pushed to Gerrit. This makes the Gerrit plugin quite useless because most of the time developers push more than one commit/change to Gerrit for review so many of of these changes won't ever get the pass/failed status from GoCD.
This fix isn't really an ideal way to fix the issue but it should work well enough. The fix changes the plugin behavior so that it doesn't give any new commits to GoCD until the pipeline has completed all the stages. This is checked via the pipeline status and history APIs.
In order to do this, the SCM material has to know the name of the pipeline that is building the changes so that the plugin can search pipeline activity for the correct pipeline. The pipeline name is given in the SCM material settings and it is not part of the identity so that there can be multiple related SCM materials in different pipelines.
This PR is built on top of the white/blacklist feature's setting changes so that PR should be merged first.