Skip to content

feat(roadmap): create a repository and install the Service App #6377

Done

Description

@dan-petty

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 --confirm it 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.repos in config.yaml and 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

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-petty and devops repos onboard retric-ai/devtools --create --visibility public --confirm runs against a fake GitHub that answers 404 for GET /repos/retric-ai/devtools.
  • THEN The test asserts one POST /orgs/retric-ai/repos request and no POST /user/repos request.

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 for GET /repos/dan-petty/devtools, and devops repos onboard dan-petty/devtools --create --visibility public --confirm runs.
  • THEN The test asserts one POST /user/repos request with license_template: "mit" and private: 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/devtools and 404 for GET /repos/dan-petty/devtools/contents/, and the run holds --confirm.
  • THEN The test asserts that no PATCH /repos/dan-petty/devtools request carries a license_template key.

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 and service.repos steps are in devops 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}/repos when the owner differs from the session login, else POST /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}/repos for another owner, POST /user/repos for the session login. The command takes <owner>/<name>, and the project already chooses the endpoint this way for Gitea.
    • Rejected: POST /user/repos always. 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.
  • 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.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#6773

Activity

  1. added
    type/feature
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 19, 2026
  2. dan-petty commented on Nov 19, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 19, 2026
  4. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    Owner question: See the first point of Open questions in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  5. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    Contributor

    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:

    • terraform github provider add repository to app installation resource, results: 5
    • GitHub CLI create repository add to GitHub App installation command, results: 5
    • github_app_installation_repository terraform, results: 5
    • gh repo create edit CLI github cli manual, results: 5
    • "github_app_installation_repository" documentation, results: 5
    • cli/cli gh repo create, results: 5
    • GitHub CLI repository creation automation tool, results: 5
    • PUT /user/installations/{installation_id}/repositories/{repository_id} REST API, results: 5

    Sources:

  6. added
    status/ready
    and removed
    status/new
    on Nov 27, 2026
  7. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  8. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 29, 2026
  9. removed
    status/in-review
    on Nov 29, 2026
  10. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-29 18:59 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions