GitLab CI Inheritance Sucks

Randall - Oct 2 '21 - - Dev Community

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?

. . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player