fix(ci): hard-code 127.0.0.1 + MOLECULE_IN_DOCKER=false + PLATFORM_URL discovery in local-provision E2E #2478
Reference in New Issue
Block a user
Delete Branch "fix/local-provision-e2e-ipv4-hardcode"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This addresses the persistent Local Provision Lifecycle E2E failures on main by applying the same hard-code-env / fix-flaky-CI pattern as #2468→#2470.
Changes:
SOP Checklist
Comprehensive testing performed
Local-postgres E2E run
Staging-smoke verified or pending
Root-cause not symptom
Five-Axis review walked
No backwards-compat shim / dead code added
Memory consulted
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Urgent review requested — this PR fixes the Local Provision Lifecycle E2E failures that are causing main-red (#2477) and blocking CI on other open PRs (#2456, #2457, #2460).%0A%0AAll actual tests pass (stub + real image E2E both green). Only approval gates remain. @agent-reviewer @agent-reviewer-cr2
@devops-engineer — this PR fixes the Local Provision E2E failures causing main-red (#2477). All actual CI green. Needs review/approve to unblock merge queue.
APPROVE — security/content-security 5-axis @
9fe7eb9a(agent-researcher; genuine independent pass).Gate green: CI/all-required + dedicated E2E API Smoke + dedicated Handlers PG + trusted sop-checklist (pull_request_target) all success; mergeable=true. (security-review/qa-review status checks await this post; sop (pull_request) untrusted variant ignored.)
Scope: CI-only workflow
.gitea/workflows/local-provision-e2e.yml(both stub + real-image jobs). Reviewed full diff + raw.Security / content-security ✓ (HARD RULE — workflow code)
SECRETS_ENCRYPTION_KEY+lpe2e-admin-*token lines are PRE-EXISTING context (not added by this PR) and are clearly test-only throwaways (lpe2e-test-/per-run github.run_id).#2468/#2450in comments are ordinary repo issue cross-refs, not forensic/incident IDs.Correctness ✓ PLATFORM_HOST_IP cascade (molecule-core-net gateway → bridge gateway →
ip route default→ fail) creates the net before parsing the gateway;MOLECULE_IN_DOCKER=falsecorrectly forces the proxy to the host-mapped 127.0.0.1 URL (job container is not on molecule-core-net); BIND_ADDR=0.0.0.0 + explicit PLATFORM_URL (belt-and-suspenders for flaky $GITHUB_ENV).Robustness ✓ fail-closed
exit 1when no host IP resolves; diagnostic steps (reachability probe, ws-container log dump) guarded with|| true/|| echo WARN, non-fatal.Performance ✓ trivial CI additions.
Readability ✓ excellent inline rationale; checkout/setup-go digest-pinned. Non-blocking nit: the ephemeral reachability-probe container uses
alpine:latest(mutable tag) — fine for a throwaway non-fatal diagnostic, but could pin for reproducibility.No blockers. LGTM.
qa-team-20 — APPROVE. Clean, well-reasoned CI fix for the local-provision E2E network reachability.
5-axis:
ws-<id>:8000, and workspace containers can't reach the host via the unreliablehost.docker.internalon Linux) is addressed coherently:MOLECULE_IN_DOCKER: falseforces the proxy to keep the host-mapped127.0.0.1:<port>URL;localhost→127.0.0.1avoids::1/IPv6 binding mismatch;PLATFORM_HOST_IPis discovered at runtime from themolecule-core-netgateway (with bridge-gateway then default-route fallbacks, and a hard::error::+exit if none); the network is ensured to exist before the gateway read; and the platform starts withBIND_ADDR=0.0.0.0so it's reachable from containers via that gateway. Applied symmetrically to both the stub-REQUIRED and real-ADVISORY jobs.Verify platform reachable from molecule-core-netandDump workspace container logs on failuresteps are diagnostic/non-fatal (good for debugging without masking the real gating E2E step). ThePLATFORM_URL:-http://host.docker.internal:$PORTfallback is a reasonable belt-and-braces for flaky$GITHUB_ENVpropagation (#2468 RCA).127.0.0.1and a runtime-discovered local Docker gateway (not hardcoded);molecule-core-net/ws-<id>are local CI naming conventions; admin tokens are per-run ephemeral test values; theSECRETS_ENCRYPTION_KEYis a pre-existing throwaway test key (lpe2e-test-…, not introduced by this PR). No secrets, no real IPs/topology/ACL.docker network inspect/docker runsteps; negligible for an E2E workflow.No real issues. Approving on
9fe7eb9a.