Interview Prep/CI/CD/Fundamentals and Pipeline Design

How does a pipeline behave as a DAG, and what is the critical path?

AdvancedConceptFundamentals and Pipeline Design
Answer

Jobs are nodes and dependencies are edges (needs: in GitHub Actions and GitLab, parallel/stages in Jenkins). Jobs with no dependency between them run in parallel; a job starts when all its dependencies succeed.

Total pipeline time equals the critical path: the longest chain of dependent jobs. Adding runners will not help if one 20-minute integration job gates everything. To shorten it you split that job, shard tests, or let downstream jobs start earlier. GitLab's needs: lets a job skip waiting for the whole previous stage.

jobs:
  lint:   { runs-on: ubuntu-latest, steps: [...] }
  test:   { runs-on: ubuntu-latest, steps: [...] }
  build:  { needs: [lint, test], runs-on: ubuntu-latest, steps: [...] }
All CI/CD questions Roadmap: CI/CD fundamentals

More on Fundamentals and Pipeline Design