fix(smoke): mint a real OIDC token in the post-deploy smoke handler #28
No reviewers
Labels
No labels
area/auth
area/backend
area/ci
area/deploy
area/e2e
area/frontend
area/shared
blocked
good-first-issue
needs-info
priority/high
priority/low
priority/medium
type/bug
type/chore
type/docs
type/feature
type/tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
celilo/lunacycle!28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-smoke-handler-token"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
smoke-after-deploybus subscriber has never once succeeded. The deliveries table on celilo-mgr shows3 failed, 0 succeeded, and it has been that way since it was wired.Surfaced by the celilo-side poll-CD investigation, which swept every subscriber's delivery outcomes and found this one alongside the poll bug.
Same root cause as #20 — and I missed this caller
smoke-handler.tsauthenticated with thesmoketest_bot_tokensecret: an authentik API token (intent: 'api'), an opaque key rather than a signed JWT. The server verifies bearers withjwtVerifyand the SPA decodes them withjwtDecode, so both reject it and the SPA never renders thesmoketest_botmarker.That is exactly what #20 fixed for the
health_checkhook, in the same three functions. I missed it because I scoped my grep tocelilo/scripts/health-check.tsinstead ofcelilo/scripts/, and fixed only the path the bug report named. This is the "grep every caller before you edit" rule, and I didn't follow it.Re-grepped the whole repo this time. The complete caller set is:
celilo/scripts/health-check.tscelilo/scripts/smoke-handler.tse2e/tests/deploy.test.tsNo others.
The fix
Reads
smoketest_bot_passwordand callsmintAccessToken, mirroringhealth_check— including deriving the authentik origin fromidp_base_urlwith the sameauth.<domain>fallback. Also passesartifactDir, so a failure here leaves the same screenshot / DOM / request post-mortem in/tmp/lunacycle-smokethat the hook path leaves.New evidence for the #20 diagnosis
celilo module secret getdoes exist, and on celilo-mgr it returns a 60-character dotless string forsmoketest_bot_token. A JWT has three dot-separated segments. That is the last piece of direct evidence that the token was never a valid bearer for this app — #20 inferred it fromERR_JWS_INVALIDin the server log, and this confirms it from the other end.Note on why it stayed invisible
The delivery status is
failedrather thanabandoned, meaning the handler ran and reported failure itself. Nothing surfaces that unless you query the deliveries table — the same invisible-failure shape that hid the poll-CD bug for weeks. Worth a monitor on subscribers with a zero success rate; that's celilo-side, not filed here.Verified
Typecheck clean (only the pre-existing dual-
playwright-coreBrowsermismatch, which also affectshealth-check.tsonmain), lint clean, 58 vitest + 57 bun tests green.Not verified end-to-end: that needs a deploy to fire
deploy.completed.lunacycle. I also could not testmintAccessTokenwith the realsmoketest_botcredentials — reading that secret into an env var was blocked, correctly. So #20's caveat still stands: the first post-deploy run is what proves the bot can complete the OIDC flow. If it can't,smoke_loginin health_check and the mint step here both name the exact failing hop.