@@ -210,15 +210,17 @@ These constraints are enforced in `firestore.rules` and validated by `test/rules
210210- Confirm production Firebase Auth domain setup before release (Google provider and authorized domains)
211211
212212### Production Firestore Rules Runbook
213- 1 . Authenticate Firebase CLI:
214- - ` npx firebase login `
215- 2 . Verify project/database deploy targets:
216- - ` npm run rules:target:check `
217- 3 . Deploy production Firestore rules:
213+ 1 . Mainline path (default):
214+ - Merge to ` main ` ; CI deploys ` firestore.rules ` automatically when Firestore files change.
215+ 2 . CI deploy preconditions:
216+ - ` verify-local ` must pass.
217+ - ` npm run rules:target:check ` must pass (project/database target integrity gate).
218+ 3 . Post-deploy smoke checks:
219+ - Owner smoke user must read ` households/{householdId}/unknownIngredientQueue ` .
220+ - Non-member smoke user must receive ` PERMISSION_DENIED ` .
221+ 4 . Emergency/manual deploy only:
218222 - ` npm run rules:deploy:prod `
219- 4 . Validate production owner view:
220- - Sign in as owner and open the pantry/unknown queue section.
221- - Confirm no ` Unknown ingredient queue access denied ` banner appears.
223+ - ` npm run rules:smoke:prod `
2222245 . Optional deploy diagnostics:
223225 - ` npm run rules:deploy:prod:dry `
224226
@@ -243,6 +245,11 @@ This project uses GitHub as the deployment source of truth.
243245- CI command chain:
244246 - ` npm ci `
245247 - ` npm run verify:local `
248+ - ` verify-local ` includes ` npm run rules:target:check `
249+ - ` main ` push additional automation:
250+ - Detect Firestore-related file changes.
251+ - Deploy Firestore rules automatically when changed.
252+ - Run production smoke test for owner-allow and non-member-deny unknown queue reads.
246253
247254### Local push gate (Husky)
248255- Husky install hook is configured via ` npm run prepare ` .
@@ -255,6 +262,13 @@ This project uses GitHub as the deployment source of truth.
255262- Require status checks to pass before merging.
256263- Add required status check: ` verify-local ` .
257264- Require branches to be up to date before merging.
265+ - Add repository secrets for Firestore deploy/smoke workflow:
266+ - ` FIREBASE_TOKEN `
267+ - ` SMOKE_OWNER_EMAIL `
268+ - ` SMOKE_OWNER_PASSWORD `
269+ - ` SMOKE_OWNER_HOUSEHOLD_ID `
270+ - ` SMOKE_NON_MEMBER_EMAIL `
271+ - ` SMOKE_NON_MEMBER_PASSWORD `
258272
259273### Required Vercel settings
260274- Git repository connected to this GitHub repo.
@@ -275,10 +289,12 @@ This project uses GitHub as the deployment source of truth.
275289### Firestore rules tests fail with Java/emulator error
276290- Install Java 17+ and confirm ` java -version ` resolves correctly in shell.
277291
278- ### ` Unknown ingredient queue access denied. Deploy latest Firestore rules and retry. `
279- - Ensure Firebase CLI is authenticated: ` npx firebase login `
280- - Deploy rules to production (includes named Firestore DB target): ` npm run rules:deploy:prod `
281- - Retry owner view and confirm unknown queue loads.
292+ ### ` Unknown ingredient queue access denied... [build:<id>] `
293+ - Confirm the visible build id is the latest deployment.
294+ - Validate CI Firestore deploy and smoke test status on latest ` main ` run.
295+ - For emergency recovery, deploy + smoke manually:
296+ - ` npm run rules:deploy:prod `
297+ - ` npm run rules:smoke:prod `
282298
283299### Google sign-in popup fails locally
284300- Add ` localhost ` / ` 127.0.0.1 ` to Firebase Auth authorized domains.
0 commit comments