test(post-prod): self-provision the smoke synthetic instead of requiring it - #527
Open
izzywdev wants to merge 2 commits into
Open
test(post-prod): self-provision the smoke synthetic instead of requiring it#527izzywdev wants to merge 2 commits into
izzywdev wants to merge 2 commits into
Conversation
…ing it
The authenticated post-prod journey failed with:
POST /api/v1/security/session -> 401
Expected: 200 Received: 401
7 of 8 checks passed. The account the test signs in as does not exist in
production, so the one journey that proves sign-in and Module-Federation
loading actually work on the live deployment has been red regardless of code.
Test 7 now bootstraps its own account, using surfaces the SPA itself uses:
GET /api/v1/security/email-available?email=... -> { available }
available -> POST /v1/security/signup (201, returns a LoginResponse)
otherwise -> POST /v1/security/session (200)
So the first run creates postprod-smoke@fuzefront.com and every later run signs
in as it. Nothing is provisioned by hand, and a rebuilt prod database heals on
the next run rather than going permanently red. A 409 on signup is treated as a
race between concurrent runners, not a failure: the loser falls through to
signing in.
WHY THE PASSWORD STILL HAS NO IN-REPO FALLBACK
izzywdev/FuzeFront is a PUBLIC repository. Hard-coding the password would
publish a working production login to anyone who clones it, permanently, in git
history — and MFA is not enforced, so the password alone would be enough to use
it. That is strictly worse than a red check.
The previous fallback (admin123) was survivable only because
admin@fuzefront.dev does not exist in prod: initializeDatabase() runs seeds only
when NODE_ENV !== 'production'. Self-provisioning changes that — it creates a
REAL account — so the credential now has to be real too.
The address is not a credential and is fixed in code, which is what makes the
account stable across runs and discoverable. Only POST_PROD_PASSWORD is a
secret, down from two secrets to one.
Absent, test 7 SKIPS loudly and is annotated as missing coverage. It never falls
back to a guessable value and reports green.
Failure messages now distinguish the cases that were previously one opaque 401:
account missing vs. password mismatch vs. rate limit (the availability endpoint
is 20/min/IP) vs. backend error.
Verified: parses clean (esbuild). NOT verified: not executed against production
— this environment has no frontend node_modules and no prod credential, so the
first real signup happens on the next post-prod run.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GaPa3JgrVNtWrGvqQEAEqv
Contributor
Automated code review (gate-code-review)Credit balance is too low Report-only — this check never blocks merge. |
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.
The authenticated post-prod journey has been red regardless of code:
The account it signs in as doesn't exist in production — so the one check that proves sign-in and Module-Federation loading actually work on the live deployment never ran.
Test 7 now bootstraps its own account
Using surfaces the SPA itself uses:
First run creates
postprod-smoke@fuzefront.com; every later run signs in as it. Nothing is provisioned by hand, and a rebuilt prod database heals on the next run instead of going permanently red. A409on signup is treated as a race between concurrent runners, not a failure — the loser falls through to signing in.Why the password still has no in-repo fallback
izzywdev/FuzeFrontis a public repository. Hard-coding the password would publish a working production login to anyone who clones it, permanently, in git history — and MFA isn't enforced, so the password alone would be enough to use it. That's strictly worse than a red check.The old fallback (
admin123) was survivable only becauseadmin@fuzefront.devdoesn't exist in prod —initializeDatabase()runs seeds whenNODE_ENV !== 'production'. Self-provisioning changes that: it creates a real account, so the credential has to be real too.The address isn't a credential and is fixed in code — that's what makes the account stable across runs and discoverable. Only
POST_PROD_PASSWORDis a secret, down from two to one.Absent, test 7 skips loudly and is annotated as missing coverage. It never falls back to a guessable value and reports green.
Better failure messages
The single opaque
401is now four distinguishable cases: account missing, password mismatch against an existing account, rate limit (the availability endpoint is 20/min/IP), or backend error.Verified / not verified
node_modulesand no prod credential, so the first real signup happens on the next post-prod run.To activate: set
POST_PROD_PASSWORDto a generated high-entropy value. Nothing else is needed — the account creates itself.Generated by Claude Code