Repository navigation
feat(e2e): make the plugin-catalog and integration-proxy URLs runtime-configurable - #1621
Merged
michielbdejong merged 2 commits intoSep 22, 2026
Conversation
Both URLs were already runtime-overridable through localStorage, but nothing could set those keys before the first fetch without a human in Settings — so CI baked `VITE_PLUGIN_CATALOG_URL` / `VITE_INTEGRATION_PROXY_URL` into the bundle and then had to assert the bake worked. A binary built for one lane's ports could not serve another's, which is why the e2e tier was the one test tier that could not be port-parameterized. Playwright's `storageState` is applied when the browser context is created, and a probe confirmed the values are visible to the very first script on the page, so seeding the two keys there is enough — no production shim, and no query-parameter override (both values are fetch targets for authenticated flows; a URL parameter would make them settable by any link). Both validators stay on the path a seeded value takes, so a hostile catalog URL still cannot be planted, and the proxy is still origin-only while the catalog is still a full path. The config rejects a bad seed loudly rather than letting the app fall back and report the product broken. Two robustness fixes the seeding exposed: - `getIntegrationProxy()` threw out of a render on a stored value that no longer validates. It now falls back to the default, like the catalog reader already did. - A `VITE_*` default that would never validate left every read throwing, including the Settings screen that could have fixed it. Ignored now. `validateCatalogUrl` now shares `isLoopbackHost` with `proxyOrigin`, so the whole `.localhost` TLD is accepted (RFC 6761), not just the bare name. That is what lets dagger drop the bake: its proxy is `http://atomic.localhost:19090`, seeded on the playwright container instead of compiled into the bundle. The dagger `http://atomic:9883` alias is still not loopback and is unaffected — nothing seeds a catalog or proxy there. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both now live with the plugin they exercise — `integrations/pets/e2e/pets.spec.ts` and `integrations/notion/e2e/notion.spec.ts` in ontola/atomic-plugins — so keeping them here runs them twice once that repo's `.atomic-server-ref` is bumped to this branch. What stays is the generic plugin editor/sandbox coverage, plus `newPlugin()` and `setSource()`: the remaining specs use both, and neither moved spec did. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
michielbdejong
deleted the
claude/plugin-catalog-proxy-runtime-0f4739
branch
September 22, 2026 12:00
This was referenced Sep 22, 2026
Merged
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.
Both URLs were already runtime-overridable through
localStorage— theVITE_*vars only supplied the default. What was missing was a way to set those keys
before the first fetch, without a human in Settings and without rebuilding.
So CI baked the values into the bundle and then had to assert the bake worked,
and a binary built for one lane's ports could not serve another's. That is why
the e2e tier is the one test tier in
integrations/PARALLEL_LANES.mdthatcould not be port-parameterized.
What this does
browser/e2e/playwright.config.tsseedsplugin-catalog-urlandintegration-proxy-urlthroughstorageState, fromPLUGIN_CATALOG_URL/INTEGRATION_PROXY_URL(theVITE_*spellings are accepted under those namestoo, so an invocation that used to bake a value keeps working by seeding it).
Origins are deduped and share one seed list, which the
viewTransitionsEnabledentry now lives in as well.
No production shim. A throwaway probe confirmed
storageStatevalues arereadable by the very first script on the page, so the
window.__ATOMIC_RUNTIME_CONFIG__fallback was not needed. No query-parameter override either: both values are
fetch targets for authenticated flows, and a URL parameter would make them
settable by any link.
Both validators stay on the path a seeded value takes, so a hostile catalog URL
still cannot be planted. The proxy is still origin-only and the catalog is still
a full path — they are not unified. The config rejects a bad seed loudly,
naming the value, rather than letting the app fall back and the suite report
the product broken.
Two robustness fixes the seeding exposed:
getIntegrationProxy()threw out of a render on a stored value that no longervalidates. It now falls back to the default, like the catalog reader already did.
VITE_*default that would never validate left every read throwing,including the Settings screen that could have fixed it. Ignored now.
The
.localhostdecisionWidened.
validateCatalogUrlnow sharesisLoopbackHostwithproxyOrigin,which already accepted the whole
.localhostTLD (RFC 6761). That is what lets.daggerdrop the bake: its proxy ishttp://atomic.localhost:19090, seeded onthe playwright container instead of compiled into the bundle.
Dagger's other origin,
http://atomic:9883, is still not loopback and staysrejected. Nothing seeds a catalog or proxy there, so it is unaffected.
Also here
The Pets and Notion e2e specs are deleted (second commit). Both moved to
integrations/pets/e2e/pets.spec.tsandintegrations/notion/e2e/notion.spec.tsin
ontola/atomic-plugins, so keeping them would run them twice once thatrepo's
.atomic-server-refis bumped to this branch.newPlugin()andsetSource()stay — the remaining specs use both, and neither moved spec did.Note: the handoff expected six specs to remain; there were ten, so eight remain.
Its snapshot predates two additions. Exactly the two named specs were removed.
Verification
browser/data-browser/src/helpers/runtimeIntegrationConfig.test.ts:seeded value wins over the
VITE_*default, an invalid seed falls back ratherthan throwing, an invalid
VITE_*default is ignored,.localhostis accepted,and the Settings setters still round-trip — for both helpers.
helpers/PluginRuns/Settingspass; 43 localthoughttests pass; e2e and data-browser typecheck, lint and format are clean.
storageStatetiming, then was removed.Not verified here: an unmodified
--profile e2ebinary built with neitherVITE_*running the Integrations suite green needs a full cargo + frontendrebuild. The mechanism is verified; CI is the real check on the whole run.
What lands downstream afterwards
In
ontola/atomic-plugins, once this ships and.atomic-server-refis bumped:drop the two
VITE_*vars and the "Verify the built frontend uses this repo'scatalog and proxy URLs" step from
ci.yml; delete §3's build-time-constraint-on-portscaveat in
integrations/PARALLEL_LANES.md, along with the localflockguard.The
page.route('http://127.0.0.1:19090/**', …)rewrite andATOMIC_SERVICE_URLgo out of the Pets spec there — neither exists in this repo.
🤖 Generated with Claude Code