GitLab CI Events
In order to unlock innovation and build more value, GitLab is expected to be the center of automation related to DevSecOps processes. We want to transform GitLab into a programming environment, that will make it possible for engineers to model various workflows on top of CI/CD pipelines. Today, users must create custom automation around webhooks or scheduled pipelines to build required workflows.
In order to make this automation easier for our users, we want to build a powerful CI/CD eventing system, that will make it possible to run pipelines whenever something happens inside or outside of GitLab.
A typical use-case is to run a CI/CD job whenever someone creates an issue, posts a comment, changes a merge request status from “draft” to “ready for review” or adds a new member to a group.
To build that new technology, we should:
- Emit many hierarchical events from within GitLab in a more advanced way than we do it today.
- Make it affordable to run this automation, that will react to GitLab events, at scale.
- Provide a set of conventions and libraries to make writing the automation easier.
While “GitLab Events Platform” aims to build new abstractions around emitting events in GitLab, “GitLab CI Events” blueprint is about making it possible to:
- Define a way in which users will configure when an event emitted will result in a CI pipeline being run.
- Describe technology required to match subscriptions with events at GitLab.com scale and beyond.
- Describe technology we could use to reduce the cost of running automation jobs significantly.
For now, we have technical 4 proposals;
Proposal 1: Using the
.gitlab-ci.ymlfile Based on;
Proposal 2: Using the
ruleskeyword Highly inefficient way.
Proposal 3: Using the
.gitlab/ci/eventsfolder Involves file reading for every event.
- Proposal 4: Creating events via CI files Combination of some proposals.
Each of them has its pros and cons. There could be many more proposals and we would like to discuss them all. We can combine the best part of those proposals and create a new one.