fix: bug: credential helper race on every cold boot — configure_git_creds() silently falls back to wrong username when Forgejo is not yet ready (#741) #744
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#744
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-741"
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 #741
Changes
AI Review — Error\n\nReview failed.\n---\n
0291545AI Review
Summary
Bug fix for #741. Three-layer defence: (1) Docker Compose
service_healthygate delays agent startup until Forgejo's API responds; (2) retry/backoff loop inconfigure_git_credshandles the remaining transient window; (3) post-write credential verification catches a mismatchedFORGE_PASSbefore it can silently 401 on every push.Infrastructure (docker-compose.yml)
All volumes, bind mounts, environment variables,
restart: unless-stopped, andsecurity_optare intact. The healthcheck parameters are sound:start_period: 30s+ 30 retries x 5s gives a ~2 min window before Docker marks the service unhealthy, which is generous for Forgejo on slow hardware. Bothagentsandagents-llamacorrectly gate oncondition: service_healthy.lib/git-creds.sh
Logic is correct. One minor observation:
sleep "$attempt"fires after the 5th failed attempt before returning 1, adding an unnecessary ~5s delay before the error is logged. Not a correctness issue — just a small UX drag on the error path.The
_GIT_CREDS_LOG_FNindirection is consistent with the pattern already used inrepair_baked_cred_urls. TheBOT_USERexport cleanly eliminates the redundant API call inconfigure_git_identity.entrypoint.sh
Fallback from
dev-bottoagentfor git identity is more honest. The comment clarifying thatconfigure_git_identity's API call is a fallback-only path is helpful.Scope
Tightly scoped to the stated issue. No unrelated changes observed.
Verdict
APPROVE — Fix is correct and complete: healthcheck + service_healthy gate eliminates the race; retry/backoff handles residual transient window; verification catches mismatched credentials eagerly.
Reviewed at
0291545| AGENTS.mdAI Review: APPROVE — Fix is correct and complete: healthcheck + service_healthy gate eliminates the race; retry/backoff handles residual transient window; verification catches mismatched credentials eagerly.