Skip to main content

Release playbook: from sandbox (t) to live (p)

Status: draft for review. Decisions in B6 are open; nothing here has been run.

This is how we ship a new version of the storefront app from finmatch-t (test) to finmatch-p (live), every time. Part A is the standing process. Part B applies it to this release (WHLS, eligibility screen v1).


0. The short version​

  1. Build and prove it in sandbox (t). Use the sandbox preview link on real merchants. Shoppers never see t.
  2. Cut a release candidate. A release branch from p, with t merged in, conflicts resolved, and the full test suite green.
  3. Rehearse it with copies of real merchants' configs, never their live traffic.
  4. Go/no-go, against a written checklist.
  5. Deploy to p, staged. Hold every merchant on the current release, move a few to the new one, watch, then move the rest.
  6. Rollback is always one command. Point the channel back at the previous release. Every merchant on it returns in about 30 seconds.
  7. Back-merge. Anything fixed directly on p goes back into t the same day, so the branches never drift again.

Part A: the standing process​

A1. What we have, in plain English​

PieceWhat it isWho sees it
finmatch-t (test / feature track)Storefront code under test, synced to gs://finmatch-t. Also where a merchant's sandbox config fork lives (sandbox preview copies its p config into t).Our test merchants, plus anyone holding a merchant's sandbox preview link.
finmatch-s (staging)A second test copy. Synced to gs://finmatch-s. Unused since mid-August, so it's ~4 months stale.Nobody today.
finmatch-p (live)The storefront code real shoppers run. Each deploy publishes an immutable release (releases/p-YYYYMMDD-HHMM-sha).Every live merchant.
Release channelsA named pointer that tells merchants which release to load. merchant-api accepts two names only: live and beta (runtime-channels.js). ~140 of 142 merchants are on live (figure from August; re-check with GET /admin/runtime-channels → .merchants). Every p deploy moves every existing channel to the new build (sync-to-gcs.yml, "Advance runtime release channels"). A merchant not on a channel reads the env bucket, so it gets a new p build the moment it's deployed.Controls what live merchants run.
finmatch-sharedAdmin, and the source of the shared services. merchant-api, finance-assistant and credit-products-api deploy from GitHub Actions. getMerchantConfig has no workflow: it's deployed by hand. Shared data: merchant profiles and promotion grants (finmatch-secrets/merchants.json, merged in by getMerchantConfig), the promotions catalogue and the rate card (gs://finmatch-shared, written by credit-products-api).Every environment at once.

The lesson from this morning. The storefront code is separated by environment, but the services and data are shared. A WHLS grant on Hewer FM is stored once, for every environment. getMerchantConfig served it to live as well as sandbox, and live's older code showed the WHLS products as ordinary finance.

So the first rule of this playbook:

Rule 1: Every shared service must know which environment it is serving. Anything new that only sandbox should see must be gated explicitly: by sandbox token, by environment, or by a setting such as SCHEME_PRODUCTS_ENVIRONMENTS. Reviews check this on every PR that touches a shared service.

A2. Do we still need finmatch-s?​

Short answer: keep it for this one release, then retire it. Use a staged rollout on live via release channels instead.

OptionForAgainst
Three environments (t, s, p), with s as rehearsalRehearse the exact release candidate away from live.A third branch to keep in sync; it already drifted 4 months. s reads its own lender styling, not the shared one, so it isn't a faithful copy of p. Moving a real merchant onto s reroutes all its shoppers. It doesn't prove the thing that matters: the real p build serving real p configs.
Two environments (t, p) plus staged rolloutWhat larger SaaS teams do: test, then a canary on production. Release channels already exist. The real build is proven on a few merchants before everyone. Rollback is one write. Less to maintain.Needs one small workflow change: about 9 lines in sync-to-gcs so a deploy can hold the live channel instead of advancing it. (Today it advances every channel; the hold is not built yet.) Merchants not on a channel get the new code at once, so we must confirm that count is ~0.

Recommendation. Two environments plus staged rollout, as the standard from the next release.

For this release, use s once as a rehearsal, because the merge is unusually large (about 75 conflicts). Then retire s:

  • archive the branch;
  • leave the bucket read-only for 30 days;
  • then delete it.

The sandbox preview link stays the main tool for testing a merchant's changes.

A3. The release, step by step​

Each step has an owner, a check, and a rollback. Nothing touches p without James's sign-off on that step.

