Skip to content

fix(repos): onboard reads the release App client ID from GitHub #7305

Done

Description

@dan-petty

Problem or Motivation

devops repos onboard prints two person steps for each repository, although GitHub already holds the release App of the account:

Person steps:
1. Give the variable RELEASE_APP_CLIENT_ID its value: devops config set github.release_app_client_id <value>.
2. Store the value of RELEASE_APP_PRIVATE_KEY: devops config set github.release_app_private_key --from-file <file>, or give --release-key-file.

Read on 2026-11-26:

  • The environment release of dan-petty/devops-cli, dan-petty/infra and dan-petty/devtools holds the variable RELEASE_APP_CLIENT_ID with one value, and the secret RELEASE_APP_PRIVATE_KEY.
  • The local configuration has no github.release_app_client_id and no credential github.release_app_private_key (devops config show: not set).
  • devops repos onboard --all --plan prints step 1 for each of the 9 repositories, and step 2 for each repository with no secret. For dan-petty/devtools the row Release secret is present, and the plan still prints step 1, because row 5 does not read the variable when the setting is absent (src/devops_cli/github/onboard/settings_rows.py:58).

The owner said on 2026-11-26: "I know I have already configured the release app and should not have to manually do it for every repo in my org or personal account space".

Two faults:

  1. The client ID is not a secret. GitHub returns it from GET /repos/{repo}/environments/release/variables/RELEASE_APP_CLIENT_ID of a repository that has it. The command asks a person for a value that it can read.
  2. The output repeats the same once-only steps under each repository, so it reads as one manual step for each repository.

Proposed Solution

Disposition: change the code.

  • When github.release_app_client_id is not set, the command reads RELEASE_APP_CLIENT_ID from the environment release of the repository of github.template_repository (default dan-petty/infra). It uses that value for row 5 and names the source in the row. The person step stays only when that read finds no variable.
  • A row whose variable is present with that value is present, and prints no person step.
  • A run over more than one repository (--all) prints each once-only person step one time, after the last report, with the count of repositories that wait for it.
  • The private key stays a person step: GitHub gives no secret value back. The text says that one devops config set github.release_app_private_key --from-file <file> serves each later repository.

Proof: with no github.release_app_client_id, devops repos onboard dan-petty/devtools --plan shows row 5 as present and prints no step for the client ID. A test over the fake GitHub API covers the read from the template repository, the missing variable, and the single print of a once-only step for two repositories.

Existing Tool Considered

The GitHub REST API for environment variables, which the command already uses to write the variable. No new tool.

