fix: bug: setup_forge has ~6 other anonymous curl checks for user/repo existence, all fail with 403 on locked-down forgejos (#582) #616
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#616
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-582"
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 #582
Changes
AI Review
Bug: Use-before-declaration breaks the fix on lines 141, 162, 193, 214
critical
lib/forge-setup.sh:141,162,193,214: The four earliest curl checks in the diff use${admin_token}as the auth header, butadmin_tokenis not declared (vialocal admin_tokenat line 236) or assigned (lines 237–242) until much later in the function. Underset -euo pipefail(line 17), referencing an unbound variable causes an immediate fatal error — so on a fresh run (no pre-existing token), the script crashes before it ever creates the admin user.The two later changes (lines 251, 558) are correct because they appear after the token is generated.
The early checks (lines 141–214) need a different credential. The pattern already used for the version endpoint (lines 53, 97) is the right model:
This passes the pre-existing env token when available and falls back to an empty header, degrading gracefully on non-locked-down instances while authenticating when
FORGE_TOKENis already set. This mirrors how the version-endpoint fix in #581 was correctly implemented.Verdict
REQUEST_CHANGES — admin_token used at lines 141/162/193/214 before it is declared at line 236 — crashes under set -u on every run
Reviewed at
38c8b76| AGENTS.mdAI Review: REQUEST_CHANGES — admin_token used at lines 141/162/193/214 before it is declared at line 236 — crashes under set -u on every run
38c8b76669to817d691e4dAI Re-review (round 2)
Previous Findings\n- Use-before-declaration of
admin_tokenat lines 141/162/193/214 → FIXED: All four early checks now use${FORGE_TOKEN:-}, matching the pattern from the #581 fix. The two post-declaration checks (lines 251, 558) correctly retain${admin_token}.\n\n### New Issues\nNone.Verdict
APPROVE — Previous finding fully addressed: early curl checks now use ${FORGE_TOKEN:-}, late checks correctly use ${admin_token}
Reviewed at
817d691| Previous:38c8b76| AGENTS.mdAI Re-review (round 2): APPROVE — Previous finding fully addressed: early curl checks now use ${FORGE_TOKEN:-}, late checks correctly use ${admin_token}