
Module 2 Lesson 5: The Pipeline Editor and Linter
Fail fast. Learn how to use GitLab's built-in tools to validate your YAML syntax and visualize your pipeline before you commit your code.
Module 2 Lesson 5: The Pipeline Editor and Linter
There is nothing more frustrating than waiting 5 minutes for a build to start, only to see it fail with a "YAML Syntax Error." GitLab provides two tools to prevent this: the Pipeline Editor and the CI Linter.
1. The Pipeline Editor
Found under Build -> Pipeline Editor in the GitLab sidebar.
- Live Validation: As you type, it tells you if your YAML is valid or broken.
- Visualization: It shows a graphical map of your Stages and Jobs.
- Template Browser: It allows you to see the source code of any "Included" templates (like GitLab's official security templates).
2. The CI Linter
This is a more "Rigid" tool used to validate a file you've already written.
- Input: Paste your whole
.gitlab-ci.yml. - Output: It tells you exactly which line is broken and why (e.g., "Job 'test' is missing 'script' keyword").
3. Visualization: The Graph
The most powerful feature of the editor is the Visualization tab.
- It helps you spot "Bottlenecks." (e.g., "Why is my production job waiting for the documentation job to finish?").
- It shows dependencies between jobs (the "Needs" keyword, which we will learn later).
4. Best Practice: Lint before Push
- Write your YAML in VS Code.
- Paste it into the GitLab CI Linter or use a VS Code extension.
- Fix the errors.
- COMMIT and PUSH.
Exercise: The Linter Debugger
- Go to your GitLab project -> Build -> Pipeline Editor.
- Type a job name but forget the
script:keyword. What error does the top bar show? - Add the
script:keyword back. Does the error disappear? - Switch to the "Visualize" tab. How many stages do you see?
- Why is the Pipeline Editor better than just editing the file in the standard "Code" browser?
Summary
You have completed Module 2: GitLab CI/CD Basics. You now know how to design a pipeline, understand its architecture, and verify its correctness.
Next Module: Time for action: Module 3: Building Your First Pipeline.