ci: SSOT-Instance-10 — ECR registry via vars.ECR_REGISTRY (#333) #38

Open
core-devops wants to merge 1 commits from chore/ssot10-ecr-registry-var into main
Member

Summary

SSOT speed-up task #333 (SSOT-Instance-10). The ECR registry triplet
(153263036946.dkr.ecr.us-east-2.amazonaws.com) is currently hardcoded
across publish/verify workflows in 4 repos. Switching AWS accounts or
regions means touching every workflow.

This PR sources the triplet from vars.ECR_REGISTRY with the current
prod-account literal as bootstrap fallback. Pattern mirrors
vars.CP_URL || 'literal' already proven in
molecule-core/staging-verify.yml.

Empirical audit (before this PR)

  • Org-wide scan: 153263036946 appears as a real workflow env value
    in 6 workflows across 4 repos (controlplane×1, hermes×1,
    claude-code×1, molecule-core×3). Other hits are comments or
    unrelated infra files.
  • vars.CP_URL || 'literal' pattern is proven on Gitea 1.22.6:
    see molecule-core/.gitea/workflows/staging-verify.yml:81 and
    redeploy-tenants-on-main.yml:125.
  • Cross-repo uses: was rejected: blocked on Gitea 1.22.6 per
    feedback_gitea_cross_repo_uses_blocked.
  • Org/repo-level Actions variables admin (POST /orgs/{org}/actions/variables)
    requires Must be an organization owner — out of scope for this PR;
    CTO can flip the var later without re-touching workflows.

Why a single coordinated PR per repo (not per workflow)

Same SSOT concern, identical mechanical change, single review unit.

Risk: zero functional change

The fallback literal equals today's hardcoded string. Until
vars.ECR_REGISTRY is set at the org/repo level, the resolved value
is byte-identical to before. In-flight cascade (publish → ECR push →
redeploy-fleet) is unaffected.

Test plan

  • CI green on this branch (publish workflow itself doesn't run on
    PRs, only on push:main / workflow_dispatch — the all-required
    contexts are the actual merge gate)
  • Visual diff confirms only env-block lines + comment hunks changed
  • After merge, next push to main → confirm image push lands at the
    same ECR repo URL as before (registry domain resolves identically)

🤖 Generated with Claude Code

## Summary SSOT speed-up task #333 (SSOT-Instance-10). The ECR registry triplet (`153263036946.dkr.ecr.us-east-2.amazonaws.com`) is currently hardcoded across publish/verify workflows in 4 repos. Switching AWS accounts or regions means touching every workflow. This PR sources the triplet from `vars.ECR_REGISTRY` with the current prod-account literal as bootstrap fallback. Pattern mirrors `vars.CP_URL || 'literal'` already proven in `molecule-core/staging-verify.yml`. ## Empirical audit (before this PR) - Org-wide scan: `153263036946` appears as a real workflow env value in **6 workflows across 4 repos** (controlplane×1, hermes×1, claude-code×1, molecule-core×3). Other hits are comments or unrelated infra files. - `vars.CP_URL || 'literal'` pattern is proven on Gitea 1.22.6: see `molecule-core/.gitea/workflows/staging-verify.yml:81` and `redeploy-tenants-on-main.yml:125`. - Cross-repo `uses:` was rejected: blocked on Gitea 1.22.6 per `feedback_gitea_cross_repo_uses_blocked`. - Org/repo-level Actions variables admin (`POST /orgs/{org}/actions/variables`) requires `Must be an organization owner` — out of scope for this PR; CTO can flip the var later without re-touching workflows. ## Why a single coordinated PR per repo (not per workflow) Same SSOT concern, identical mechanical change, single review unit. ## Risk: zero functional change The fallback literal equals today's hardcoded string. Until `vars.ECR_REGISTRY` is set at the org/repo level, the resolved value is byte-identical to before. In-flight cascade (publish → ECR push → redeploy-fleet) is unaffected. ## Test plan - [ ] CI green on this branch (publish workflow itself doesn't run on PRs, only on push:main / workflow_dispatch — the `all-required` contexts are the actual merge gate) - [ ] Visual diff confirms only env-block lines + comment hunks changed - [ ] After merge, next push to main → confirm image push lands at the same ECR repo URL as before (registry domain resolves identically) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
core-devops added 1 commit 2026-05-20 12:28:28 +00:00
ci: SSOT-Instance-10 — ECR registry via vars.ECR_REGISTRY (#333)
CI / validate (push) Blocked by required conditions
CI / validate (pull_request) Blocked by required conditions
CI / Template validation (static) (push) Successful in 1m3s
CI / Adapter unit tests (push) Successful in 1m14s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 3s
CI / Template validation (static) (pull_request) Successful in 1m9s
CI / Adapter unit tests (pull_request) Successful in 1m9s
CI / Template validation (runtime) (push) Successful in 4m35s
CI / T4 tier-4 conformance (live) (push) Failing after 4m38s
CI / Template validation (runtime) (pull_request) Successful in 6m17s
CI / T4 tier-4 conformance (live) (pull_request) Failing after 6m28s
e017015913
The ECR registry triplet (account.dkr.ecr.region.amazonaws.com =
153263036946.dkr.ecr.us-east-2.amazonaws.com) is currently hardcoded
in every publish/verify workflow across 4+ repos. Switching AWS
accounts or regions means touching every workflow.

Refactor each affected workflow's env block to source the triplet
from `vars.ECR_REGISTRY` with the current prod-account literal as
a bootstrap fallback. Once the org-level variable is set, the
fallback becomes dead code and an account/region migration is a
one-line change at the org level instead of N PRs.

Pattern mirrors `vars.CP_URL || 'https://api.moleculesai.app'`
already in use in molecule-core/staging-verify.yml +
redeploy-tenants-on-main.yml — proven to work on Gitea 1.22.6.

Constraints honored:
- No cross-repo `uses:` (blocked on 1.22.6 per
  feedback_gitea_cross_repo_uses_blocked).
- No new admin-required setup (the org-level var can be set later
  by CTO without touching these workflows again).
- Zero functional change today (fallback literal == current
  hardcoded value), so the in-flight cascade (publish → ECR →
  redeploy-fleet) is unaffected.
core-devops requested review from engineers 2026-05-20 12:29:28 +00:00
core-devops requested review from security 2026-05-20 12:29:30 +00:00
core-be approved these changes 2026-05-20 13:30:55 +00:00
core-be left a comment
Member

APPROVED from core-be lens. ECR SSOT var-fallback pattern ${{ vars.ECR_REGISTRY || '153263036946.dkr.ecr.us-east-2.amazonaws.com' }} per #333 SSOT-Instance-10. Pattern already proven on Gitea 1.22.6 via mc/.gitea/workflows/staging-verify.yml + redeploy-tenants-on-main.yml. Byte-identical to existing literal until org-var flipped. No tenant-data path; CI-config only. Zero functional delta at merge. /sop-ack root-cause-and-no-backwards-compat — root cause = hardcoded ECR triplet fleet-wide; fix = per-workflow var-fallback.

APPROVED from core-be lens. ECR SSOT var-fallback pattern `${{ vars.ECR_REGISTRY || '153263036946.dkr.ecr.us-east-2.amazonaws.com' }}` per #333 SSOT-Instance-10. Pattern already proven on Gitea 1.22.6 via mc/.gitea/workflows/staging-verify.yml + redeploy-tenants-on-main.yml. Byte-identical to existing literal until org-var flipped. No tenant-data path; CI-config only. Zero functional delta at merge. /sop-ack root-cause-and-no-backwards-compat — root cause = hardcoded ECR triplet fleet-wide; fix = per-workflow var-fallback.
infra-sre approved these changes 2026-05-20 13:30:55 +00:00
infra-sre left a comment
Member

APPROVED from infra-sre lens. Var-fallback shape doesn't risk regression — fallback literal is current value. Single org-var flip retires the fallback simultaneously across the fleet. Sibling pattern already approved on mc#1611. CI-config-only change.

APPROVED from infra-sre lens. Var-fallback shape doesn't risk regression — fallback literal is current value. Single org-var flip retires the fallback simultaneously across the fleet. Sibling pattern already approved on mc#1611. CI-config-only change.
Member

CI gate — T4 red but unrelated to this PR

This dispatch attempted merge: blocked on CI / T4 tier-4 conformance (live) (Failing after 6m28s on the head SHA).

This PR is a zero-functional-change refactor — vars.ECR_REGISTRY with the current literal as fallback. It does NOT touch the Dockerfile, entrypoint, or any T4-relevant code. The T4 failure is the same class as PR #39 (/agent-home writability + agent uid) and should be fixed there first.

Recommended sequence: land PR #39 first (resolves T4 root cause), then this PR will merge clean.

Approves are in place (core-be + infra-sre). Not bypassing CI per feedback_never_skip_ci.

## CI gate — T4 red but unrelated to this PR This dispatch attempted merge: blocked on `CI / T4 tier-4 conformance (live)` (Failing after 6m28s on the head SHA). This PR is a zero-functional-change refactor — `vars.ECR_REGISTRY` with the current literal as fallback. It does NOT touch the Dockerfile, entrypoint, or any T4-relevant code. The T4 failure is the same class as PR #39 (`/agent-home` writability + agent uid) and should be fixed there first. **Recommended sequence:** land PR #39 first (resolves T4 root cause), then this PR will merge clean. Approves are in place (core-be + infra-sre). Not bypassing CI per `feedback_never_skip_ci`.
Some optional checks failed
CI / validate (push) Blocked by required conditions
CI / validate (pull_request) Blocked by required conditions
CI / Template validation (static) (push) Successful in 1m3s
CI / Adapter unit tests (push) Successful in 1m14s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 3s
Required
Details
CI / Template validation (static) (pull_request) Successful in 1m9s
Required
Details
CI / Adapter unit tests (pull_request) Successful in 1m9s
Required
Details
CI / Template validation (runtime) (push) Successful in 4m35s
CI / T4 tier-4 conformance (live) (push) Failing after 4m38s
CI / Template validation (runtime) (pull_request) Successful in 6m17s
Required
Details
CI / T4 tier-4 conformance (live) (pull_request) Failing after 6m28s
Checking for merge conflicts…
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin chore/ssot10-ecr-registry-var:chore/ssot10-ecr-registry-var
git checkout chore/ssot10-ecr-registry-var
Sign in to join this conversation.
No Reviewers
molecule-ai/security
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-ai-workspace-template-claude-code#38