From e017b612245883948021d38b22f9cfc2548fb9a9 Mon Sep 17 00:00:00 2001 From: lex00 <121451605+lex00@users.noreply.github.com> Date: Sun, 12 Jul 2026 01:28:34 -0600 Subject: [PATCH] fly: single-source the mudflaps/spritzer emulator image pins (#808 T2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The emulator tags were duplicated across flaps.ts, sprites-emulator.ts, the fly-deploy composite, and tests — and had already drifted: the activity pinned mudflaps 0.3.1 while the composite's docstring still said 0.3.0. Exactly the scatter this consolidates. Add lexicons/fly/src/op/activities/emulator-images.ts exporting MUDFLAPS_IMAGE and SPRITZER_IMAGE as the single source; point flaps.ts, sprites-emulator.ts, the composite docstring, and flaps.test.ts at it. A bump now touches one line, and the emulator-freshness check (remaining T2 half) has one target to compare against the latest GHCR release. --- lexicons/fly/src/composites/fly-deploy.ts | 2 +- .../fly/src/op/activities/emulator-images.ts | 21 +++++++++++++++++++ lexicons/fly/src/op/activities/flaps.test.ts | 3 ++- lexicons/fly/src/op/activities/flaps.ts | 5 +++-- .../fly/src/op/activities/sprites-emulator.ts | 5 +++-- 5 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 lexicons/fly/src/op/activities/emulator-images.ts diff --git a/lexicons/fly/src/composites/fly-deploy.ts b/lexicons/fly/src/composites/fly-deploy.ts index cfc460c92d..78a51f382f 100644 --- a/lexicons/fly/src/composites/fly-deploy.ts +++ b/lexicons/fly/src/composites/fly-deploy.ts @@ -36,7 +36,7 @@ export interface FlapsStepOpts { name?: string; /** Host port mapped to the emulator's `:4280`. Default: `4280`. */ port?: number; - /** Image. Default: `ghcr.io/intentius/mudflaps:0.3.0`. */ + /** Image. Default: the pinned mudflaps image (`MUDFLAPS_IMAGE`, from the flapsUp activity). */ image?: string; /** Readiness timeout in ms. */ timeoutMs?: number; diff --git a/lexicons/fly/src/op/activities/emulator-images.ts b/lexicons/fly/src/op/activities/emulator-images.ts new file mode 100644 index 0000000000..10291ceaee --- /dev/null +++ b/lexicons/fly/src/op/activities/emulator-images.ts @@ -0,0 +1,21 @@ +/** + * Single source of truth for the Fly emulator image pins (#808 T2). + * + * mudflaps (Machines API) and spritzer (Sprites API) are the local fakes fly's + * activities are exercised against. These tags were previously duplicated across + * flaps.ts, sprites-emulator.ts, the fly-deploy composite, and tests — and had + * already drifted (the composite's docstring said mudflaps 0.3.0 while the + * activity pinned 0.3.1). Pin each here so a bump touches one line and the + * emulator-freshness check (#808 T2) has a single target to compare against the + * latest GHCR release. + * + * Bump policy (#808): move these only when a consuming test needs a newer + * emulator (a fidelity fix the activities exercise), not on every emulator + * release. For new upstream API surface the emulator leads, then fly bumps here. + */ + +/** Pinned mudflaps (Fly Machines / flaps emulator) image. */ +export const MUDFLAPS_IMAGE = "ghcr.io/intentius/mudflaps:0.3.1"; + +/** Pinned spritzer (Fly Sprites emulator) image. */ +export const SPRITZER_IMAGE = "ghcr.io/intentius/spritzer:0.3.1"; diff --git a/lexicons/fly/src/op/activities/flaps.test.ts b/lexicons/fly/src/op/activities/flaps.test.ts index 2ca75b25d4..b3adae3254 100644 --- a/lexicons/fly/src/op/activities/flaps.test.ts +++ b/lexicons/fly/src/op/activities/flaps.test.ts @@ -6,11 +6,12 @@ import { flapsHealthUrl, flapsEndpoint, } from "./flaps"; +import { MUDFLAPS_IMAGE } from "./emulator-images"; describe("flaps (mudflaps) lifecycle commands", () => { test("run command uses defaults and maps the port", () => { expect(flapsRunCommand({})).toBe( - "docker run -d --rm --name chant-mudflaps -p 4280:4280 ghcr.io/intentius/mudflaps:0.3.1", + `docker run -d --rm --name chant-mudflaps -p 4280:4280 ${MUDFLAPS_IMAGE}`, ); }); diff --git a/lexicons/fly/src/op/activities/flaps.ts b/lexicons/fly/src/op/activities/flaps.ts index adb2c314a1..f54c0dcdda 100644 --- a/lexicons/fly/src/op/activities/flaps.ts +++ b/lexicons/fly/src/op/activities/flaps.ts @@ -1,11 +1,12 @@ import { emulatorLifecycle } from "@intentius/chant/op"; +import { MUDFLAPS_IMAGE } from "./emulator-images"; export interface FlapsUpArgs { /** Container name. Default: `chant-mudflaps`. */ name?: string; /** Host port mapped to the emulator's `:4280`. Default: `4280`. */ port?: number; - /** Image. Default: `ghcr.io/intentius/mudflaps:0.3.1`. */ + /** Image. Default: the pinned mudflaps image ({@link MUDFLAPS_IMAGE}). */ image?: string; /** Readiness timeout in ms. Default: `60000`. */ timeoutMs?: number; @@ -23,7 +24,7 @@ export interface FlapsDownArgs { // with FLY_FLAPS_BASE_URL. Shared lifecycle: emulatorLifecycle (#746). const flaps = emulatorLifecycle({ name: "chant-mudflaps", - image: "ghcr.io/intentius/mudflaps:0.3.1", + image: MUDFLAPS_IMAGE, containerPort: 4280, healthPath: "/_mudflaps/health", }); diff --git a/lexicons/fly/src/op/activities/sprites-emulator.ts b/lexicons/fly/src/op/activities/sprites-emulator.ts index b7fcdcce77..8c9d21983e 100644 --- a/lexicons/fly/src/op/activities/sprites-emulator.ts +++ b/lexicons/fly/src/op/activities/sprites-emulator.ts @@ -1,11 +1,12 @@ import { emulatorLifecycle } from "@intentius/chant/op"; +import { SPRITZER_IMAGE } from "./emulator-images"; export interface SpritesUpArgs { /** Container name. Default: `chant-spritzer`. */ name?: string; /** Host port mapped to the emulator's `:4290`. Default: `4290`. */ port?: number; - /** Image. Default: `ghcr.io/intentius/spritzer:0.3.1`. */ + /** Image. Default: the pinned spritzer image ({@link SPRITZER_IMAGE}). */ image?: string; /** Readiness timeout in ms. Default: `60000`. */ timeoutMs?: number; @@ -24,7 +25,7 @@ export interface SpritesDownArgs { // helper that boots mudflaps for fly). const spritzer = emulatorLifecycle({ name: "chant-spritzer", - image: "ghcr.io/intentius/spritzer:0.3.1", + image: SPRITZER_IMAGE, containerPort: 4290, healthPath: "/_spritzer/health", });