Repository navigation
ci: create the orgs-smoke user on preview automatically - #702
Conversation
rebuild-preview.yml's db reset wipes the fixed smoke user every week, and the orgs REST smoke then skipped until someone re-seeded it from an admin shell. smoke-preview (deploy.yml, preview.yml) now runs the idempotent seed-smoke-user.mjs before its JWT mint, and rebuild-preview re-runs it right after the reset. The service-role key is the preview environment's, set on that one step, and the step refuses the production ref.
|
Darkplane Automerge did not approve this pull request. It scored 50.49 of 100, and 75 was required.
An AI evaluator produced these scores from the diff, the repository history, and the pull request text. The pull request text is author-controlled, so treat the scores as signals rather than proof. Reviewed for commit f4b7438. |
✅ No issues foundThe new commit fixes the last open thread: the demo-data reseed note and seed-preview.mjs's header now say CI re-creates the smoke user. Both claims match the workflows. No new findings. Checked: 2 of 2 changed files read · no possible issues found Progress: open review threads 1 → 1 → 0 across the last 3 reviews What this change reaches — 1 changed file imported by 1 fileflowchart LR
subgraph pr["Changed in this PR"]
m1["scripts/seed/seed-preview.mjs<br/>file changed"]:::changed
end
m1i1["scripts/seed/seed-preview.test.mjs<br/>imports this file"]:::imports
m1 -.-> m1i1
classDef changed fill:#eef2ff,stroke:#6366f1,color:#1e1b4b
classDef ok fill:#e7f6ec,stroke:#16a34a,color:#14532d
classDef partial fill:#fef9c3,stroke:#ca8a04,color:#713f12
classDef unknown fill:#f3f4f6,stroke:#9ca3af,stroke-dasharray:4 3,color:#374151
classDef bad fill:#fde8e8,stroke:#dc2626,color:#7f1d1d
classDef warn fill:#fff4e5,stroke:#d97706,color:#78350f
classDef imports fill:#f8fafc,stroke:#64748b,stroke-dasharray:4 3,color:#1e293b
Review details
Found Quality — produced 0 → posted inline 0 · cleared 0 · carried forward 0 · deferred 0 · below-bar 0 Run incremental · 11 lines in delta · tier standard · depth checkout Nothing to report — optimality (skipped), measurability (skipped), severity, 0 files skipped.
|
…e-role key for the orgs smoke
✅ Preview deploy succeededBranch: 🔗 Open preview → https://lorekit-kqn0bqwui-mads-thines-projects.vercel.app
Endpoints: |
Why
The orgs REST smoke on preview has been skipped: sign-in fails with
invalid_credentials.rebuild-preview.ymlrunssupabase db reset --linkedevery week, which wipes the fixed smoke user, and the user only came back if someone re-seeded it by hand.What changed
smoke-previewindeploy.ymlandpreview.ymlgets a new step, Ensure the fixed smoke user exists on preview, right before the JWT mint. It runs the existing idempotentseed-smoke-user.mjs, which signs in first and only uses the Auth admin API when that fails: the user is missing, or its password has drifted fromLOREKIT_SMOKE_PASSWORD.preview.yml'sseedjob (/preview --seed) gets the same step before it seeds demo data. It runs in parallel withsmoke, so it can't count on smoke's step having run first.rebuild-preview.yml: re-seeds the user right afterdb reset, replacing the old 're-seed out-of-band' notice.previewenvironment'sSUPABASE_SERVICE_ROLE_KEY(already set there) and is set only on those steps. Each step refuses outright when the project ref is production's. Production is never seeded by CI.docs/deployment.md(the orgs-smoke secrets table now listsSUPABASE_SERVICE_ROLE_KEY; rebuild, 'Seed the orgs-smoke user' and the demo-data reseed), thepreview.ymlsecrets header, and the headers ofseed-smoke-user.mjsandseed-preview.mjs.This reverses the earlier 'never seed in CI' choice, at the maintainer's request: with a weekly reset, a manual seed can't keep the suite running.
How to verify
actionlinton all three workflows: no new findings (only the two SC2129 style notes already on main).seeding smoke user …orok — smoke user already seeded, and the orgs suite should run instead of skipping.User-facing docs/llms.txt: none applied, because this is CI wiring and contributor docs only.