# 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?](https://specstory.com/learning/ci-cd/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.

10 min read

## Concepts

### [What is a pre-commit hook?](https://specstory.com/learning/ci-cd/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)?](https://specstory.com/learning/ci-cd/agent-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 DORA metrics?](https://specstory.com/learning/ci-cd/dora-metrics)

DORA metrics are five measures of software delivery, covering change lead time, deployment frequency, recovery time, change failure rate, and rework rate.

### [What are Git hooks?](https://specstory.com/learning/ci-cd/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 are required status checks?](https://specstory.com/learning/ci-cd/required-status-checks)

Required status checks are CI results that must pass before a pull request can merge into a protected branch, set by branch protection rules or rulesets.

### [What is a merge queue?](https://specstory.com/learning/ci-cd/merge-queue)

A merge queue lines up approved pull requests and tests each one against the current main branch before merging, so main stays green as changes pile up.

### [What is a quality gate in CI/CD?](https://specstory.com/learning/ci-cd/quality-gate)

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 CI failure triage?](https://specstory.com/learning/ci-cd/ci-failure-triage)

CI failure triage is deciding why a CI run failed, whether from a bug in the change, a flaky test, the environment, or the pipeline, and who should act.

### [What is continuous integration (CI)?](https://specstory.com/learning/ci-cd/continuous-integration)

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?](https://specstory.com/learning/ci-cd/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?](https://specstory.com/learning/ci-cd/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.

### [What is trunk-based development?](https://specstory.com/learning/ci-cd/trunk-based-development)

Trunk-based development is a branching model where developers merge small changes into one main branch at least daily, with no long-lived branches.

## How-to guides

### [How to run CI checks locally](https://specstory.com/learning/ci-cd/local-ci-checks)

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](https://specstory.com/learning/ci-cd/github-actions-checks)

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?](https://specstory.com/learning/ci-cd/pre-commit-vs-pre-push-vs-ci)

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?](https://specstory.com/learning/ci-cd/blocking-vs-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.

### [What is the difference between CI, continuous delivery and deployment?](https://specstory.com/learning/ci-cd/ci-vs-continuous-delivery-vs-deployment)

Continuous integration tests each merge, continuous delivery keeps each passing build ready for a person to release, and continuous deployment releases it.

## Common questions

### [Why is CI becoming the bottleneck for AI-written code?](https://specstory.com/learning/ci-cd/ci-for-coding-agents)

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 coding agents bypass pre-commit hooks?](https://specstory.com/learning/ci-cd/agents-bypassing-pre-commit-hooks)

Coding agents bypass pre-commit hooks when a failing or slow hook stops the commit that ends a task, often by adding --no-verify or editing hook settings.

### [Why do tests pass locally but fail in CI?](https://specstory.com/learning/ci-cd/tests-pass-locally-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](https://specstory.com/learning/glossary#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 failure triage](https://specstory.com/learning/glossary#ci-failure-triage)**

CI failure triage is the work of deciding why a continuous integration run failed, e.g. a real bug or a flaky test, and who should act on the failure.

**[CI pipeline](https://specstory.com/learning/glossary#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](https://specstory.com/learning/glossary#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 delivery](https://specstory.com/learning/glossary#continuous-delivery)**

Continuous delivery is a practice that keeps every change that passes the pipeline ready to release, so a person can release it to production at any time with one decision.

**[Continuous deployment](https://specstory.com/learning/glossary#continuous-deployment)**

Continuous deployment is a practice that releases every change that passes the automated pipeline to production, with no manual approval step between the merge and the release.

**[Continuous integration (CI)](https://specstory.com/learning/glossary#continuous-integration)**

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.

**[DORA metrics](https://specstory.com/learning/glossary#dora-metrics)**

DORA metrics are five measures of software delivery from the DevOps Research and Assessment program, covering how quickly changes ship and how often deployments fail or need rework.

**[Hook](https://specstory.com/learning/glossary#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.

**[Merge queue](https://specstory.com/learning/glossary#merge-queue)**

A merge queue is a system that tests each approved pull request against the current main branch and the changes ahead of it, and merges only those that pass.

**[Pre-commit hook](https://specstory.com/learning/glossary#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](https://specstory.com/learning/glossary#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](https://specstory.com/learning/glossary#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.

**[Required status check](https://specstory.com/learning/glossary#required-status-check)**

A required status check is a named check result that must pass before a pull request can merge into a protected branch, set by a branch protection rule or a ruleset.

**[Shift left](https://specstory.com/learning/glossary#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](https://specstory.com/learning/glossary#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.

**[Trunk-based development](https://specstory.com/learning/glossary#trunk-based-development)**

Trunk-based development is a branching model in which developers merge small changes into one main branch at least once a day, instead of keeping long-lived branches.

17 terms from the [Learning Center glossary](https://specstory.com/learning/glossary).

---

Source: [CI/CD and where checks run | SpecStory](https://specstory.com/learning/ci-cd)