#StepOwnerCheck before moving onRollback
1Freeze t. Launch fixes only.JamesAnnounced to agents.n/a
2Release branch release/YYYY-MM-DD from p; merge t in. Resolve conflicts by the rules in A4.Engineer agentEvery conflict listed with the side taken and why. CI green, including runtime-import-check.Delete the branch.
3Review at the exact head.ReviewerNothing High or Medium. The p-only fixes list (A4) is all present.Fix and re-review.
4Rehearse. Release candidate plus copies of 4–6 representative merchants under test IDs (see A5).Engineer, then JamesEvery feature on every rehearsal merchant behaves as on live today. Promotions only where Show on site is on and the environment allows.Nothing live was touched.
5Go/no-go against the checklist (A6).JamesAll boxes ticked.Stop.
6Deploy to p, holding live. Merge the release branch into p. The deploy publishes the new release and advances beta, while live stays on the old one. Needs the sync-to-gcs hold option (B3). Until it ships, a p deploy advances every channel, live included, and steps 6–7 can't be staged.JamesThe new release exists. Every live merchant still loads the old release (spot-check 3).Nothing moved.
7Canary. Move our test merchant plus 1–3 real merchants onto the beta channel, which now points at the new release. One merchant at a time, paced as in the egress runbook: each assignment rewrites one shared file.JamesTheir real sites work end to end. Watch for 30–60 min.Move them back to live.
8Everyone. Point live at the new release.JamesSpot-check 5 merchants of different types. Watch errors and applications for 2 hours.PUT /admin/runtime-channels/live back to the previous release (~30 s for everyone).
9Back-merge p into t. Unfreeze t.Engineert and p have no differences apart from the release.n/a

Important (H spotted this): the rollback has to point the channel back, not delete it. After a deploy, the env bucket already holds the new code. So deleting the live channel would not roll anyone back. Always write down the previous release ID before step 6.

A4. Merge rules (for any t→p merge)​

  • p's live fixes always survive. We keep a written list: the server-only reference mint, TE-only products, not-authorised merchants, pay-monthly mounting, the feedback modal, the Wix viewport, Propensio's decision return, and so on. Each release confirms each item is present.
  • One change at a time on behaviour live merchants feel. Where t changed a live behaviour without it being the point of the release, keep p's behaviour unless James decides otherwise. Example: the hand-off hold (4 s → 1.5 s).
  • Never commit configs/finmatch-merchant-config.json. The deploy refuses to run if it changes. Merchant settings go in through admin.
  • Imports must resolve. A file taken from one side must not break an import on the other. Propensio is the known trap.
  • Promotion-only products never appear in a standard journey (Rule 2, below).

Rule 2: Promotion-only products stay in promotions. A product flagged promotion_only is never shown or applied for in a standard journey.

  • Live today: the flag on the product (credit-products-api), and the server's Zopa Start check, which refuses a standard application with it (zopa_start_gate.js).
  • Not yet: the storefront's standard product list doesn't read the flag. That comes with this release (B3).
  • Related but separate: getMerchantConfig adds a scheme's products only where the eligibility check runs (SCHEME_PRODUCTS_ENVIRONMENTS, #1136).

A promotion can also include ordinary standard products. WHLS includes three 0% Zopa products (zo0000-036M/048M/060M-HI) that 12+ live merchants offer as standard finance. Those are not flagged. Only products that exist solely for the scheme are flagged: ZO0360-084M and ZO0360-120M, the 3.6% WHLS rates.

A5. Rehearsal merchants (standing list)​

Choose merchants that cover every feature live depends on. Use copies under test IDs, never the merchants' live traffic.

