Force GoCD to build every commit (WIP)
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:
- Commits should be built in chronological order. Now the order is still pseudo-random order of the hash map.
- Better instructions and labels (and add tooltips?)
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.
There're too many changes to view in this PR. May be we should merge the other one first so we know the exact changes that's needed for this. I have never used Gerrit before so I'm not familiar with the workflow, but my only request would be to make this an opt-in feature (may be at a material / plugin level) than to have it enabled by default for all plugins.
This is great work! 👍
@ashwanthkumar Yes, since it is based on the white/blaklist PR it makes hard to see exactly what was changed. The relevant changes start from commit 78aa0af. I'll make this PR cleaner hopefully later this week once I get some time merge the other white/blacklist PR.
Sure @juhasipo - Thanks!
Hi, this work is awesome and quite critical. Can I ask about the current status? I see there are some conficts. Is there plan to solve them and release this? Thanks