|
| 1 | +--- |
| 2 | + title: 0018 Align BE / FE unstable releases |
| 3 | + adr: |
| 4 | + author: Oleksandr Prokhorenko |
| 5 | + created: 21-Oct-2025 |
| 6 | + status: draft |
| 7 | +--- |
| 8 | + |
| 9 | +## Context |
| 10 | + |
| 11 | +Our current deployment practices create instability and coordination problems: |
| 12 | + |
| 13 | +1. **Shared environment blocking**: The `dev` environment frequently gets blocked by specific versions (e.g., fund15) |
| 14 | +that teams want to stabilize and test, preventing other work from being deployed and tested. |
| 15 | + |
| 16 | +2. **Version traceability**: When issues occur, it's difficult to identify which version caused the problem |
| 17 | +because deployments weren't tied to explicit release tags. |
| 18 | + |
| 19 | +3. **Test environment accessibility**: Alternative test environments exist but require manual setup and |
| 20 | +training, making them not straightforward for general use. |
| 21 | + |
| 22 | +4. **Breaking changes in main**: Large breaking changes (like API V2) merged to `main` cause problems |
| 23 | +for both teams - backend loses ability to release from `main`, and frontend can't deploy without breaking changes. |
| 24 | + |
| 25 | +We agreed (Oct 13, 2025 discussion) to standardize on **releasing from tags only (not every merge)** for both BE and FE, |
| 26 | +with **feature-branch environments** for testing larger breaking changes before they land in `main`. |
| 27 | + |
| 28 | +## Assumptions |
| 29 | + |
| 30 | +* **OpenAPI** is (and remains) our single source of truth for public HTTP APIs. |
| 31 | +* Teams accept **spec-first** changes: spec updates land in PRs **before** code changes. |
| 32 | +* CI/CD can: |
| 33 | + * compute **breaking diffs** between the current spec and the last released spec, |
| 34 | + * run **spec conformance tests** against a running provider. |
| 35 | +* We can operate **channelized promotions** (unstable → testing → stable) and **preview envs** per PR/feature branch. |
| 36 | +* Weekly **release train** (lightweight) is acceptable; hotfixes remain possible. |
| 37 | + |
| 38 | +## Decision |
| 39 | + |
| 40 | +Adopt an **OpenAPI-driven, spec-first release model** with **tag-based deployments** to align BE(s) and FE: |
| 41 | + |
| 42 | +### Core Principle: Deploy from Tags, Not from Main |
| 43 | + |
| 44 | +Both backend and frontend will **only deploy tagged releases** to shared environments (`dev`, `qa`, `prod` and `feature env`). |
| 45 | +This ensures: |
| 46 | + |
| 47 | +* Explicit version tracking for troubleshooting |
| 48 | +* Controlled, coordinated releases between teams |
| 49 | +* Ability to keep environments stable during critical testing periods |
| 50 | + |
| 51 | +### 1. **Spec-first PRs** |
| 52 | + |
| 53 | +* Any API change updates `openapi.yaml` in the backend repo first. |
| 54 | +* FE + BE reviewers required on spec-changing PRs. |
| 55 | + |
| 56 | +### 2. **Breaking-change gate (OpenAPI diff)** |
| 57 | + |
| 58 | +* CI compares PR's `openapi.yaml` to the **last released tag's** spec; **breaking diffs fail** the PR. |
| 59 | +* Large breaking changes (like API V2) **must not merge to `main`** until ready for general deployment: |
| 60 | + * Use long-lived feature branches (e.g., `feat/api-v2`) |
| 61 | + * Deploy feature branches to dedicated preview environments for testing |
| 62 | + * Only merge to `main` when both BE and FE are ready to adopt the changes |
| 63 | +* Smaller breaking changes must ship as **vN → vN+1** with coexistence of vN for one train, |
| 64 | + or be adapted via a temporary shim at the gateway. |
| 65 | + |
| 66 | +### 3. **Explicit backend version pinning** |
| 67 | + |
| 68 | +* Frontend explicitly tracks which backend tag/version it is compatible with (e.g., via environment config or documentation). |
| 69 | +* FE upgrades to work with new backend versions are explicit and coordinated (not automatic). |
| 70 | + |
| 71 | +### 4. **Provider conformance tests** |
| 72 | + |
| 73 | +* Backend CI runs **conformance tests** validating real responses against the OpenAPI schemas for |
| 74 | + critical endpoints (e.g.,Schemathesis runs). |
| 75 | +* Release promotion requires green conformance. |
| 76 | + |
| 77 | +### 5. **Environment strategy & promotions** |
| 78 | + |
| 79 | +* **Shared environments (`dev`, `preprod`, `prod`)** only receive tagged releases: |
| 80 | + * `dev`: latest unstable tagged release |
| 81 | + * `qa`: promoted release candidates |
| 82 | + * `prod`: production-ready releases |
| 83 | +* **Preview environments** for: |
| 84 | + * PRs requiring integration testing |
| 85 | + * Long-lived feature branches with breaking changes (e.g., API V2, fund15) |
| 86 | + * Must be easily accessible without special training |
| 87 | +* Artifacts flow **unstable → testing → stable**; FE E2E smoke runs against **testing** before promotion to **stable**. |
| 88 | +* **Weekly release train** (lightweight, e.g., Wed 14:00 CET) promotes what's ready from testing → stable across BE/FE. |
| 89 | + |
| 90 | +### 6. **Versioning & deprecation** |
| 91 | + |
| 92 | +* Prefer **path or header versioning** (`/api/v1`, `/api/v2` or `Accept: application/vnd.catalyst.v2+json`). |
| 93 | +* Mark deprecated fields in the spec and keep **vN-1** available for **one train** with an explicit removal date. |
| 94 | + |
| 95 | +## Risks |
| 96 | + |
| 97 | +* **Spec discipline**: If engineers forget to update the spec first, the guard loses value. |
| 98 | +* **False negatives**: Diff rules must be tuned; overly permissive settings could miss meaningful breaks. |
| 99 | +* **Infra & process**: Preview envs add CI complexity; preview environments must be made easily accessible without training. |
| 100 | +* **Version coordination**: Without automated SDK generation, FE and BE teams must manually coordinate compatible versions; |
| 101 | +risk of version mismatches. |
| 102 | +* **Cultural shift**: Teams must adapt to tag-based releases instead of continuous deployment |
| 103 | +from `main` (especially FE team). |
| 104 | +* **Feature branch discipline**: Long-lived feature branches increase merge complexity; |
| 105 | +teams must actively keep them up-to-date with `main`. |
| 106 | + |
| 107 | +## Consequences |
| 108 | + |
| 109 | +* **Fewer FE breakages**: Breaking server changes are either **blocked** or **versioned**; |
| 110 | +coordinated releases ensure compatibility. |
| 111 | +* **Better traceability**: Changes tie to **explicit tags** and versioned clients; when issues occur, |
| 112 | +teams can immediately identify which version caused the problem. |
| 113 | +* **Unified deployment process**: Both BE and FE follow the same tag-based deployment model, |
| 114 | +eliminating environment drift. |
| 115 | +* **Stable shared environments**: Teams can keep critical versions stable in `dev` for testing without |
| 116 | +blocking other work (which moves to preview envs). |
| 117 | +* **Faster feedback**: Conformance tests + preview envs fail early. |
| 118 | +* **Predictable cadence**: Weekly train synchronizes cross-repo releases. |
| 119 | +* **Main stays releasable**: By keeping breaking changes in feature branches until ready, |
| 120 | + `main` remains in a deployable state. |
| 121 | +* **Gateway shims minimized**: Only exceptional, time-boxed use with explicit sunset. |
| 122 | + |
| 123 | +## KPIs |
| 124 | + |
| 125 | +* **0** critical FE outages caused by BE API changes over 2 trains. |
| 126 | +* **≥90%** of FE critical paths covered by schema-backed conformance tests. |
| 127 | +* **Mean time tag → stable ≤ 5 days** (including testing dwell). |
| 128 | +* **80% reduction** in “dev is blocked” incidents. |
| 129 | + |
| 130 | +## Ownership |
| 131 | + |
| 132 | +* **Release captain (weekly, rotating)**: runs the train and promotions. |
| 133 | +* **Spec owners**: maintain `openapi.yaml`, review gates. |
| 134 | +* **FE/BE owner**: coordinates FE/BE version compatibility and upgrades. |
| 135 | +* **Env/platform owner**: preview env automation & channel promotions. |
| 136 | + |
| 137 | +## More Information |
| 138 | + |
| 139 | +* Drivers and context from **Monday's Technical Discussion** (Oct 13, 2025) - |
| 140 | +[meeting transcript](https://docs.google.com/document/d/16rnXxr6z3WwWBB0EYlffef8cbqRrPzC8DXJhdKevedw/edit?usp=sharing). |
| 141 | +* Key insight from discussion: "We should just deploy from releases and rely on releases only. |
| 142 | +At least it would make life easier in that sense that if something bad happened we will definitely know what was the version." |
0 commit comments