MerchantCovers
Go Off Road Barnsley (FM-6420-8173-0952)E-commerce modal, pay-monthly message, finance nav, several lenders
Hewer FMFinance Assistant, plus sandbox and a WHLS grant (this morning's case)
Absolute Motocross (FM-4821-6395-2746)Pay-monthly message, Finance Assistant, several lenders
Altum Organisation (FM-8371-5029-3648)Finance Assistant
Green Energy (M000106)WHLS: eligibility screen, scheme products, Zopa
FINMATCH TEST SITE (FM-1234-5678-9101)Our own end-to-end, including a sandbox Zopa application

For each one, check:

  • page load;
  • each feature present and styled;
  • product list correct, with no promotion products in standard journeys;
  • deposit behaviour;
  • Apply or Start to the lender's sandbox;
  • emails arrive;
  • no console errors.

A6. Go/no-go checklist (standing)​

  • Release branch reviewed at its exact head; nothing High or Medium.
  • CI green, including runtime-import-check and the money and time guards.
  • p-only fixes list confirmed present.
  • Rehearsal passed on every merchant in A5.
  • Shared-service settings for this release decided and written down (for example SCHEME_PRODUCTS_ENVIRONMENTS, PROMOTION_HANDOFF_MODE_LIVE).
  • Previous release ID written down; rollback command ready in a shell.
  • Pre-flight: GET /admin/runtime-channels → .merchants read and written down (onReleaseChannel, onEnvBucket, byChannel). onEnvBucket should be ~0: those merchants get the new build the moment it deploys and can't be held or rolled back by a channel.
  • Shared-service changes in this release deployed separately and checked. getMerchantConfig has no deploy workflow: deploy it by hand, dark, with a tag, compare, then move traffic. Rollback is moving traffic back to the previous revision.
  • If the release changes a workflow, ./scripts/deploy-workflow.sh --yes has been run so the env branches carry it.
  • Watch owner named for 2 hours after step 8 (James, unless delegated), with what they watch:
    • getMerchantConfig logs (errors, fallbacks);
    • finance-assistant Starts and refusals;
    • promotion log emails;
    • two or three merchant sites by hand.

A7. New or retired public hostname​

Any release that adds a *.finmatch.io hostname (or retires one) follows the checklist in Public edge, in one change:

  • DNS: an A record to the load balancer IP in GoDaddy; no AAAA record.
  • URL map: host rule in platform/load-balancer-url-map.yaml, applied by hand with gcloud compute url-maps import. Merging does not apply it.
  • Certificate: a managed certificate covering the host, attached to the HTTPS proxy and ACTIVE. An unattached certificate never provisions; this is what broke partner.finmatch.io (Dec 2026).
  • Verified in Safari and with openssl s_client; uptime check added.
  • Public edge page updated in the same PR.

Part B: this release (WHLS + eligibility screen v1)​

B1. What H found (trial merge, read-only)​

  • About 75 conflicts in 20 files, in the calculator, deposit and lender-start code. They are not mechanical: t rewrote deposits and product checks, and p has live fixes in the same lines.
  • It changes every merchant, not just WHLS ones: the deposit rewrite, the Apply lock, the hand-off timing and some CSS.
  • Traps:
    • committing the merchant config file fails the deploy;
    • taking t's deposit file as it is breaks Propensio for everyone;
    • Zopa defaults to its sandbox unless the merchant's config says live.
  • finmatch-s is p as of mid-August, so it must be reset to the release candidate before any rehearsal.

B2. Before the release, already in hand today​

  1. #1136: getMerchantConfig scheme products only where the eligibility check runs. Cleared; James merges, deploys dark, checks Hewer FM, then moves traffic.
  2. Promotion-only flag set on the two WHLS-only products, ZO0360-084M and ZO0360-120M (C's admin setting, today). It is a backstop: standard applications using them are refused on the next Start after saving, with no deploy. The scheme's three 0% products stay standard (see Rule 2).
  3. Admin clean-up done: #1134 (Placement) and #1135 (old builder deleted) merged.

B3. Items to add to the release branch​

  • Standard journeys exclude promotion_only products (Rule 2), with a test.
  • The sync-to-gcs hold option, so a p deploy can leave live where it is and advance only beta (about 9 lines; with nothing set, it behaves as today). Steps 6–7 depend on it.
  • Keep p's 4 s hold for Snap, Humm and Propensio. Zopa uses the queue hand-off (PROMOTION_HANDOFF_MODE_LIVE=queue).
  • Make promotion-eligibility-preview-context.js environment-aware (it hard-codes finmatch-t).

B4. Settings at go-live (shared services)​

SettingNowAt go-live
SCHEME_PRODUCTS_ENVIRONMENTS (getMerchantConfig)tt,p once the beta canary passes
PROMOTION_HANDOFF_MODE_LIVE (finance-assistant)inlinequeue, with or before the deploy
Green Energy's Zopa environmentsandboxlive, through admin
Gzip for poffdeferred (H's advice)

B5. Realistic timing​

StageEstimate
Release branch: merge and resolve about 75 conflicts carefully2–3 h
Review1 h
Rehearsal on s with the six merchants1–2 h
Go/no-go, deploy holding live, beta canary1 h
Everyone on the new release15 min, then 2 h of watching

Earliest sensible time for everyone live: late afternoon today if nothing goes wrong; more realistically tomorrow morning. Noon today isn't achievable without skipping the rehearsal, and this morning showed exactly what rehearsals catch.

B6. Decisions (James, 30 Nov 2026)​

  1. Standard from now on: two environments (t, p) plus a staged rollout on release channels. Agreed.

  2. finmatch-s: reset to the release candidate and used once to rehearse this release, then retired. Agreed.

  3. Hand-off hold: Snap, Humm and Propensio keep p's 4 s for this release. The rule is 1.5 s only where the queued promotion hand-off exists, and today only Zopa and Propensio write that record; Snap and Humm hand off inline. Zopa starts at once (0.5 s minimum on screen) and uses the queue hand-off (PROMOTION_HANDOFF_MODE_LIVE=queue). Revisit after launch: Propensio could move to 1.5 s; Snap and Humm need the queue first.

  4. beta merchants (real live merchants that get the new build first), alongside our test merchant:

    • Not on WHLS (must be unaffected): Go Off Road Barnsley (FM-6420-8173-0952: e-commerce modal, pay-monthly message, finance nav, several lenders) and Absolute Motocross (FM-4821-6395-2746: pay-monthly message, Finance Assistant, several lenders).
    • On WHLS: Altum Organisation (FM-8371-5029-3648), Hewer FM (M964503: Finance Assistant), Nano-Pro (nano-pro.tech) and Complete Home Energy Solutions (completehomeenergysolutionsltd.co.uk).

    These are also the rehearsal merchants (A5), plus Green Energy.

  5. Go/no-go time: set once the rehearsal passes.

Once you agree the plan, I'll turn it into H's brief, and the playbook goes into admin-docs/ as our permanent release process.