CI/CD·6 min read·

Keeping Pipelines Green: Discipline, Quarantine, and Triage

A red pipeline is a process failure, not a fact of life. Learn quarantine, flaky-test triage, and the discipline that keeps CI green.

NB

Netbay Engineering

Netbay Engineering

On this page

A pipeline that is often red is worse than no pipeline, because it teaches everyone to ignore the gate. Keeping CI green is a matter of discipline and tooling — faster feedback, quarantine for genuinely flaky tests, and a clear triage process so everything red gets attention immediately. Treat a red build as the team's top priority until it is green again.

The red-build rule is a contract

The single most important policy is simple: when the pipeline is red, nothing else ships, and the owner owns it to resolution. Enforce it with a visible status: a dashboard, a chat bot, a loud notification. If a red build can linger for hours, its authority evaporates. Some teams rotate a "build guardian" whose entire focus is clearing the queue and unblocking contributors, so nobody treats a failing build as someone else's problem.

Speed is part of the contract. A build that takes 40 minutes invites interruption, context switching, and skimming. A build that takes 10 minutes on a merge request keeps developers in flow and gives the red-build rule teeth. Parallelize jobs, cache dependencies, and split slow suites so the fast, high-value checks run first.

yaml
jobs:
  fast-checks:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: npm
      - run: npm ci
      - run: npm run lint
      - run: npm test -- --runInBand --bail

The --bail flag stops the suite at the first failure, returning the developer to the red quickly instead of waiting out the whole run.

Quarantine flaky tests instead of tolerating them

The biggest green-killer is the flaky test — sometimes passes, sometimes fails, unrelated to the change. The mature response is quarantine, not disable-and-forget. When a test fails intermittently, move it to a separate, explicitly-walled-off suite with a ticket, so the fast gate stays clean while you diagnose the flake.

A quarantine file that CI treats specially keeps it honest:

json
{
  "quarantined": [
    "e2e/checkout-coupon.spec.ts",
    "unit/payment-tax.spec.ts"
  ],
  "policy": "quarantined tests MUST have an open ticket",
  "maxQuarantineDays": 14
}

Each quarantined test carries a ticket and an expiry. When the expiry passes unresolved, the test either gets fixed or is removed permanently — never left drifting in limbo. The finite shelf life is what prevents quarantine from silently becoming an excuse pile.

pipeline test suite runs pass green, ship it fail quarantine + ticket triage fast fix or remove red builds are resolved immediately, never tolerated

Triage the red build in minutes

When a build goes red, run a tight triage: is it my change or the baseline? If the failure appears on an unchanged branch, it is suspicious and worth quarantining or fixing as infrastructure, not shrugging off. Git bisect is your friend for pinning which commit introduced a regression:

bash
git bisect start origin/main HEAD
git bisect run npx jest --runInBand --bail

Bisecting to the offending commit turns a red build from a mystery into a specific, actionable change in a handful of runs. Add the commit messages from that window to the incident, and you have a succinct narrative for the post-mortem.

Make green the default expectation

Green should be boring and expected, not heroic. That happens when developers commit against a fast, reliable gate and know a red build will be seen quickly. Culture is the load-bearing wall: a team that celebrates "we went a month without a red build" has internalized the discipline. Keep metrics on build health visible — the measuring-CI post covers the numbers — so the team can see recovery times trending down.

Reclaiming trust after a red spell

Sometimes the pipeline has been red so long it is just noise. Recovering requires a deliberate reset: freeze merges, fix the root causes, get one green build, then call it out loudly as the new bar. Do not quietly slip back to ignoring the gate. The reset is as much psychological as technical — a visibly re-established green is what restores the pipeline's authority.

Takeaway: a green pipeline is a habit reinforced by fast builds, honest quarantine, and a red-build rule with teeth. Keep your CI runners and the services they deploy honest by hosting them on a Netbay VPS from Lucknow DC01, reprovisioned in under 60 seconds at netbayhosts.in.

Keep reading

Follow along on a real VPS

Deploy Linux in under 60 seconds

These guides are written against Ubuntu, Debian, and RHEL-family images — the same ones on NetBay.

Deploy an instance