deploy.sh hardcodes Nonproduction ECR registry — prod deploy authenticates to the wrong account
Summary
Prod deploy from a clean checkout is still broken: deploy.sh:36 hardcodes the Nonproduction ECR registry, and :202-204 logs into it, while :47 pulls whatever image push.sh passes in — so a "prod" deploy authenticates to the Nonproduction registry while trying to pull an image that was pushed to (and only exists in) Production's registry.
Why staging#159 didn't catch this
staging#159 closed with "deploy.sh needed no changes — it already takes ECR_IMAGE as a parameter." That's true of ECR_IMAGE, but not of ECR_REGISTRY — and ECR_REGISTRY is what docker login actually uses. The gap survived because nothing had cause to open deploy.sh itself during that work:
- staging#150 fixed
push.sh's per-environment auth (separate script). - staging#159 concluded
deploy.shwas already parameterized (true only for the image, not the registry). 07-secrets-and-config.mdnotesdeploy.sh/secrets.share deliberately decoupled — reasonable in general, but it meant no one re-checkeddeploy.sh's own registry logic whenpush.shwent per-environment.
Fix
aaronrene has this branched off dev @ 8a1389ae — 2 files, 26 tests. Was queued behind staging#193 (the accepted_at push-blocker), which is now fixed and deployed — this is unblocked.
Related
- staging#159 — closed without catching this; not reopened (the closure was correct for what it covered), but this ticket documents the gap it missed.
Source
Reported by aaronrene, 2026-09-10 (relayed via message to gabriel, processed 2026-09-11).
Mirrored from staging#194.
Fixed and deployed to staging and production.
Root cause:
deploy.sh:36hardcoded the Nonproduction ECR registry independently ofECR_IMAGE, anddocker loginused that hardcoded registry — so a prod deploy authenticated against the wrong account while trying to pull an image that only existed in production's registry.Fix:
ECR_IMAGEis now the single source of truth;ECR_REGISTRYis derived from it (ECR_REGISTRY="${ECR_IMAGE%%/*}") instead of being independently hardcoded — login and pull now always target the same registry.Tests: new
TestEcrRegistryDerivedFromImageintests/test_deployment.py(5 tests), executing the real bash variable-derivation lines in a subprocess.Verified via a real
bash deploy/push.sh stagingrun and confirmed again with this session's subsequent staging+prod deploys, all succeeding against the correct registry.