Skip to content

Activate the site deploy gate's container with a request the page server answers - #430

Closed
leaf-agent wants to merge 1 commit into
mainfrom
fix/ci-34180994050
Closed

leaf-agent wants to merge 1 commit into
mainfrom
fix/ci-34180994050

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

publish-site deployed release 2f6819f4… successfully and then failed its own verification for fifteen minutes, retrying RuntimeError: https://leaf.page/api/data returned 400 until the deadline (run 34180994050). The deployment was healthy; the gate was asking for something the canonical server refuses by contract.

The gate needs one private request to move a reader off the edge and onto a container, because GET /api/state is answered by the Worker while a reader stays passive. It used GET /api/data with no query. That route requires data_revision, source, and key (http.py via data_fragment), so a bare probe is 400 on every release, on every page, forever — the step could never have gone green.

This activates on /api/view instead, carrying the revision and log boundary the passive edge state already names: the projection a tab asks for when it travels to a revision it has observed, a read with no write behind it. Reading that passive state first also gives the gate the Leaf-Session: passive assertion it was missing — until now the edge path was only checked indirectly, through the absence of activation cookies.

The failure existed because nothing on either side of the container boundary exercised the gate's activating request, so the fix pins it from both: tests/test_website_server.py drives the URL verify-site.py builds against the real page server, and worker/test/index.test.ts covers the Worker branch the gate depends on — a passive reader's non-state API read reaching a container. The Python test reproduces the exact production failure when activation_url is reverted to api/data (HTTP Error 400: Bad Request).

Verification, including against the live deployment

The full fixed sequence, run by hand against leaf.page on the release this run deployed, for both activated pages:

$ curl -s -b jar -D - -o /dev/null https://leaf.page/api/data
leaf-session: active
status 400
{"error": "data_revision must be a non-negative integer"}

$ curl -s -b jar -D - -o /dev/null "https://leaf.page/api/view?revision=1&through_seq=1"
set-cookie: __Host-leaf-active=1; Path=/; Secure; HttpOnly; SameSite=Lax
leaf-release: 2f6819f4919a2457aa6eca7a4c1a00dde64a32b1dfda34d2260b358b76b53d36
leaf-session: active
status 200

The subsequent /api/state read returns leaf-session: active, the deployed release, and publication.kind of product for / and example for /examples/design-decision/ — every assertion the gate makes after activation. Note that /api/data reached the container too: the container was serving the right release the whole time, and only the request's own status failed activation_response.ok.

Locally: tests/test_website_server.py (7 passed), npm run typecheck and npm test in worker/ (41 passed), and pre-commit over the changed files.

…ver answers

The release gate left the edge by asking for /api/data with no query, a request
the canonical server refuses with 400 whatever the deployment did. Activate on
the projection route instead, carrying the revision and log boundary the passive
edge state names, and pin that shape from both sides of the boundary.
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Superseded by #432, which is approved and green. It carries the same activation_url helper and the same two-step passive-/api/state-then-/api/view probe, plus the browser projection assertion this branch omits, and it pins the same Worker routing boundary in worker/test/index.test.ts. The only thing that does not carry over is this branch's standalone test_the_release_gate_leaves_the_edge_by_a_route_this_server_answers — #432 asserts the same projection inline in test_a_website_example_uses_the_real_page_server instead. Closing so the two stop conflicting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant