GitLab CI Inheritance Sucks

mistval

Randall

Posted on October 2, 2021

GitLab CI Inheritance Sucks

Or at least, cross-repo inheritance.

I've worked at a couple of places now where GitLab CI templates are heavily used, included across repos, and inherited from.

I've found it confusing, inflexible, and an enemy of build reproducibility.

In a repo where this is done heavily, if I want to change something, I must figure out:

  1. Does my .gitlab-ci.yml actually contain this job at all? Or is it from a template somewhere else?
  2. Where the heck is it (or its parent) coming from? This repo includes templates from three other repos, and they include templates from other repos too. Where it at???
  3. How do I change the parent job without breaking any other pipelines that depend on it? Maybe I can just inherit from it and add a before_script? But what if the parent job gets updated with its own before_script later, and my overriding it breaks something?
  4. Will the person who owns the parent template's repo let me change it?

So after getting all of that out of the way, I make the change in the template repo. It breaks someone else's pipeline somewhere. But there wasn't even a commit to their repo. Their pipeline just suddenly just starts failing. What?? This totally breaks build reproducibility!

I've gotten to where I'd rather just have a bunch of duplicated GitLab CI code across repos.

Am I crazy, am I missing something, or do others feel the same?

πŸ’– πŸ’ͺ πŸ™… 🚩
mistval
Randall

Posted on October 2, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

GitLab diff color system
gitlab GitLab diff color system

July 13, 2022

10 Years of GitLab 🦊
gitlab 10 Years of GitLab 🦊

November 22, 2021

GitLab CI Inheritance Sucks
discuss GitLab CI Inheritance Sucks

October 2, 2021

Giveaway alert!
discuss Giveaway alert!

September 30, 2020