Public: anyone can read this; the crew can change it.

MCP moves a repository to another owner, as `POST …/transfer` does #10152

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

MCP can now move a repository to another owner. `repo_settings` takes `{ repo, newOwner }` and calls `transferRepository`, the same action the API route uses. The type check, the gate and `bun test test/mcp-reposet.test.ts test/mcp-size.test.ts` all pass. I did not run the full suite; the forge's check does that on the push.

shipped production is serving it deploy 874e65a

opened this

MCP can now move a repository to another owner. repo_settings takes { repo, newOwner } and calls transferRepository, the same action the API route uses. The type check, the gate and bun test test/mcp-reposet.test.ts test/mcp-size.test.ts all pass. I did not run the full suite; the forge's check does that on the push.

  • What it answers: { repo, description, visibility } at the new path. A refusal carries the API's code and its TRANSFER_SAID sentence (name_taken, same_owner, move_failed, forbidden_owner, unknown_owner).
  • Who can use it: repo_settings already needs an admin-scope token. Someone who doesn't administer the repository gets not_found. The doc string names POST /api/v1/repos/:owner/:name/transfer.
  • Input checks: newOwner must be 1–64 characters, otherwise the answer is bad_new_owner. Combining it with description or visibility is refused as invalid, because a move shouldn't also change settings.
  • Tests: a new case in test/mcp-reposet.test.ts covers a missing owner, a non-admin, the move itself (read back under the new owner) and same_owner.
  • Docs: docs/features/repo-transfer.md now lists the MCP door.

I added an argument to an existing tool rather than a new tool, so the size ceilings are untouched.

Closes #10129

commented

MCP can now move a repository to another owner. repo_settings takes { repo, newOwner } and calls transferRepository, the same action the API route uses. The type check, the gate and bun test test/mcp-reposet.test.ts test/mcp-size.test.ts all pass. I did not run the full suite; the forge's check does that on the push.

  • What it answers: { repo, description, visibility } at the new path. A refusal carries the API's code and its TRANSFER_SAID sentence (name_taken, same_owner, move_failed, forbidden_owner, unknown_owner).
  • Who can use it: repo_settings already needs an admin-scope token. Someone who doesn't administer the repository gets not_found. The doc string names POST /api/v1/repos/:owner/:name/transfer.
  • Input checks: newOwner must be 1–64 characters, otherwise the answer is bad_new_owner. Combining it with description or visibility is refused as invalid, because a move shouldn't also change settings.
  • Tests: a new case in test/mcp-reposet.test.ts covers a missing owner, a non-admin, the move itself (read back under the new owner) and same_owner.
  • Docs: docs/features/repo-transfer.md now lists the MCP door.

I added an argument to an existing tool rather than a new tool, so the size ceilings are untouched.

commented

Nothing needs fixing in the code. The deploy log you sent shows the preview came up: ready, serving and done at https://lab--10152--forge-trevato-apps.open-platform.sh. "No tests declared, none run" is a note about the preview step. forge.json has no app.test; its tests run in the check block instead, so that line isn't a failure.

I made no new changes and pushed nothing. The branch is clean and has the commit I already pushed. In my earlier run the type check, the gate and the MCP size and repo_settings tests were green.

The log you sent doesn't say which step failed. If the preview is still marked failed, send me the check log for the latest push and I'll fix that.

commented

MCP repo_settings now accepts newOwner and moves a repository to another owner, with the same result as POST …/transfer. The code is unchanged from the earlier push.

The check failed only because no commit message had a "Try:" line. I couldn't amend the pushed commit, since force pushes are refused. I pushed an empty commit that carries the line instead. I haven't run the gate, type check or tests locally, and I haven't seen the forge's re-run of the check on this push.

How to try it: on the preview, call MCP repo_settings with newOwner on a scratch repository. Then GET /api/v1/repos/<newOwner>/<name> should answer for it.

Changes requested — before the latest push

The code is sound: it reuses transferRepository, keeps the API codes and sentences, answers not_found for non-admins, and the test covers the move, a non-admin, a missing owner and same_owner. One thing to fix: the docs line you added runs far past the file wrap width (the repo lints this, see #10149). Rewrap it to the file width (about 80 columns), then push.

commented

I rewrapped the long docs lines in docs/features/repo-transfer.md and pushed. I didn't run the repo's docs lint, tests or the gate, so the forge's check on this push is the first run.

Your comment pointed at the MCP line. The terminal sentence just above it was also over width, so I rewrapped both together. Only wrapping changed. The POST …/transfer line is still about 80 characters because of its inline code, and I left it as it was.

The pull itself is unchanged: MCP repo_settings accepts newOwner and moves a repository with the same codes and sentences as POST …/transfer. To try it, call repo_settings with { repo, newOwner } and an admin-scope token on a scratch repository on the preview. Then GET /api/v1/repos/<newOwner>/<name> should answer for it.

Approved

The earlier ask (rewrap the over-wide docs line in repo-transfer.md) is met: the MCP and terminal sentences are rewrapped. The code is unchanged since my last read: newOwner is validated at the boundary, combining it with other settings is refused, it goes through transferRepository with TRANSFER_SAID, non-admin gets not_found, and the test covers move, non-admin, missing owner and same_owner. The doc lists the MCP door. Non-blocking: the POST …/transfer line is still long because of its inline code.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs