Repository navigation
Description
Update 2026-11-26 (infra move): devops repos onboard (#6773) now creates a repository (--create --visibility), sets settings and ruleset, creates the webhook and adds it to service.repos; the Apps already hold all repositories. Do not build devops repos init. Possibly left: a license at create and creation in an organization. A person should narrow or close this item.
Problem
Each new repository that devops-cli and the roadmap Service work on starts with manual steps. On 2026-11-19 the repository dan-petty/devtools was made by hand with devops gh api -X POST user/repos and the settings of devops-cli: public, MIT license, main, squash merge only, branch delete after merge. #3775 completes devops roadmap onboard for a repository that exists (labels, .github/labels.yml, clear-status.yml, OpenSpec, the webhook as a printed step), and it keeps these steps for a person: create the repository, turn on issues and the rules of the default branch, install the App devops-cli-service on the repository, create the webhook and its secret, and add the repository to service.repos.
Expected
- One command, run by a person (for example
devops repos init <owner>/<name>), makes a new repository with the settings of the project profile, or takes an existing empty repository, and then runs the onboarding of feat(roadmap): one pipeline onboards a service repository #3775 for it. Without--confirmit prints each request and makes none. - It adds the repository to the installation of the App devops-cli-service through the GitHub API (
PUT /user/installations/{installation_id}/repositories/{repository_id}) when the token of the person allows it. When the token cannot, it prints the installation page as a person step. Confirm the token type that this endpoint needs against the GitHub REST documentation before the build. - It creates the repository webhook of the Service with the secret from the keyring, when the person confirms, or prints it as a step (feat(roadmap): onboard checks the webhook of a repository #3772, feat(service): verify GitHub App webhooks with one secret #4417).
- It names the steps that stay with a person:
service.reposinconfig.yamland the deploy, and the repository rulesets if the token cannot set them. - Tests use a fake GitHub with a contract of the requests: a dry run makes no request; a token that cannot install the App gives the printed step and exit 0.
Related
- feat(roadmap): one pipeline onboards a service repository #3775 (onboard an existing repository), feat(roadmap): track one project profile for all repositories #4627 (one project profile for all repositories), feat(service): map each repository owner to its own App installation #5327 (an App installation for each owner).
Alternatives check of 2026-11-28: in-use.
The repository already uses this tool.
Tool: cli/cli (https://github.com/cli/cli), MIT, last activity 2026-11-27, maintained.
Reason: Searches found gh CLI (cli/cli), already in use here; its repo create takes an owner or organization and a license, which covers the narrowed scope of the MIT license at create and creation in an organization.
Covers:
- Creates a repository under an organization or the session user
- Sets the MIT license in the create request
- Public or private visibility chosen at create
Lacks:
- No dry run that prints each request and sends none
- No ruleset, webhook or service.repos step in the same run
- Not a library call the fake-GitHub test contract can intercept
Proposed design
Problem statement
Narrow this item to two steps of the existing devops repos onboard --create command: the MIT license at create and creation in an organization. devops repos onboard (#6773) now creates the repository, sets its settings and ruleset, creates the webhook and adds the repository to service.repos, and the Apps already hold all repositories. The rest of the original plan is obsolete, and this change builds no new command. The two steps edit the create request only.
Acceptance criteria
Requirement: An organization owner uses the organization endpoint
devops repos onboard SHALL create the repository through POST /orgs/{org}/repos when --create runs for an owner that is not the session login.
Scenario: Organization owner with --create
- WHEN The session login is
dan-pettyanddevops repos onboard retric-ai/devtools --create --visibility public --confirmruns against a fake GitHub that answers 404 forGET /repos/retric-ai/devtools. - THEN The test asserts one
POST /orgs/retric-ai/reposrequest and noPOST /user/reposrequest.
Requirement: A new repository gets the MIT license
The command SHALL set the MIT license in the create request of a new repository.
Scenario: New repository with the MIT license
- WHEN The session login is
dan-petty, the fake GitHub answers 404 forGET /repos/dan-petty/devtools, anddevops repos onboard dan-petty/devtools --create --visibility public --confirmruns. - THEN The test asserts one
POST /user/reposrequest withlicense_template: "mit"andprivate: false.
Requirement: The license stays out of an update request
The command MUST send license_template in a create request only.
Scenario: An existing empty repository
- WHEN The fake GitHub answers 200 for
GET /repos/dan-petty/devtoolsand 404 forGET /repos/dan-petty/devtools/contents/, and the run holds--confirm. - THEN The test asserts that no
PATCH /repos/dan-petty/devtoolsrequest carries alicense_templatekey.
Existing Tool Considered
The alternatives check in the issue body records in-use for cli/cli (https://github.com/cli/cli), MIT, maintained, because the repository already uses this tool. The block lists what the tool covers and lacks. The tool covers the remaining scope too: gh repo create creates a repository in an organization and with a license. The change keeps the one create path of devops repos onboard, which sends its requests through the session's gidgethub client, and adds no second path: about 40 lines of code and 80 lines of tests, about 4k tokens to build, under 1k tokens a month to keep, and about two hours of elapsed time.
Key questions
- What remains of this item after
devops repos onboard --create(feat(repos): onboard a repository with one command #6773)?: The create, settings, ruleset, webhook andservice.repossteps are indevops repos onboard --create, and the Apps already hold all repositories, so the App installation step is gone. The remaining scope is the MIT license at create and creation in an organization. [sources: tests/commands/test_repos_onboard.py, src/devops_cli/github/onboard/routes.py] - Which endpoint creates a repository when the owner is not the session login?:
POST /orgs/{org}/reposwhen the owner differs from the session login, elsePOST /user/repos, as the Gitea client already chooses its endpoint. (best practice) [sources: src/devops_cli/gitea/client.py:167, openspec/specs/gitea-remotes/spec.md:135, docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md]- Chosen:
POST /orgs/{org}/reposfor another owner,POST /user/reposfor the session login. The command takes<owner>/<name>, and the project already chooses the endpoint this way for Gitea. - Rejected:
POST /user/reposalways. It creates the repository under the authenticated user, not under the owner that the command names. - Rejected: Refuse an owner that is not the session login. ADR 0026 plans a move of the repositories to an organization, so the command would refuse the owner it needs.
- Chosen:
- Which license does the create request set?:
license_template: "mit". The create endpoints of GitHub take the field, and the update endpoint takes none, so the license applies at create only. The project ships under the MIT license. (best practice) [sources: pyproject.toml]- Chosen:
license_template: "mit"in the create request. The create endpoints take the field, and it writes the MIT license and its file in one request. - Rejected: No license at create. The repository then has no license file and no license metadata.
- Rejected: A field of the project profile. It changes the profile contract for one value that each repository of the project shares.
- Chosen:
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 19, 2026
Both deal with webhooks in the onboarding flow, but #3772 checks an existing webhook while the candidate creates one during repository init.devops-cli-service commentedon Nov 19, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 22, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (8)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 27, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
devops-cli-service commentedon Nov 29, 2026
Released in v0.251.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.251.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 18:59 UTC