diff --git a/README.md b/README.md index 7562a456..82fc582e 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,39 @@ flowchart TD --- +## Hotfix any environment + +Most pipelines can only hotfix the tip, which in practice means production. cascade hotfixes **any** environment: it stages the fix on a per-environment integration branch, deploys that one environment with a clean `-rc.N.hotfix.M` version, and rejoins trunk the next time a trunk SHA that already contains the fix is promoted. The example below lands a fix on **staging** while dev, test, and prod stay exactly where they are. + +```mermaid +%%{init: {'theme':'base','themeVariables':{'fontFamily':'ui-sans-serif, system-ui, sans-serif','primaryColor':'#0E8B82','primaryBorderColor':'#36D0C4','primaryTextColor':'#F4FBFA','lineColor':'#1F9B92','clusterBkg':'transparent','clusterBorder':'#36D0C4','tertiaryColor':'#B87333'}}}%% +flowchart TD + T["trunk tip
fix already merged (roll forward first)"] + + subgraph LADDER["Environments"] + direction LR + dev["dev"] --> test["test"] --> staging["staging"] --> prod["prod"] + end + + T -- "cherry-pick fix onto env/staging
at staging's recorded base_sha" --> CP["hotfix/staging/<short-sha>
base + fix, nothing else"] + CP --> RPR["resolution PR (base env/staging)
cascade-hotfix · auto-merge on env checks"] + RPR -- "on merge: build -> deploy staging only -> finalize" --> DS + + subgraph DS["staging diverged"] + direction TB + SV["v1.4.0-rc.2.hotfix.1
ref: env/staging
base_sha: trunk SHA · patches: [fix]"] + end + + DS -. "targets staging" .-> staging + + DS == "later promotion of a trunk SHA containing the fix
clears divergence (patch-containment guard)" ==> staging + + classDef accent fill:#B87333,stroke:#E8702A,color:#FFF7F0; + class SV accent; +``` + +--- + ## Quick start ### 1. Install the CLI diff --git a/docs/src/content/docs/workflows.md b/docs/src/content/docs/workflows.md index f249d6de..f0500c7d 100644 --- a/docs/src/content/docs/workflows.md +++ b/docs/src/content/docs/workflows.md @@ -254,6 +254,20 @@ The framework drops the RC suffix when crossing the prerelease->release boundary ## Hotfix +```mermaid +flowchart TD + RF["Roll forward first (default)
fix merged to trunk; refused if not an ancestor of trunk tip"] + RF -- "env must run base + fix only" --> IB["env/<env> integration branch
created on demand at recorded state SHA"] + IB --> CP["cherry-pick onto hotfix/<env>/<short-sha>"] + CP -- "clean" --> PRclean["resolution PR · cascade-hotfix
auto-merge, gated by env checks"] + CP -- "conflict" --> PRconf["resolution PR · cascade-hotfix-conflict
markers committed; human force-pushes head"] + PRclean --> MERGE["on merge"] + PRconf --> MERGE + MERGE --> FIN["build -> deploy one env -> finalize
vX.Y.Z-rc.N.hotfix.M · ref env/<env> · patches [fix]"] + FIN --> DIV["environment diverged
other environments untouched"] + DIV == "promote a trunk SHA containing the fix
patch-containment guard refuses dropping it" ==> REJOIN["rejoin trunk
divergence cleared · env/<env> deleted"] +``` + A hotfix applies a single trunk commit onto an environment that is pinned to an older trunk base, without dragging in the intervening commits. This is the case the standard promote flow cannot serve: promoting a pointer forward would advance the target environment past every commit between its base and the fix, which is exactly what an operator pinning that environment is trying to avoid. ### Roll forward on trunk first (the default)