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: [...] }
More on Fundamentals and Pipeline Design
What is Continuous Integration (CI)?BeginnerWhat is the difference between Continuous Delivery and Continuous Deployment?IntermediateWhat is a CI/CD pipeline and what are its stages?BeginnerWhy should a pipeline "fail fast", and how do you order stages to achieve it?IntermediateWhat makes a build reproducible, and why does it matter?AdvancedHow does your branching strategy affect CI? Compare trunk-based development with GitFlow.Intermediate