feat: support organization-owned repository creation #35
No reviewers
Labels
No labels
attention
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-ruling
needs-triage
offsite
post-merge
ready
release
scope:ci
scope:cli
scope:docs
scope:manifests
scope:packaging
stale
state:addressing
state:bots-reviewing
state:building
state:needs-human
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: heavy-duty/stoke#35
Loading…
Reference in a new issue
No description provided.
Delete branch "build/24-repo-create-owner"
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?
Closes #24
Summary
repo create -o, --owner <owner>/user/repos/orgs/{owner}/reposci / testcan run on a same-repo headAcceptance criteria
stoke repo create -o <org> --name <n>creates the repository under the organization and prints itsfull_name, URL and both clone URLs, as the user route does.stoke repo create --name <n>with no--owneris byte-for-byte the behaviour shipped today (user route).--ownernaming the authenticated user takes the user route, not the org route.can_create_repositoryon the org gets Forgejo’s403message and a non-zero exit.stoke repo create --helplists-o, --owner, and the README documents it.heavy-duty/stokeandci / testreturns a real verdict on it.Worklog
ci / testreturns a real verdict on the same-repo head.Round log
Round at
ccaeb8eeRound passed with no written reply.
feat: support organization-owned repository creationto WIP: feat: support organization-owned repository creation📣 round answered at head
ccaeb8ee4eWIP: feat: support organization-owned repository creationto feat: support organization-owned repository creation🔎 reviewing head
ccaeb8ee4e🔎 reviewing head
ccaeb8ee4e🔎 reviewing head
ccaeb8ee4eApproved.
Reviewed PR #35 at head
ccaeb8ee4e40ab32f1f672ef13264b2b69599440against the acceptance criteria in #24.What I verified:
repo createhelp now lists-o, --owner <owner>and the README documents the new flag and routing.npm installin the review worktree./user/repos, self owner case-insensitively →/user/repos, other owner →/orgs/{owner}/repos) and the org-permission403failure surface.err.messageanderr.status, so Forgejo’s403reaches stderr with a non-zero exit.changelog.d/24.mdis present.heavy-duty/stoke; the latestci / testandlabels / labelschecks report SUCCESS.What I could not verify:
The implementation is minimal, matches the existing command style, and preserves today’s default behavior.
Reviewed the whole PR at head
ccaeb8ee4e40ab32f1f672ef13264b2b69599440(same-repo successor to fork !34, byte-identical tree) against #24's acceptance criteria, the repo's constraints, and the code. Panel verdict (labels.confpanel=lists me; author subtracted) — not advisory.Acceptance criteria — all met, each verified by running something:
createRepo(payload, owner)routes toPOST /orgs/{owner}/repos(api.js:126); the print block (full_name, URL, SSH + HTTP clone URLs) is shared with the user route. Routing covered bycreateRepo routes a different owner to the organization endpoint.!ownershort-circuits to/user/reposwith no extra/usercall; test asserts exactly one call to the unchanged URL, and this test also passes against main's code (correct — that criterion is "unchanged").GET /user, compared viatoLowerCase(); test drivesbuildbotvsBuildBot.HTTP status: 403, and the exact request sequence. The failure case actually fails: with main'ssrc/checked out, 4 of the 5 new tests fail (unknown-option / wrong-endpoint), only the omitted-owner one passes, as it should.stoke repo create --helpmyself: lists-o, --owner <owner>; README documents the flag, both routes, and the 403 semantics.build/24-repo-create-owneronheavy-duty/stoke(not a fork); commit statuses at this head showci / test (pull_request)latest = success ("Successful in 24s", run 43; the failure/blocked entries are older runs at the same head from the fork-PR era) andlabels / labels= success; combined statussuccess.Constraints & conventions: no workflow/action changes;
npm run check:governancepasses (4 identities, 5 scope rows); conventional title; changelog.d/24.md matches the sibling fragment format;createRepohas no other callers.What I ran: full suite 97/97 pass (node v22.12.0) and the main-revert probe above. One environment note: the first
npm testin the fresh review worktree failed 47/97 withCannot find module 'commander'— purely the missing dependency install (nonode_modulesin a throwaway checkout); afternpm cieverything passes, matching the builder's claim.What I could not verify: the live-instance manual proof (actually creating a repository in the org via the CLI, per #24's test-plan snippet). I did not run it — as a reviewer I don't want to write a real repo into the org — and relied instead on the routing/403 tests against stubbed and local HTTP servers plus reading the API client. Non-blocking: if you have transcript evidence of the live run, a link in the round close-out would close that last inch.
No blocking findings; nits: none worth a round. Approving this head.
Approve — head
ccaeb8ee4e40ab32f1f672ef13264b2b69599440.Reviewed the whole PR at this head in a detached worktree, against #24's spec and acceptance criteria.
Acceptance criteria — all six met
-o <org>creates under the org and printsfull_name, URL, both clone URLsGET /api/v1/user→POST /api/v1/orgs/heavy-duty/repos, exit 0, all four lines printed--owneris byte-for-byte today's user routePOST /api/v1/user/repos, no extra/userlookup; payload{"name","description","private","auto_init","default_branch"}identical to the org route's--owner= authenticated user takes the user route-o BUILDBOTagainst loginbuildbot→POST /api/v1/user/repos(case-insensitive, as the spec decided)can_create_repository→ Forgejo's 403 and non-zero exittest/cli.test.jsdrives a realhttpserver; asserts exit 1, the 403 message,HTTP status: 403, and the exact request sequence. Verified independently--helplists-o, --owner; README documents itnode src/cli.js repo create --help; README §stoke repo createnames both routes and the 403ci / testverdicthead.repo=heavy-duty/stoke, refbuild/24-repo-create-owner; latest statuses on this SHA areci / testsuccess (24s) andlabels / labelssuccess — not theBlocked by required conditionsnon-verdict that sank !34What I ran
npm ci && npm teston the head: 97/97 pass.createRepoignoresownerentirely → 3 failures (both routing tests + the CLI 403 test).owner === login) → 1 failure (the case-insensitivity test) — the criterion-3 guard is real, not incidental..option('-o, --owner …')fromcli.js→ 2 failures (help test + the 403 test).src/cli.jsagainst a stub HTTP server (results in the table above), plus two edge probes:--owner=(empty) falls through to the user route, exit 0; a 403 on theGET /userlookup surfaces its own message and status with exit 1.npm run check:governance:4 identities resolved; 5 scope rows valid.grepforcreateRepocallers: one, incli.js— no other call site left on the old arity.Conventions: changelog fragment
changelog.d/24.mdmatches30.md's shape; theerr.statuscatch is the same one all 27 other commands use;scope:cli+scope:docsmatch the touched paths.Non-blocking nits — builder's discretion
src/api.js:130—authenticatedUser.login.toLowerCase()is unguarded. A 200 from/userwithout aloginfield throwsTypeError: Cannot read properties of undefinedinstead of aRepository creation failed:line.(authenticatedUser.login || '').toLowerCase()would keep the failure in the CLI's own error shape.--owner=(explicitly empty) silently takes the user route rather than erroring. Defensible as a fallback; just noting it is unspecified rather than decided.read:user,repo create -o <org>fails with a 403 that is not the org-permission 403 the criterion is about. The message text distinguishes them, so it is readable — but anyone triaging on the status code alone will conflate the two.What I could not verify, and what I relied on instead
stoke repo create -o heavy-duty --name scratch-org-create …thenstoke repo list -o heavy-duty | grep …) I did not run: it creates a real repository on the shared forge, an outward-facing side effect no review needs. The test plan itself scopes the unit floor to "the endpoint chosen … not the network", and I verified that decision end-to-end through the real CLI against a stub server, plus greenci / teston the same-repo head.ci / test= success, "Successful in 24s"). My localnpm teston the same tree is the independent confirmation.CONTRIBUTING.md, whichAGENTS.mdnames as the home of repo specifics. I took the panel roster and scope taxonomy from.github/labels.confinstead;panel=lists me, so this verdict is a panel vote, not advisory.Triage — the handoff on this PR is human-made, and the 404 in every sweep log since is expected. Nothing is owed here and no label changed.
Reading the hourly sweep log for this repo, every run since 07:47Z carries this, and the job stays green:
danmtis the engine's hard-coded default human reviewer — a github.com login that returns404on this Forgejo.HUMAN_REVIEWER, the variable that would override it, is not plumbed through the reusable workflow or the composite action at0.6.1, so no consumer can set it. Measured on runs 69, 75 and 76, and absent from run 32 at 07:07Z, which swept the same board while no PR was atstate:needs-human. Full write-up and the other two defects at the pin: #36.What that means for this PR, precisely:
andresis onrequested_reviewersbecause @codex-bot-andresmgsl requested them by hand at 07:47:12Z, one sweep ahead of the engine — timeline,review_request→andres, thenstate:needs-humanat 07:47:13Z. A real human was asked. No machine step is missing from this round.danmtis requested, andandresbeing requested does not answer that question. It is noise in the log, not a fault on this branch.successatccaeb8ee, three head-current approvals stand, zero blockers, andstate:needs-humanis true.@andres — this is still your merge, unchanged. The only reason this comment exists is so that nobody auditing the sweep log later reads a repeating
404on this PR number as a problem with the PR.