Repository navigation
feat(emulator): declare every emulator the repo ships (#1345) - #1368
Merged
Merged
Conversation
`chant emulator up --all` booted one of the four emulators in this repo. azure's floci-az and gcp's floci-gcp built the exact `EmulatorSpec` the capability wants — same `emulatorLifecycle` helper, same name/image/port/health — and never set `plugin.emulator`. fly could not declare at all: it ships two emulators, and the field held exactly one. So `emulator` now takes a capability or a list of them, `chant emulator` reports one line per emulator rather than per lexicon, and all five are declared: Floci, floci-az, floci-gcp, mudflaps, spritzer. Three things follow. **Endpoint vars come from the lexicon.** `LEXICON_ENDPOINT_ENV_VAR` was a hand-maintained map in core naming the ambient var a `--live` read honors. It listed two of the four lexicons that have one, and its module doc asserted azure had none — while `describe-resources.ts` and `deep-observe.ts` both read `AZURE_ENDPOINT_URL` on every call, so `--live --env floci` against azure silently read real Azure. The vars are now derived from each lexicon's own `emulator.env()`, picking out the keys whose value *is* the endpoint so credentials are not injected alongside it. A lexicon with no emulator contributes nothing, which is the same answer the map gave for k8s, gcp and temporal. **Images are pinned.** floci, floci-az and floci-gcp tracked `:latest` — an image that moves underneath a passing local suite with nothing in the repo recording what changed. Each spec now names a released tag and the upstream repo it comes from. **Freshness generalizes.** fly's private freshness checker becomes `scripts/check-emulator-freshness.ts`, driven by the declared specs rather than a list of two, and reporting any emulator still on a floating tag. It found mudflaps one minor behind, which is left alone: per the #808 policy a pin moves when a consuming test needs the newer emulator, not because a release happened. `EmulatorCapability` had no authoring documentation at all; it has a page now, including why having an emulator is not declaring one. Refs #1340. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jp6SP7ZiavhoEB1AFuwwoJ
…ests `applyLiveEndpoint` takes plugins rather than lexicon names now (#1345); two call sites in its own test still passed strings. Missed locally because tsconfig.build.json excludes tests and CI typechecks tsconfig.json.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1345. Part of #1340.
The gap
chant emulator up --allbooted one of the four emulators in this repo.azure's floci-az and gcp's floci-gcp already built the exact
EmulatorSpecthe capability wants — sameemulatorLifecyclehelper, same name/image/port/health path — and neither setplugin.emulator. fly could not declare at all: it ships two emulators (mudflaps for the Machines API, spritzer for Sprites) and the field held exactly one.Meanwhile
local-testing/presents all three clouds as equal local targets, which is true of the ops and was false of the capability.What changed
emulatortakes a capability or a list of them, andchant emulatorreports one line per emulator rather than per lexicon:Endpoint vars now come from the lexicon — and this fixes a live bug
LEXICON_ENDPOINT_ENV_VARwas a hand-maintained map in core naming the ambient var a--liveread honors. It listed two of the four lexicons that have one, and its module doc asserted:lexicons/azure/src/describe-resources.ts:142anddeep-observe.ts:256both readprocess.env.AZURE_ENDPOINT_URLon every call. So--live --env flociagainst azure silently read real Azure rather than the emulator.The vars are derived from each lexicon's own
emulator.env()now, by probing with a sentinel and keeping the keys whose value is the endpoint — so credentials thatenv()legitimately returns (AWS_ACCESS_KEY_ID: "test") are handed to--jsonconsumers but never injected into a--liveread's shell. A lexicon with no emulator contributes nothing, the same answer the map gave for k8s, gcp and temporal.Images are pinned
floci, floci-az and floci-gcp all tracked
:latest. Each spec now names a released tag verified to exist, plus the upstream repo it comes from:floci/floci:latestfloci/floci:1.5.34floci/floci-az:latestfloci/floci-az:0.10.0floci/floci-gcp:latestfloci/floci-gcp:0.5.0Freshness generalizes out of fly
fly's private
emulator-freshness.tsbecomesscripts/check-emulator-freshness.ts, driven by the declared specs rather than a hardcoded pair, and reporting any emulator still on a floating tag. Run against this branch:mudflaps is left alone deliberately — per the #808 policy a pin moves when a consuming test needs the newer emulator, not because a release happened. The weekly workflow now opens that notice for all five instead of two.
Note for reviewers
createMockPlugingained anemulatoroption, and the handler tests that exercise--liveendpoint injection now declare one. That is not test bookkeeping: a mock without an emulator gets no injection, which is exactly what a real lexicon without one would get. The old behavior keyed off the string"aws".Verification
EmulatorCapabilityhas an authoring page for the first time🤖 Generated with Claude Code
https://claude.ai/code/session_01Jp6SP7ZiavhoEB1AFuwwoJ