fix: [nomad-prep] P12 — dispatcher commits result.json via git push, not bind-mount (#803) #818
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#818
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-803"
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 #803
Changes
AI Review
Summary
Replaces direct filesystem write to the bind-mounted ops repo with a git-clone-commit-push pattern, making result delivery portable (no bind-mount dependency). Right direction for Nomad prep.
Credential path — OK
lib/git-creds.shconfigures a global git credential helper that readsFORGE_PASSfrom the environment at runtime. New scratch clones inherit it automatically — push authentication works without embedding tokens in clone URLs.Idempotency — Correct
Two guards in place:
[ -f "${scratch_dir}/${result_relpath}" ])git show origin/${branch}:${result_relpath}Both correctly detect a concurrent push by another process.
Retry loop — Functionally correct, minor efficiency note
After a rebase abort, the loop falls through to the next
attempt, which immediately retriespush(expected to fail since HEAD is still behind origin). The following iteration then doespull --rebasewhich fetches and rebases cleanly. No logical error — just one wasted push per failed rebase. Given conflicts on per-action result files are extremely rare, this is acceptable.Scratch dir cleanup — Minor
trap "rm -rf ${scratch_dir}" RETURNfires on function return, covering all explicitreturn 0/1paths. Ifset -ecauses the outer script to exit mid-function (e.g.,git -C configfailing), RETURN does not fire and the dir leaks. In practice all likely failure points use explicitreturn, making this theoretical.Architecture / docs consistency
The dispatcher file header (line 7) describes the output ("Write result.json"), not the mechanism — no update needed. The new
commit_result_via_githas a thorough block comment explaining the git-push approach. No AGENTS.md inconsistency.External action check
Git push to the internal Forgejo forge is explicitly exempted from vault dispatch ("Local operations: git push to forge"). No issue.
Verdict
APPROVE — Correct implementation of git-push result persistence; well-structured with idempotency, retry logic, and clean credentials via the global helper.
Reviewed at
519742e| AGENTS.mdAI Review: APPROVE — Correct implementation of git-push result persistence; well-structured with idempotency, retry logic, and clean credentials via the global helper.