CI/CD and where checks run
How pipelines build, test, and release each change, where checks run from pre-commit hooks to CI, and how coding agents change the load.
Start here
What is CI/CD?
CI/CD is the practice of merging code often and building and testing each change automatically, so the software stays ready to release at any time.
Concepts
What is a pre-commit hook?
A pre-commit hook is a script Git runs before it records a commit, used to lint, format, or test the staged changes and stop the commit if a check fails.
What are agent hooks (Stop hooks)?
Agent hooks are scripts a coding agent runs at set points in its loop, e.g. a Stop hook that runs the tests before the agent can end its turn.
What are Git hooks?
Git hooks are scripts that Git runs automatically at set points, e.g. before a commit, so a team can check or change the work at each step.
What is a quality gate in CI/CD?
A quality gate is a checkpoint where a change must meet agreed criteria, e.g. passing tests, before it moves on to the next stage of delivery.
What is continuous integration (CI)?
Continuous integration is merging every developer's changes into the main branch often, with an automated build and tests run on each merge.
What is shift-left testing?
Shift-left testing moves testing earlier in development, so problems are found when a change is small and cheap to fix instead of after release.
What is test impact analysis?
Test impact analysis maps which tests exercise which code, so a change runs only the tests it could affect instead of the whole suite.
How-to guides
How to run CI checks locally
Running CI checks locally means repeating a CI pipeline, e.g. a GitHub Actions workflow, on a developer's machine or in a container before a push.
How to run tests in GitHub Actions
Running tests in GitHub Actions means adding a workflow file that installs a project, runs its tests on each push or pull request, and reports the result.
Comparisons
What is the difference between pre-commit, pre-push, and CI checks?
Pre-commit, pre-push, and CI checks run at different moments, before a commit is saved, before it leaves the machine, or on a server after it arrives.
What is the difference between blocking and non-blocking checks?
A blocking check stops a commit, push, or merge until it passes, while a non-blocking check reports a failure and lets the change go ahead.
Common questions
Why is CI becoming the bottleneck for AI-written code?
CI becomes a bottleneck when AI coding agents push more changes than pipelines can test quickly, so queues grow and teams skip or trim checks.
Why do tests pass locally but fail in CI?
Tests that pass locally but fail in CI usually depend on something that differs between machines, from timing and test order to versions and stale state.
Terms in this topic
- Agent hook
- An agent hook is a script that a coding agent's harness runs at a fixed point in its loop. A Stop hook runs when the agent tries to end its turn.
- CI pipeline
- A CI pipeline is the ordered set of automated steps, e.g. build, test, and package, that runs each time code is pushed or merged.
- CI/CD
- CI/CD is a practice that merges code often and builds and tests each change in an automated pipeline, so the software is kept ready to release.
- Continuous integration (CI)
- Continuous integration is a practice that merges every developer's changes into the main branch often, with an automated build and test run on each merge.
- Hook
- A hook is a script that a tool runs automatically at a set point in its workflow, e.g. Git running a check before it records a commit.
- Pre-commit hook
- A pre-commit hook is a script that Git runs before it records a commit. It can lint, format, or test the staged changes and stop the commit if a check fails.
- Pre-push hook
- A pre-push hook is a script that Git runs before it sends commits to a remote repository, which can run slower checks than a pre-commit hook and stop the push.
- Quality gate
- A quality gate is a point in a delivery pipeline where a change is measured against set criteria before it goes further. Some gates block the change, and others only report.
- Shift left
- Shift left is an approach that moves testing and other quality checks earlier in development, when a problem is smaller and cheaper to fix.
- Test impact analysis
- Test impact analysis is a technique that maps which tests exercise which code, so a change runs only the tests it could affect instead of the whole suite.