Release B: demos per client (history-preserving create-session.sh, democtl promote/reseed) #8

Open
opened 2026-10-16 00:18:49 -04:00 by jfraeys · 0 comments
Owner

Full spec: docs/separation-plan.md on branch site-separation, section "5. Demos per client" ("Release B: client demos"). Starts once Release A's site-repository contract is stable (see the companion issue for Release A step 4) — the plan explicitly scopes this as starting only once that's done, not in parallel.

A demo is created from a site repository plus a git ref, not a copy of dev-content/. Variants of one client's site are branches/tags in that client's own repository (e.g. site-acme with main, warm-palette, minimal-layout, a frozen pitch-oct20 tag) — they share history, so git diff main warm-palette shows exactly what differs, and adopting a variant is an ordinary merge.

Demo creation (create-session.sh --site <repo> --ref <branch|tag>, defaulting to site-sample/main):

  1. Clone the source repository at --ref, record the resolved commit.
  2. Create coaching-demos/demo-<token> and push the source's real history as its main — replacing bootstrap_content_repo's current git init + single synthetic commit. This is the key behavior change: a session repo shares history with its source, so democtl promote later is an ordinary merge, not a history graft.
  3. Write .demo-seed in the session directory (source repository, ref, resolved commit).
  4. Check out the session repository as repo/site and build. Admin Publish (PUBLISH_MODE=backup) pushes only to demo-<token>, never back to the source.

Recreating with an existing --token keeps today's behavior: restore from demo-<token>, ignoring --site/--ref.

Scripts needing changes (per the plan, all currently still reference dev-content/--content-root, which no longer exists on build-site.sh — demo sessions are hard-broken on site-separation until this lands):

  • create-session.sh — the rewrite above.
  • refresh-session.sh — rsync exclude dev-content → site; never touches repo/site; drop --content-root dev-content from its build-site.sh call.
  • refresh-base.sh, expire-session.sh, demo-session-gc.sh — comment-only references, no functional change needed.
  • demo.env.j2 / ansible defaults — add the default --site/--ref source config and its read credential.

CLI (cmd/democtl):

  • democtl create [--site <name>] [--ref <ref>], passed through to create-session.sh.
  • democtl list/status show each session's site, ref, commit from .demo-seed.
  • democtl promote <token> --to <site-repo>:<branch> — push the session's main to a branch of a site repository (creating it if needed for a site-sample-seeded prospect). Never force-pushes: fetches the target's current tip, refuses if the target branch exists and isn't an ancestor of the session's tip (reports both SHAs and the manual commands instead), otherwise a plain non-force push.
  • democtl reseed <token> — resets the session repo to the commit recorded in .demo-seed (not the current source branch tip) and rebuilds. Destructive, requires confirmation.
  • Infrastructure repo: ./manage demo create needs to forward --site/--ref — track that change there explicitly when this lands.

Prospect workflow this enables: start from site-sample or a new site-<prospect>, add variants as branches, compare side by side with one session per variant, keep edits via democtl promote, and merge into main when they sign — shared history makes that merge often a fast-forward.

Also fixes, as part of the same script changes: sitectl/compatci are missing from the CI-built/checksummed binary pipeline (deploy_artifact.go allowlist, cd.yml build/upload loop, ansible deploy.yml/demo_sessions.yml, Makefile build-release, deploy.sh's deployswap staging) — build-site.sh fails closed without ./bin/sitectl, so demo (and production) builds fail on this branch until that's in place too.

Full spec: `docs/separation-plan.md` on branch `site-separation`, section "5. Demos per client" ("Release B: client demos"). Starts once Release A's site-repository contract is stable (see the companion issue for Release A step 4) — the plan explicitly scopes this as starting only once that's done, not in parallel. A demo is created from a **site repository plus a git ref**, not a copy of `dev-content/`. Variants of one client's site are branches/tags in that client's own repository (e.g. `site-acme` with `main`, `warm-palette`, `minimal-layout`, a frozen `pitch-oct20` tag) — they share history, so `git diff main warm-palette` shows exactly what differs, and adopting a variant is an ordinary merge. **Demo creation** (`create-session.sh --site <repo> --ref <branch|tag>`, defaulting to `site-sample`/`main`): 1. Clone the source repository at `--ref`, record the resolved commit. 2. Create `coaching-demos/demo-<token>` and push the source's **real history** as its `main` — replacing `bootstrap_content_repo`'s current `git init` + single synthetic commit. This is the key behavior change: a session repo shares history with its source, so `democtl promote` later is an ordinary merge, not a history graft. 3. Write `.demo-seed` in the session directory (source repository, ref, resolved commit). 4. Check out the session repository as `repo/site` and build. Admin Publish (`PUBLISH_MODE=backup`) pushes only to `demo-<token>`, never back to the source. Recreating with an existing `--token` keeps today's behavior: restore from `demo-<token>`, ignoring `--site`/`--ref`. **Scripts needing changes** (per the plan, all currently still reference `dev-content`/`--content-root`, which no longer exists on `build-site.sh` — demo sessions are hard-broken on `site-separation` until this lands): - `create-session.sh` — the rewrite above. - `refresh-session.sh` — rsync exclude `dev-content` → `site`; never touches `repo/site`; drop `--content-root dev-content` from its `build-site.sh` call. - `refresh-base.sh`, `expire-session.sh`, `demo-session-gc.sh` — comment-only references, no functional change needed. - `demo.env.j2` / ansible defaults — add the default `--site`/`--ref` source config and its read credential. **CLI** (`cmd/democtl`): - `democtl create [--site <name>] [--ref <ref>]`, passed through to `create-session.sh`. - `democtl list`/`status` show each session's site, ref, commit from `.demo-seed`. - `democtl promote <token> --to <site-repo>:<branch>` — push the session's `main` to a branch of a site repository (creating it if needed for a `site-sample`-seeded prospect). **Never force-pushes**: fetches the target's current tip, refuses if the target branch exists and isn't an ancestor of the session's tip (reports both SHAs and the manual commands instead), otherwise a plain non-force push. - `democtl reseed <token>` — resets the session repo to the commit recorded in `.demo-seed` (not the current source branch tip) and rebuilds. Destructive, requires confirmation. - Infrastructure repo: `./manage demo create` needs to forward `--site`/`--ref` — track that change there explicitly when this lands. **Prospect workflow** this enables: start from `site-sample` or a new `site-<prospect>`, add variants as branches, compare side by side with one session per variant, keep edits via `democtl promote`, and merge into `main` when they sign — shared history makes that merge often a fast-forward. Also fixes, as part of the same script changes: `sitectl`/`compatci` are missing from the CI-built/checksummed binary pipeline (`deploy_artifact.go` allowlist, `cd.yml` build/upload loop, ansible `deploy.yml`/`demo_sessions.yml`, `Makefile build-release`, `deploy.sh`'s deployswap staging) — `build-site.sh` fails closed without `./bin/sitectl`, so demo (and production) builds fail on this branch until that's in place too.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfraeys/coaching-site#8
No description provided.