What does a team lose by copy-pasting a shared CI pipeline template instead of referencing a versioned one?
answer
- Inheritance versus a snapshot
- Fixes have a distribution problem
- Green pipeline hides staleness
- A version number is telemetry
- Local edits nobody reviews
basics
~20 sA copy stops receiving updates: security fixes made centrally never reach it, and the local edits made to it are invisible to the platform team. A versioned reference keeps one source of truth and makes adoption measurable.
solid answer
~50 sA shared template exists so one team can fix a control once and have every pipeline inherit it: resolution from an approved source, a scanning step, the stage that produces the artifact with its SBOM, provenance and signature. Copying its text into your own repository severs that inheritance in both directions. Upstream fixes never arrive, so the copy quietly ages back to whatever the template looked like on the day it was cloned, and a green pipeline is no evidence of currency. Downstream, the platform team cannot see the copy or how far it has drifted, so any claim about estate-wide control coverage becomes an interview rather than a query. Referencing a versioned template gives you a single source of truth, a version number you can report on, and an upgrade that is a deliberate bump instead of a manual re-copy.
go deeper
Be ready to say plainly that a copied pipeline never receives later fixes and that nobody upstream can see it. Naming both directions of the loss is what a first-round answer needs.
Explain the mechanics: how a reference resolves a version at build time, why staleness produces no failure signal, and how a version number recorded per build turns adoption into a query.
Show the operational judgment: how you would diff a drifted copy, separate missed fixes from legitimate local needs, and absorb the second group upstream so the migration sticks.
Own the tradeoff that a referenced template is code executing in every pipeline. Argue for treating it as production software with restricted write access, review and released versions, rather than letting teams copy to feel safe.
## What a shared pipeline template is A platform or security team maintains one pipeline definition that encodes the controls every build is meant to have: dependencies resolved from an approved source, a scanning step, a build step running with a narrow token, and the stage that emits the artifact together with its SBOM, its provenance statement and its signature. A service then adopts it one of two ways. It can **reference** the definition — its CI config names the template and a version, and the platform team's copy is what actually runs. Or it can **copy** the text into its own repository. On adoption day the two are indistinguishable. Every day after that they diverge, and the divergence is the whole subject of this question. ## Direction one: fixes stop arriving The template is not finished. It gets narrowed when someone realises the build token was over-scoped; it gains an attestation stage; an unsafe interpolation of untrusted text into a shell step gets removed. Each of those is a security fix, and each reaches only the pipelines that resolve the template at build time. A copy is frozen at its cloning date and keeps running the old behaviour indefinitely. What makes this dangerous rather than merely untidy is that nothing fails. The copied pipeline goes green every day. Staleness in a pipeline has no natural symptom, so the drift is discovered by an audit, an incident, or not at all. A central fix therefore has a *distribution* problem, not an authoring problem — writing the fix is the easy half. ## Direction two: the platform team goes blind Copies are also invisible upward. Ask a platform team how many services sign their release artifacts and, in a copy-based estate, the honest answer is that nobody knows: the only way to find out is to read several hundred repositories. Worse, a copy is *editable*. Under deadline someone comments out the scanning step, or loosens a permission, and no reviewer with security context ever sees that change, because it happens inside a service repository where the reviewers are the service team. ## What a versioned reference buys - **One source of truth.** The control lives in one place, is reviewed by the people who own it, and is changed once. - **A version number as telemetry.** Every build can record which template version it resolved. Adoption becomes a query instead of a survey, and you can see the *distribution* of versions across the estate, not just presence. - **Deliberate upgrades.** Moving from one version to the next is a reviewable change with a changelog, not a manual re-copy nobody will ever perform. - **A deprecation lever.** A version can be marked end-of-life, then warned on, then failed. A copy offers no such handle. ## The tension to be honest about Referencing means the platform team can change what executes in your pipeline without your review. That is exactly the point, and it is also a genuine risk: the template is code that runs in every build, which makes it a single point of compromise. The answer is not to copy; it is to treat the template as production software — restricted write access, review on changes, its own tests, released versions, a changelog. Consumers then choose how tightly to bind, trading currency against stability, and the platform team keeps a way to move them forward. ## When a copy is legitimate Sometimes a service genuinely needs a shape the template cannot express. The first move is to contribute the capability upstream so the next team gets it too. If a copy really is the answer — an emergency, or a one-off build shape — make it an exception with a named owner, a recorded reason and a return plan, and count it in the adoption report as *not adopted* rather than quietly as a success. ## How this gets asked Interviewers usually pose it as a small concrete scene: your CI config was copied from the platform team a year ago, what is the risk. A weak answer talks about duplication and maintenance effort. A strong answer names both directions — fixes that never arrive, and edits nobody sees — and then says how you would measure which repositories are on which version.
- When is vendoring a copy of the shared template actually the right call?When the service needs a build shape the template cannot express, or during an emergency you cannot wait out. Even then, contribute the capability upstream first if you can. If the copy stands, it needs a named owner, a written reason, and a date to return, and it must appear in the adoption report as not adopted rather than being quietly counted as compliant.
- How would you find out how many repositories are on which template version?Two ways, and you want both. Scrape the CI configuration across repositories through the code host's API for the reference and its version. Better, have the template itself record the version it resolved as metadata on every build, so each pipeline reports its own version continuously instead of you inferring it from source that may not be what ran.
- The copy has been drifting for a year. How do you get it back onto the template?Diff the copy against the template first: the differences are either fixes the copy missed, or local changes the team needed. The first group is why you are migrating; the second is a requirements list for the template. Absorb what is legitimate upstream, then have the platform team raise the migration change itself rather than filing a ticket asking the team to do it.
A reference is a subscription; a copy is a printout. Both read the same on day one, and only one of them tells you when the text changed.
saying these in an interview costs you the question
- Treating it as code duplication rather than a missed-fix problem
- Assuming a passing pipeline proves the controls are current
- Claiming coverage across the estate with no version telemetry
- Believing a copy is safer because it cannot change unexpectedly
- Counting repositories that reference the template at any version as adopted