DEV Community

Sohana Akbar
Sohana Akbar

Posted on

Pipeline as YAML — Good or Bad? 🤔

Let’s settle this once and for all.

If you’ve worked with CI/CD tools like GitHub Actions, GitLab CI, or Jenkins, you’ve met Pipeline as YAML. Some devs love it. Others loathe it.

So which is it? Good or bad?

Spoiler: It’s both. Let me explain.

✅ The Good

  1. Version control everything
    Your pipeline lives right next to your code. No more clicking through a UI to update a build step. Change → commit → review → done.

  2. Reproducible builds
    That pipeline that worked six months ago? Still works. No “but it worked on Sarah’s machine” nonsense.

  3. Reviewable like code
    Pull requests for pipeline changes mean your team can catch mistakes before they break main.

  4. Portable (mostly)
    Once you learn one YAML CI syntax, switching between GitHub Actions, GitLab, and Bitbucket feels familiar — just different keywords.

❌ The Bad

  1. YAML is… YAML
    Indentation mistakes, invisible trailing spaces, and the dreaded “boolean vs string” trap.
    on: yes → suddenly your pipeline runs only on Tuesday. Good luck debugging.

  2. Copy-paste hell
    Want the same job for dev, staging, and prod? Some tools offer anchors/references. Many devs just copy-paste 50 lines. Three times.

  3. Limited logic
    No loops. No functions. No real programming constructs. You end up writing shell scripts inside YAML strings — which are also untyped and untested.

  4. Debugging pain
    “Invalid pipeline” — thanks, tool. Which line? What’s wrong? Go fish.

🧠 The Verdict
Pipeline as YAML isn’t inherently bad. It’s a minimum viable interface for defining workflows. The real problem is when your pipeline needs programming, but YAML gives you data serialization.

Use YAML for simple workflows.
For complex ones, generate your YAML from a real language (Python, TypeScript, etc.) using a CDK-like tool.

✅ Good for: small teams, standard builds, deploy-on-push workflows
⚠️ Bad for: complex branching logic, reusable components, non-developers

💡 What I’d like to see
Built-in YAML validation in every CI tool

More !include or extends without workarounds

Optional scripting languages inside pipeline definitions (no more Bash string soup)

Until then? YAML pipelines are like JavaScript — the worst form of CI/CD, except for all the others.

What’s your take? Love it? Hate it? Built your own YAML generator to escape the madness? Drop your thoughts below. 👇

Top comments (0)