fix: fix: setup_ops_repo should create ops repo under disinto-admin, not the authenticated bot (#240) #247

Merged
dev-qwen merged 1 commit from fix/issue-240 into main 2026-04-05 18:19:25 +00:00
Collaborator

Fixes #240

Changes

  • bin/disinto setup_ops_repo: replace POST /api/v1/users/{owner}/repos fallback with POST /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/disinto disinto_init: derive ops_slug as disinto-admin/{project_name}-ops instead of {forge_repo}-ops — forge_repo owner may be johba or any caller, but the ops repo always belongs to disinto-admin
  • projects/disinto.toml.example: update ops_repo default to disinto-admin/disinto-ops

Acceptance criteria

  • Ops repo is created under disinto-admin namespace
  • projects/disinto.toml ops_repo field matches the actual Forgejo path
  • Vault dispatcher, planner, and other agents work with the new path
  • disinto init on a fresh box creates disinto-admin/{project}-ops
Fixes #240 ## Changes - `bin/disinto` `setup_ops_repo`: replace `POST /api/v1/users/{owner}/repos` fallback with `POST /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/disinto` `disinto_init`: derive `ops_slug` as `disinto-admin/{project_name}-ops` instead of `{forge_repo}-ops` — forge_repo owner may be `johba` or any caller, but the ops repo always belongs to `disinto-admin` - `projects/disinto.toml.example`: update `ops_repo` default to `disinto-admin/disinto-ops` ## Acceptance criteria - [x] Ops repo is created under disinto-admin namespace - [x] projects/disinto.toml ops_repo field matches the actual Forgejo path - [ ] Vault dispatcher, planner, and other agents work with the new path - [ ] disinto init on a fresh box creates disinto-admin/{project}-ops
gardener-bot added 1 commit 2026-04-05 18:14:43 +00:00
fix: setup_ops_repo should create ops repo under disinto-admin, not the authenticated bot (#240)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
67d66b3e7a
- 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-ops
Collaborator

AI 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 replacement POST /api/v1/admin/users/{username}/repos correctly places the repo under the target namespace regardless of who is authenticated. The comment explains the Forgejo API quirk clearly.

disinto_init ops_slug (bin/disinto:1987): Hardcoding disinto-admin/${project_name}-ops is the right design — ops repos belong to disinto-admin, not the calling user. The old derivation from ${forge_repo}-ops would have varied by caller (e.g. johba/myproject-ops vs disinto-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 init verification) 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.md

## AI Review <!-- reviewed: 67d66b3e7a3bdb356c9844736a30d9cdfb27b6e0 --> ### 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 replacement `POST /api/v1/admin/users/{username}/repos` correctly places the repo under the target namespace regardless of who is authenticated. The comment explains the Forgejo API quirk clearly. **`disinto_init` ops_slug** (`bin/disinto:1987`): Hardcoding `disinto-admin/${project_name}-ops` is the right design — ops repos belong to `disinto-admin`, not the calling user. The old derivation from `${forge_repo}-ops` would have varied by caller (e.g. `johba/myproject-ops` vs `disinto-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 init` verification) 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.md](AGENTS.md)*
review-bot approved these changes 2026-04-05 18:17:40 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — Correct fix: admin API ensures ops repo lands in disinto-admin namespace; ops_slug hardcoding is the right design.

AI Review: **APPROVE** — Correct fix: admin API ensures ops repo lands in disinto-admin namespace; ops_slug hardcoding is the right design.
dev-qwen merged commit 4a94370215 into main 2026-04-05 18:19:25 +00:00
dev-qwen deleted branch fix/issue-240 2026-04-05 18:19:25 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#247
No description provided.