What are the common ways a CI/CD pipeline run gets started, and how do they differ in what they cost and what feedback they give?
answer
- push, PR, tag, schedule, manual, upstream, API
- who is waiting for this result
- frequency scales with commits, not merges
- the trigger with nobody watching
- the same commit paying twice
basics
~20 sRuns start from a branch push, a pull/merge request, a tag, a schedule, a manual button, an upstream pipeline, or an external API call. Each differs in how often it fires, who is waiting for the result, and how much compute it burns per merge.
solid answer
~50 sThe usual taxonomy is: **push** to a branch, **pull/merge request** opened or updated, **tag or release** creation, **scheduled** runs on a timer, **manual** on-demand runs with parameters, **upstream** triggers when another pipeline or dependency finishes, and **API or webhook** triggers from outside the system. They differ on three axes. *Frequency* — push and PR events scale with how fast people commit, so they dominate the bill; tags and schedules are bounded. *Audience* — a PR run has a human waiting and must be fast; a nightly run has nobody waiting and can be slow and thorough. *Purpose* — a tag run should produce and publish the release artifact; a scheduled run exists to catch drift that no commit caused, like a new vulnerability in a pinned dependency or an expired credential. The classic waste is a repository where both the push trigger and the PR trigger fire on the same commit, paying twice for identical work.
go deeper
Be able to list the triggers — push, pull request, tag, schedule, manual — and say plainly which one a normal code change fires and who is waiting for the result.
Explain the differences that matter: why frequency scales with commits rather than merges, why release publishing belongs on a tag, and what double-firing push and PR triggers costs.
Demonstrate operational judgment: diagnosing an unexpected spike in runs, killing trigger loops, controlling upstream trigger amplification, and making sure scheduled failures actually reach a human.
Own the economics and the governance: the per-merge cost model across many repositories, which triggers may reach production and who authorised them, and how trigger design shapes how often teams can ship.
## Why interviewers ask this Trigger choice decides how much compute a single merge consumes and how quickly a developer learns they broke something. Both numbers are directly visible to a team lead, so the taxonomy comes up early. ## The taxonomy **Push to a branch.** The default. Fires on every commit reaching any matching branch. Cost scales with commit rate, not merge rate — a developer who pushes eight work-in-progress commits pays for eight runs unless superseded runs are cancelled. Feedback goes to one author. **Pull request / merge request.** Fires when a change proposal is opened, updated or reopened. This is the run that gates review and merge, so it is the one that must be fast. Two subtleties matter: many platforms build the *merge result* (your branch merged into the target) rather than your branch tip, which is why a green proposal can go red after merge if the target moved; and a proposal from an untrusted fork is a different trust context, which is why fork runs are usually restricted. **Tag or release creation.** Fires when a version tag appears. This is the trigger that should build and publish release artifacts, because a tag is the only trigger whose identity is a version rather than a moment in time. Bounded frequency: a few per week. **Scheduled / cron.** Fires on a timer with no commit involved. Its whole justification is detecting change you did not cause — a newly disclosed CVE in a pinned dependency, a rebuilt base image, an expiring certificate or token, a flaky test that only shows up over many repetitions. It is also the only trigger that burns money on days when nobody ships, and the only one with nobody watching the result, so a scheduled pipeline needs an alert route or it silently rots. **Manual / on-demand.** A human presses a button, usually with parameters (which environment, which version). Cost is a person's attention rather than compute, and that is exactly why it is used for expensive or irreversible work. **Upstream pipeline / dependency completion.** One pipeline finishes and starts another, typically across repositories: a shared library publishes, and consumers rebuild against it. Powerful and dangerous — the amplification factor is real. One commit to a base library with forty consumers is forty runs, and if those consumers trigger each other you can build a cascade that outruns your runner pool. **API / webhook / external event.** A script, a chat command, a ticket transition or another system calls in. Useful for glue and for scheduled work owned outside the repository; it needs authentication and rate-thinking like any other endpoint, and it is the trigger most likely to be forgotten in an audit of "what can start a production deploy". ## The cost model A rough per-merge figure is worth carrying in your head: ``` cost per merge ≈ (commits pushed per change × push-run minutes) + (PR updates × PR-run minutes) + (share of tag/scheduled/upstream runs attributable to the change) ``` The first two terms dominate almost everywhere, and they are also where the two classic wastes live: - **Double-firing.** Push and PR triggers both match the same commit on a proposal branch, so every update runs the suite twice. Scoping the push trigger to long-lived branches only is the standard fix. - **No superseding.** Six pushes in ten minutes produce six full runs, five of which nobody will look at. ## Matching trigger to work | Trigger | Who is waiting | What belongs on it | |---|---|---| | PR update | the author, right now | fast checks: lint, unit, build | | Push to main | the team | the full gate that protects the trunk | | Tag | a release manager | build and publish the artifact, exactly once | | Schedule | nobody | slow suites, drift and dependency checks | | Manual | an operator | deploys, migrations, expensive one-offs | | Upstream | a downstream owner | rebuild and re-verify against a new dependency | ## Two failure modes worth naming **The pipeline that ran nothing.** Trigger conditions are filters, and a filter that matches nothing produces a run that is technically successful and tested nothing — dangerous when a merge gate treats "no run" or "skipped" as "passed". **The trigger loop.** A pipeline that commits something back to the repository — a version bump, a formatted file, a lockfile — re-triggers itself on push. Every platform has a way to stop it; every platform also has a team that discovered the loop from its bill.
- What kind of failure does a scheduled run catch that no commit-triggered run ever will?Drift caused by the outside world: a vulnerability newly disclosed in a dependency you already pinned, a rebuilt base image, an expired token or certificate, a third-party API that changed, and flakiness that only appears over many repetitions. None of those correspond to a commit, so nothing else fires. The catch is that nobody is watching a nightly result, so it needs an explicit alert route.
- A pipeline commits a generated version bump back to the repository and the pipeline runs again. What is happening and how do you stop it?The push trigger is matching the pipeline's own commit, so the run re-triggers itself — potentially forever. The fixes are to have the automation's commit skipped by the trigger's own filtering, to push with an identity or token that the trigger ignores, or to move the bump into a job that runs only on a trigger the commit cannot satisfy, such as a tag or a manual release run.
- Why can a proposal whose checks were green break the trunk immediately after it merges?Because the two runs tested different trees. A proposal run tests your branch, or a merge preview computed at that moment; between then and the merge the target branch moved, so the combination that lands was never built. Requiring the branch to be up to date before merge, or serialising merges so each candidate is tested against the actual tip, is what closes the gap.
saying these in an interview costs you the question
- Treats push and pull-request triggers as the same event
- Puts release publishing on a branch push instead of a tag
- Assumes a scheduled run is watched by someone
- Ignores that upstream triggers amplify one commit into many runs
- Thinks a run that matched no trigger conditions proves the change is safe