fix: disinto init repo creation silently fails — wrong API endpoint for user namespace #164
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#164
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
bin/disinto initreports "Repo: johba/harb created on Forgejo" but the repo is never actually created. The Forgejo API returns zero repos after init completes.Root cause
In
bin/disinto, thesetup_forge()function around lines 883-901 tries two paths to create the repo, both of which fail silently:johba(POST /api/v1/orgs) — fails withuser already existsbecausejohbais a regular user, not an orgPOST /api/v1/orgs/johba/repos) — fails because the org does not existPOST /api/v1/users/johba/repos) — returns 405 Method Not Allowed because/api/v1/users/{username}/reposis a GET-only endpoint in ForgejoBoth the org-path failure and the user-path failure are swallowed by
|| true, so the script continues to the collaborators loop and prints "created on Forgejo" even though nothing was created.Expected behavior
The repo should actually be created. The correct Forgejo API endpoint for creating a repo in a user namespace is one of:
POST /api/v1/user/repos(with the owning user's token, i.e. HUMAN_TOKEN)POST /api/v1/admin/users/johba/repos(with an admin token)The script should also fail loudly if neither path succeeds — not silently continue.
Steps to reproduce
Files
bin/disinto—setup_forge(), lines ~883-901 (repo creation block)