fix: fix: setup_ops_repo should create ops repo under disinto-admin, not the authenticated bot (#240) #247
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#247
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-240"
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 #240
Changes
bin/disintosetup_ops_repo: replacePOST /api/v1/users/{owner}/reposfallback withPOST /api/v1/admin/users/{org_name}/repos— the admin API creates in the target namespace regardless of which user is authenticated (dev-bot would have created the repo under its own namespace)bin/disintodisinto_init: deriveops_slugasdisinto-admin/{project_name}-opsinstead of{forge_repo}-ops— forge_repo owner may bejohbaor any caller, but the ops repo always belongs todisinto-adminprojects/disinto.toml.example: updateops_repodefault todisinto-admin/disinto-opsAcceptance criteria
- Replace POST /api/v1/users/{owner}/repos fallback with admin API POST /api/v1/admin/users/{org_name}/repos, which creates in the target namespace regardless of which user is authenticated - Fix ops_slug derivation in disinto_init to always use disinto-admin as owner instead of deriving from forge_repo (which may be johba/...) - Update projects/disinto.toml.example ops_repo default to disinto-admin/disinto-opsAI Review
Summary
Small, targeted bug fix with correct API usage and clean variable removal.
Analysis
** fallback** (): The old fallback used
POST /api/v1/users/{username}/repos, which creates under the authenticated user (dev-bot), not under{username}. The replacementPOST /api/v1/admin/users/{username}/reposcorrectly places the repo under the target namespace regardless of who is authenticated. The comment explains the Forgejo API quirk clearly.disinto_initops_slug (bin/disinto:1987): Hardcodingdisinto-admin/${project_name}-opsis the right design — ops repos belong todisinto-admin, not the calling user. The old derivation from${forge_repo}-opswould have varied by caller (e.g.johba/myproject-opsvsdisinto-admin/myproject-ops).Dead code removed:
local repo_owner="${FORGE_REPO%%/*}"correctly deleted since it is no longer referenced.projects/disinto.toml.example: Updated to match the actual path — no issues.Unchecked Acceptance Criteria
The two unchecked items (vault dispatcher/planner compatibility, fresh-box
disinto initverification) are operational smoke tests, not code defects. The code change itself is correct; those items can be verified post-merge.Verdict
APPROVE — Correct fix: admin API ensures ops repo lands in disinto-admin namespace; ops_slug hardcoding is the right design.
Reviewed at
67d66b3| AGENTS.mdAI Review: APPROVE — Correct fix: admin API ensures ops repo lands in disinto-admin namespace; ops_slug hardcoding is the right design.