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.
My progress
Sign in to track your progress and take notes. Sign in
💬 Questions about this lesson
No questions yet: be the first to ask for help or share your configuration.
Recommended Articles
Reusing and securing GitLab pipelines
Industrializing GitLab CI/CD: extends, anchors and !reference, include, CI/CD components and cata...
GitHub Actions best practices and troubleshooting
Running GitHub Actions: speeding up and cutting costs, debugging (debug logs, act locally, gh run...
GitLab CI/CD: concepts and architecture
Discover GitLab CI/CD: the DevSecOps platform, the .gitlab-ci.yml file, pipelines, stages and job...
Writing a .gitlab-ci.yml: jobs, rules, cache and artifacts
Mastering .gitlab-ci.yml syntax: stages, jobs and images, rules and workflow, needs (DAG), cache ...
GitLab runners: types, executors, installation and security
Running GitLab jobs: instance, group and project runners, docker, kubernetes and docker-autoscale...
Building and delivering with GitLab: registry, environments and deployments
Delivering with GitLab CI/CD: building and publishing images to the project registry, package reg...
Operating Thanos: monitoring, performance, troubleshooting and alternatives
Thanos operating best practices: key metrics and alerts, mixin, caches, limits, frequent errors a...
End-to-end CI/CD (5/5): GitHub Actions, GitLab CI, Jenkins and Argo CD in practice
Compare and use CI/CD tools: GitHub Actions, GitLab CI, Jenkins, Argo CD and Flux; a complete pip...
Synthetic monitoring as code: industrializing synthetic scenario management
Learn how to integrate synthetic monitoring into your CI/CD pipelines for automated, resilient pe...