1. Speeding up #
Feedback in under 10 minutes.
Levers #
- Dependency cache keyed on the lock file (
cache:key:files). needsfor an execution graph instead of strict stages;rules:changesto only run what is affected.interruptible: truecancels pipelines superseded by a newer push (with the project option "auto-cancel redundant pipelines").- Lightweight images prebuilt with the job's tools; artifacts with
expire_in.
2. Debugging #
Understanding why a job fails.
Frequent errors #
| Symptom | Likely cause |
|---|---|
| "This job is stuck" | no runner with the right tags, or protected runner and unprotected branch |
| Pipeline created twice | branch and merge request pipelines: add workflow:rules |
| Empty variable | protected variable used on an unprotected branch |
| Artifact not found | producer job missing from needs or expired artifact |
| docker: Cannot connect to the Docker daemon | missing dind service or wrong DOCKER_HOST/TLS |
The CI_DEBUG_TRACE: "true" variable shows every executed command (careful: secrets may appear). gitlab-ci-local replays a pipeline on your machine without pushing.
3. Checklist #
Before rolling out.
Checks #
| Item | Check |
|---|---|
| Reliability | protected main branch, pipeline required before merge |
| Speed | under 10 minutes for merge request feedback |
| Security | SAST and secret detection, OIDC rather than keys, runners separated by trust |
| Delivery | same image promoted, tracked environments, rollback tested |
| Reuse | versioned components rather than copy-paste |
Best practice : Treat .gitlab-ci.yml as code: review, tests (glab ci lint) and versioning of shared components.Commands to know #
Commands to know
npx gitlab-ci-local test: run the test job locallyglab ci trace: follow the current job logglab api projects/:id/pipelines?status=failed: failed pipelines
Sources #
Checked in November 2026: CI/CD platforms change every month, check versions and plans in the vendor's documentation.
