Refactor CI configuration of GitLab Runner project
Overview
Copying what I've wrote yesterday on Slack:
It appears that current broken
master
pipelines are caused not only by the RPM signing issue that we've debbuged with @sazzopardi earlier, but also by an invalid formatting that doesn't pass codequality checks. It forced me to check "why" because the MR with the fix for RPM signing is not touching the reported file at all. And I've found it: Go 1.13 MR caused - uncaught - another problem.For a context:
With Go 1.12 some formatting rules in Golang were changed. While working on the Go 1.13 MR we've updated all places that stopped passing the go fmt checks in our codequality job. But in the meantime we've worked on the initial MR for
arm64
support. This MR added one test case in one of the test files, that was properly formatted for Go 1.10, but not for Go 1.12+.We've merged the
arm64
MR and this change landed inmaster
. Go 1.13 was not rebased because there was no need for. When we've merged Go 1.13 MR, then we've introduced not only the GPG bug but also the formatting problem.It doesn't happen often, but when it does, it's annoying, disturbing and causes us to waste a lot of time for debugging things that normally would be caught and solved during development - maybe immediately like we do now, but maybe later if there would be more important tasks. With broken
master
we don't have any other option than to debug and fix/revert now.And after this longish introduction I want to say, that we should refactor our CI pipeline and enable Pipelines for merge results and Merge Trains. It would point us these problems before they would be merged into
master
.
Given several problems that occurred in last few weeks we should definitely refactor our CI pipeline:
- Split things up, move them to
.gitlab/ci/
directory and use includes to compose the main.gitlab-ci.yml
file - Check and if possible implement the
needs
feature to speed-up parts of the Pipeline - Configure pipelines for merge requests
- Configure the pipelines for merged results
- Enable Merge Trains
While it will not prevent us from all conflicts and incompatibilities, it should definitely prevent us from entering the master:broken state again.