fix: [nomad-step-5] edge caddy task fails to clone Forgejo from 127.0.0.1:3000 under bridge network (#1034) #1039
No reviewers
Labels
No labels
action
backlog
blocked
bug-report
cannot-reproduce
in-progress
in-triage
needs-triage
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
rejected
reproduced
tech-debt
underspecified
vision
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#1039
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-1034"
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?
Fixes #1034
Changes
AI Review
Summary
The fix correctly replaces the hardcoded
FORGE_URL=http://127.0.0.1:3000in the caddy task with a Consul service-discovery template. That half is fine.The other half is broken.
Blocker
critical
nomad/jobs/edge.hcl:245(dispatcher task env block):FORGE_URLwas removed from thedispatchertask'senv {}block, but noforge.envtemplate was added to that task. In Nomad,templateblocks are task-scoped — theforge.envtemplate placed insidetask "caddy"(lines 128-137) does not propagate totask "dispatcher". After this PR,dispatcherstarts withFORGE_URLunset.dispatcher.shusesFORGE_URLat 15+ call sites:git clone "${FORGE_URL}/${FORGE_OPS_REPO}"(line 1197) — hard-fails, ops repo never cloned${FORGE_URL}/api/v1/...(lines 74, 157, 174, 879, 967, 1053, 1082, 1125)[ -n "${FORGE_URL:-}" ] || return 0(lines 876, 964, 1122) — silently no-ops the entire polling loopFix: add an identical
forge.envtemplate block insidetask "dispatcher", or restoreFORGE_URL = "http://127.0.0.1:3000"in the dispatcher'senv {}block (it already hasnetwork_mode = "host"from issue #1031, so127.0.0.1:3000is reachable).Note on the caddy side
The caddy task change is structurally correct:
env = trueon a Consul-discovery template will injectFORGE_URLinto the container's environment on every service change. Therange service "forgejo"pattern works but renders nothing (empty env var) if the forgejo service has zero healthy instances — the caddy entrypoint should tolerate a brief startup race. This is advisory, not a blocker.Verdict
REQUEST_CHANGES — forge.env template is caddy-task-scoped; dispatcher task loses FORGE_URL entirely
Reviewed at
690aa75| AGENTS.mdAI Review: REQUEST_CHANGES — forge.env template is caddy-task-scoped; dispatcher task loses FORGE_URL entirely
690aa75546toada27759deAI Re-review (round 2)
Previous Findings\n- forge.env template missing from dispatcher task → FIXED: incremental diff adds an identical
forge.envtemplate block insidetask "dispatcher"(with matchingenv = true,change_mode = "restart", and Consul service-discovery data). The comment explicitly notes task-scoping. HardcodedFORGE_URLremoved from both task env blocks as expected.\n\n### Notes\n- Thedeploy.sh240→360s timeout change visible in the incremental diff is a rebase artifact from #1040 (already merged); not introduced by this branch.\n- The advisory from the previous round (emptyFORGE_URLduring zero-healthy-instances startup race) stands as non-blocking.Verdict
APPROVE — forge.env template added to dispatcher task; prior blocker closed, no new issues
Reviewed at
ada2775| Previous:690aa75| AGENTS.mdAI Re-review (round 2): APPROVE — forge.env template added to dispatcher task; prior blocker closed, no new issues