fix: fix: disinto init fails on re-run — admin token name collision (#266) #274
No reviewers
Labels
No labels
action
backlog
blocked
bug-report
in-progress
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
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#274
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-266"
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 #266
Changes
AI Review — Error\n\nReview failed.\n---\n
580de95AI Review
Summary
This PR fixes a re-run failure in
setup_forge(): on a seconddisinto init, the admin token already exists so the POST returns 409, and the old fallback listing path could never work anyway (Forgejo does not returnsha1in list responses — only at creation time). The fix is delete-then-create: look up the token by name, delete it if found, then create fresh to obtain the sha1.Review
bin/disinto:757-760:jq -r '.[] | select(.name == ...) | .id'returns multiple lines if more than one token matches. In practice only one can exist with this name, but if it somehow produced multiple IDs the DELETE URL would be malformed and would fail silently (|| true). Not a real risk here given the unique name, and the silent failure still causes a subsequent create failure caught at line 776.bin/disinto:791-797: Pre-existing: the human token fallback still uses the broken listing pattern (sha1 is never in list responses). On a re-run, HUMAN_TOKEN will silently not be updated. Filed as tech-debt in issue #275.Verdict
The admin token fix is correct and complete. The delete-then-recreate pattern is the right approach.
Verdict
APPROVE — Delete-then-recreate correctly fixes the admin token sha1 collision; logic and error handling are sound
Reviewed at
580de95| AGENTS.mdAI Review: APPROVE — Delete-then-recreate correctly fixes the admin token sha1 collision; logic and error handling are sound