Runbook — Updating the pipeline after a template refresh
When to use it: after running
irm | iex(an Ovillo update) on a project that already has CI/CD (phase 1/2). Theirmrefreshes the tooling (.claude/, including the pipeline templates of thecicd-architectskill), but it does NOT touch yourazure-pipelines.yml, which is an artifact that was already generated. For your pipeline to pick up the latest (new G1-G19 invariants, coverage gate, security gate, HTML report, branch-gated, and so on) you have to regenerate it with/hv:cicd-init(idempotent edit mode).Audience: developer on the consuming project. Platform: Azure DevOps (Server or Services) or GitHub Actions; on GitHub the file is
.github/workflows/cd-<slug>.ymland the self-check takes-GitHub.
0. Prerequisites
- The
irm | iexfinished OK (update mode; a non-destructive refresh of.claude/). - Tooling version up to date:
VERSION.json(or a session banner with no^updatemarker). -
git statusclean (or only your own uncommitted changes) before regenerating. - You know which stack your project is:
.NET(dotnet/SDK-style),.NET Framework 4.8(netfx), Vue+Vite (spa) or.NET tool. Template improvements are usually per stack.
1. Regenerate the pipeline
- Open Claude Code at the root of the project and run:
/hv:cicd-init. - It must detect the existing pipeline → it goes into EDIT mode (PHASE 0.5), not a fresh install.
- Choose option 4, "Update the whole YAML to the latest template". This re-renders the WHOLE YAML from the template (it does NOT patch line by line) and re-applies your
# CUSTOM:blocks. - Confirm that it detected your stack correctly.
2. Review the DIFF before accepting (KEY STEP)
Regenerating brings everything accumulated since you generated your pipeline, not just the last change. Check:
- The coverage gate (R18) uses
- template: steps/coverage-gate.yml→ops/cicd/scripts/coverage-gate.ps1(a script from the repository, materialized by/hv:cicd-init; no external tools and no feeds). - The R18 gate gates on line/branch (
-ThresholdLine/-ThresholdBranch), WARN-first (-Mode blockto block); it does not compute CRAP (that is published by the quality record in the Hub, see step 4). - (.NET stack)
dotnet testemitsFormat=cobertura,opencoverplus the HTML report steps (ReportGenerator) and PublishCoverageReport(additive,continueOnError, it does NOT gate). - The security gate (R22) is wired in (scan on build + verdict on deploy).
- YOUR customizations are still there (IIS paths/
iisPhysicalPath, test projects, secrets through a variable group, and so on). If they are not inside# CUSTOM: ... # /CUSTOMblocks, re-apply them. - Nothing forbidden sneaks in (R1/Azure DevOps table):
deploymentGroup,Cache@2,DeployEnvinvariables,pool.namepointing at a deployment pool, and so on.
2-bis. Completeness self-check (KEY STEP — h13)
The command runs validate-pipeline-complete.ps1 (PHASE 2.8) after regenerating: it checks that the YAML contains all the canonical steps of the template (it derives the markers from the template itself). This prevents the partial-edit failure (regenerating halfway and leaving out new steps such as the R18 gate or the CoverageReport HTML report).
- The self-check comes out green (exit 0). If it comes out red (exit 1) it lists the missing steps → do not accept the change: re-render (full option 4) until it passes. The command must not finish with the self-check in red.
- A legitimate exception: if you removed optional steps on purpose (no test project → no R18 gate; no
/health→ best-effort smoke), those missing markers are expected (the command exempts them with-Allow). Any OTHER missing one really is an incomplete regeneration. - The YAML carries a template stamp in its header (
# Ovillo cicd-architect <stack> @ vX.Y.Z (tpl <hash12>) ...). Thetpl <hash12>token is the content hash of the stack's template:/hv:cicd-statusonly warns about drift if that template really changed (not on every release). If it warns, come back to this runbook. (Pipelines stamped by an older version carryzip <sha12>; a re-render migrates them.)
3. Apply and publish
- Accept the change (a backup is left at
.azure-pipelines.bak.<date>.yml→ your immediate rollback). -
git add azure-pipelines.yml(+steps/*.ymlif they were regenerated). -
git commit -m "ci: pipeline up to date with the latest Ovillo template". -
git push→ triggers the build.
4. Verify in the build
- Log of the G7/R18 gate:
G7: coverage line=..% branch=..%(confirms the script ran and which XML it read). - (.NET stack) the HTML report step green; the
CoverageReportartifact published (HTML with coverage and, if there is OpenCover, CRAP / complexity / risk hotspots). - R18 gate = WARN on line/branch (it does not block by default).
- R22 gate (security) according to the environment (DEV WARN / PRE-PROD BLOCK, or WARN for brownfield).
- The build overall green.
5. If something fails
| Symptom | Likely cause | Action |
|---|---|---|
| HTML report without CRAP/hotspots | The report was generated from Cobertura, not OpenCover | Check Format=cobertura,opencover and that ReportGenerator receives the *.opencover.xml |
The gate reports SKIPPED | There is no coverage XML under $(Agent.TempDirectory) | Check --settings ops/testing/coverlet.runsettings on dotnet test |
| A false 0% coverage | FINDING H: $(Agent.TempDirectory) is not cleaned between builds | The regenerated YAML already cleans *cobertura/*opencover.xml before the test and sorts by LastWriteTime |
The build does not queue (notStarted) | The pipeline is not authorized for the configured pool (cicd.buildPool) | "Permit" in the banner / pool admin (TEC-003) |
dotnet test says "No test result files" | --results-directory was added to the args | Do NOT add it: the task already injects it (TRAP, FINDING H) |
- Rollback: restore
.azure-pipelines.bak.<date>.yml+git checkout azure-pipelines.yml. - Record any ecosystem problem in
_hilo/FEEDBACK_ECOSISTEMA.md(FB-XXX) →/hv:hub-client.
Notes
- The HTML coverage report is additive and
continueOnError: in the worst case the artifact does not appear, but it never takes the build down and never changes the gate. - To avoid regenerating everything (just to apply one specific change), you can edit
azure-pipelines.ymlby hand and ask thecicd-pipeline-revieweragent to audit it against G1-G19. But/hv:cicd-init(edit mode) is the canonical, idempotent path. - See also:
AUDITAR_PIPELINE.md,GUIA_FASES_ADOPCION.mdand thecicd-runtimerule (G1-G19).
_patron/08_CICD — Ovillo. Runbook for updating a pipeline after a template refresh.
Fuente: ovillo/_patron/08_CICD/RUNBOOK_ACTUALIZAR_PIPELINE_EN.md