Alternatives check of 2026-11-26: in-use.
The item already names this tool.
Tool: github/rest-api-description (https://github.com/github/rest-api-description), MIT, last activity 2026-11-26, maintained.
Reason: Searches surfaced only the GitHub REST API for environment variables, which the command already uses: it returns the non-secret client ID from the template repository's release environment, while the once-only step printing stays the command's own code.

Covers:

  • Reads one environment variable's value of a repository
  • Lists the variables of the release environment
  • Serves the non-secret client ID without a person

Lacks:

  • No single print of a once-only person step across repositories
  • No secret value read; the private key stays a person step
  • No fallback to the template repository by itself

Proposed design

Problem statement

devops repos onboard asks a person for the release App client ID for each repository, although GitHub holds the value in the release environment of the template repository. It also prints each once-only person step under each repository. The output then reads as one manual step for each repository. The command must read the non-secret client ID from GitHub and print each once-only step one time.

Acceptance criteria

Requirement: Client ID read from the template repository

When github.release_app_client_id is not set, the onboard command SHALL read RELEASE_APP_CLIENT_ID from the release environment of the repository named by github.template_repository.

Scenario: Setting absent and template repository holds the variable

  • WHEN the test runs the plan for a repository whose release environment holds RELEASE_APP_PRIVATE_KEY, with no github.release_app_client_id, and the fake GitHub API returns RELEASE_APP_CLIENT_ID for the template repository
  • THEN the client ID row shows present, names the template repository as the source, and the plan prints no client ID person step for that repository.

Requirement: Client ID step stays when the read finds no variable

The onboard command SHALL print the client ID person step only when the read of RELEASE_APP_CLIENT_ID returns no value.

Scenario: Setting absent and template repository has no variable

  • WHEN the test runs the plan with no github.release_app_client_id and the fake GitHub API returns no RELEASE_APP_CLIENT_ID for the release environment of the template repository
  • THEN the plan prints the step devops config set github.release_app_client_id <value> and the client ID row is not present.

Requirement: Once-only steps print one time per run

A run over more than one repository SHALL print each once-only person step one time, after the last report, with the count of repositories that wait for it.

Scenario: Two repositories wait for the same once-only steps

  • WHEN the test runs devops repos onboard --all --plan over two repositories whose release environment has no RELEASE_APP_CLIENT_ID and no RELEASE_APP_PRIVATE_KEY, with no github.release_app_client_id
  • THEN the output holds one client ID step and one private key step after the last report, each with the count 2, and no per-repository copy.

Requirement: Private key step names one command for later repositories

The private key person step MUST state that one devops config set github.release_app_private_key --from-file <file> serves each later repository.

Scenario: Private key step text

  • WHEN the test runs the plan for a repository whose release environment has no RELEASE_APP_PRIVATE_KEY
  • THEN the printed step names devops config set github.release_app_private_key --from-file <file> and says that one command serves each later repository.

Existing Tool Considered

Verdict in-use for github/rest-api-description. The alternatives check in the issue body lists what the tool covers and lacks. The proposal reads the non-secret RELEASE_APP_CLIENT_ID through the GitHub session that already writes the variable. It adds the two parts that the tool lacks: the fallback to github.template_repository when the setting is absent, and one print of each once-only step for a run over many repositories. The added code is small and needs no new dependency.

Key questions

  • Does row 5 read RELEASE_APP_CLIENT_ID when github.release_app_client_id is absent?: No. Row 5 reads the setting only. It prints the client ID step when the setting is absent, even when the release environment holds the variable. [sources: src/devops_cli/github/onboard/settings_rows.py:58]
  • Which repository gives RELEASE_APP_CLIENT_ID when github.release_app_client_id is absent?: The repository named by github.template_repository, default dan-petty/infra. The command reads the variable from its release environment. (best practice) [sources: src/devops_cli/config/settings.py, docs/CONFIGURATION.md]
    • Chosen: Template repository from github.template_repository. The proposed solution names it, and dan-petty/infra holds the release environment with the variable.
    • Rejected: First repository of the run. The first repository may lack the variable, and the source would change with the argument order.
    • Rejected: Each repository's own release environment. A repository that lacks the variable gives no value, so the command would still ask a person.
  • How does the command read the environment variable?: Through the existing GitHub session (gidgethub), with GET /repos/{owner}/{repo}/environments/release/variables/RELEASE_APP_CLIENT_ID. The command uses the same client that writes the variable. (best practice) [sources: src/devops_cli/github/onboard/settings_rows.py]
    • Chosen: Existing GitHub session (gidgethub). ADR 0006 requires gidgethub, and the command already writes the variable through that session.
    • Rejected: Direct HTTP request with requests. ADR 0006 sends GitHub requests through gidgethub, so a second client breaks the rule.
    • Rejected: gh api subprocess. AGENTS.md rule 7 says never run bare gh, and a subprocess adds a process edge.
  • When does the command print the client ID person step?: Only when the read of RELEASE_APP_CLIENT_ID from the template repository returns no value. A repository whose variable holds the effective value shows row 5 as present and gets no step. (best practice) [sources: src/devops_cli/github/onboard/settings_rows.py:58]
    • Chosen: Print only when the read finds no variable. The proposed solution asks for it, and it removes the step for each repository that has the value.
    • Rejected: Always print the step. It repeats a value that GitHub can answer, which is the first fault.
    • Rejected: Print when the private key is absent. The client ID does not depend on the private key.
  • How does a run over more than one repository print a once-only person step?: One time, after the last report, with the count of repositories that wait for it. (best practice) [sources: src/devops_cli/github/onboard/run.py]
    • Chosen: One time after the last report with a count. It removes the repetition and keeps the count of repositories that wait.
    • Rejected: Under each repository. It reads as one manual step for each repository, which is the second fault.
    • Rejected: Before the first report. The reader sees the step before the rows that need it.
  • Does the private key stay a person step?: Yes. GitHub returns no secret value, so the command keeps the devops config set github.release_app_private_key --from-file <file> step. The text says that one command serves each later repository. (best practice) [sources: src/devops_cli/github/onboard/settings_rows.py]
    • Chosen: Keep the person step and name one command. GitHub returns no secret value, and one command serves later repositories.
    • Rejected: Read the secret from the template repository. The GitHub API returns no secret value.
  • Which test double does the plan test use for GitHub?: The fake GitHub repository in tests/support/github_repository.py. The tests tests/github/onboard/test_onboard_rows.py and tests/commands/test_repos_onboard.py use it. [sources: tests/support/github_repository.py, tests/github/onboard/test_onboard_rows.py, tests/commands/test_repos_onboard.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    source/agent
    on Nov 26, 2026
  2. dan-petty commented on Nov 26, 2026

    @dan-petty
    OwnerAuthor
  3. added
    status/new
    value/medium
    effort/medium
    scope/repos
    priority/p2-medium
    on Nov 26, 2026
  4. devops-cli-service commented on Nov 26, 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:

    • GitHub REST API list environment variables repository endpoint, results: 5
    • GitHub API get repository environment variable value client id, results: 5
    • docs.github.com REST API actions variables, results: 5
    • PyGithub get environment variable, results: 5
    • octokit rest actions getEnvironmentVariable, results: 5
    • github docs "Get an environment variable" repository actions variables, results: 5
    • "/repos/{owner}/{repo}/environments/{environment_name}/variables", results: 5
    • GitHub Actions environments variables REST API documentation page read variable value, results: 5

    Sources:

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

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    Live since 2026-11-29 03:13 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/repossource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions