Skip to content

feat(service): the roadmap jobs act as a github app installation on an organization-owned board, so the service runs again without the suspended machine account #1647

Description

@dan-petty

Friction

Re-scope (owner decision, 2026-10-28)

  • No organization. The repositories and the board stay on the personal account dan-petty. The Service acts as a GitHub App, devops-roadmap, which the personal account owns and installs on its repositories. A private App can be installed on the account that owns it (docs.github.com/en/apps/using-github-apps/installing-your-own-github-app). The repository permissions (Issues, Pull requests, Contents, Checks, Actions, Metadata) work on repositories that a user owns.
  • The App cannot reach the project board. GET /users/dan-petty gives type: User. The roadmap board is number 12 (.github/roadmap.toml), which that user owns. GitHub gives Apps the "Projects" permission only for an organization (docs.github.com/en/rest/authentication/permissions-required-for-github-apps), so an App installation cannot read or write a user-owned Projects v2 board.
  • The owner said: "roadmap should perform all expected functionality even if project board is unavailable for the repository". A separate item makes labels and milestones hold the roadmap state, so that no roadmap job reads or writes the board. This item does not change how the store reads or writes the board.
  • Dropped from this item: the move to an organization, the GHCR and URL sweep, and the organization permission "Projects".
  • A workstation run of devops keeps using the person's own gh login.

Evidence

Checked at main 3dd7fa6 (v0.2.36), and again on 2026-10-28.

  • The identity today is one machine user with a classic token.
    • devops k8s push-secrets reads the machine account's token from gh's keyring into Secret devops/devops-cli, key GH_TOKEN.
    • The process looks the token up once with gh auth token and keeps it for its whole life (src/devops_cli/core/process.py). Every gh and git child gets it pinned, and git authenticates through gh auth git-credential (Dockerfile).
    • The login comes from GET /user (src/devops_cli/github/session.py). The job clone commits as <login>@users.noreply.github.com (src/devops_cli/roadmap/run.py).
    • The webhook route drops deliveries sent by service.machine_account, and devops serve --service refuses to start without that setting.
  • What an installation token breaks in today's code.

Remedy

Steps that only the owner takes:

  1. Create the GitHub App devops-roadmap on the personal account, with no webhook and no user authorization, and these repository permissions: Issues read/write, Pull requests read/write, Contents read/write, Checks read, Actions read, Metadata read. Install it on the managed repositories ("Only on this account"), and generate a private key.
  2. Store the App ID, the installation ID and the slug with devops config set service.github_app.app_id, service.github_app.installation_id and service.github_app.slug. Store the private key with devops config set service.github_app.private_key --from-file <key.pem>, the multi-line secret input of feat(config): devops config set stores a multi-line secret, such as a pem private key, from a file or stdin, never from argv or a one-line prompt #1649.
  3. Run devops k8s push-secrets --stack devops. Keep deployment/roadmap-service at replicas: 0 until the board-independence item merges too.

Code (one pull request; #1409, #1649 and #983 are closed):

  • An App installation as a session token source.
    • A process whose environment holds the App's private key (DEVOPS_CLI_SERVICE_GITHUB_APP_PRIVATE_KEY, from Secret devops/devops-cli) acts as the App. A workstation keeps the key in the keyring only, so it keeps the person's gh login.
    • The session signs a JWT from the App ID and private key, and exchanges it for an installation token (gidgethub.apps.get_jwt / get_installation_access_token). It refreshes the token before expiry.
    • gh and git children get the current token through the existing pin and credential helper.
  • Login and commit identity.
    • With an App identity, the session's login is <app-slug>[bot], from settings, and it makes no GET /user.
    • The job clone commits as <bot-user-id>+<app-slug>[bot]@users.noreply.github.com.
    • The ledger directory is keyed by the installation, not by the token.
  • Settings and secrets.
    • service.github_app.app_id, service.github_app.installation_id and service.github_app.slug go into the ConfigMap (src/devops_cli/k8s/configmap.py, k8s/devops/configmap.example.yaml).
    • The private key becomes a managed secret in Secret devops/devops-cli. It replaces the GH_TOKEN / GitHubAccountSource row and the gh-account read of push-secrets.
    • service.machine_account and k8s.github_account go, with no alias (pre-1.0). The webhook filter compares the sender with the App's bot login.
  • Docs.
    • A new ADR, at the next free number in docs/adr/ (0015), supersedes ADR 0002.
    • k8s/README.md's Roadmap service steps 1-3 and 9 describe the App.
  • Not in this item.
    • replicas: 1 and the removal of the suspension notices: after this item and the board-independence item merge.
    • The board-independence item: labels and milestones hold the roadmap state.
    • Replacing the per-repository webhooks with the App's single webhook: a follow-up.

Acceptance criteria

  • With GitHub faked at the process edge and a test RSA key:
    • the session mints an installation token and refreshes it before it expires, and a gh child started after the refresh gets the new token;
    • no GET /user is made, and the login is <app-slug>[bot].
  • A delivery sent by <app-slug>[bot] starts no roadmap round, and a person's delivery still does.
  • devops k8s push-secrets --dry-run lists the App key entry without its value, and lists no GH_TOKEN entry.
  • git grep -n "machine_account\|github_account\|GitHubAccountSource" -- src/ returns nothing.
  • Tests are offline, each call phase stays under 1 s, and uv run devops ci passes.
  • Pending a person, after the merge: with the App's private key in DEVOPS_CLI_SERVICE_GITHUB_APP_PRIVATE_KEY, a devops gh api read of a managed repository succeeds as devops-roadmap[bot].

Feasibility

Checked on 2026-10-28. The re-scoped item fits one pull request.

  • The pinned gidgethub 6.0.0 has gidgethub.apps.get_jwt and get_installation_access_token (read from the installed library source).
  • gh takes any token in GH_TOKEN ("takes precedence over previously stored credentials", gh help environment). The GITHUB_TOKEN of GitHub Actions is an installation token, and GitHub documents it with gh as GH_TOKEN.

Risks:

  • An App private key sits in the cluster Secret. It is narrower than the classic repo + project token it replaces: it covers only the installed repositories and the granted permissions, and the tokens it mints expire after one hour.
  • No roadmap job can use the board as the App. The Service stays at replicas: 0 until the board-independence item merges.

Related

Proposed design

Problem statement

The roadmap service is suspended because its machine account was suspended by GitHub. This prevents automated jobs from running. The solution migrates the roadmap board to an organization and configures the service to act as a GitHub App installation.

Acceptance criteria

  • Criterion 1: The session mints an installation token and refreshes it before it expires, with gh children getting the new token after refresh
    Verification: Test that verifies the session exchanges a JWT for an installation token and refreshes it before expiry, ensuring child processes get the updated token
  • Criterion 2: No GET /user is made and the login is [bot]
    Verification: Verify that _get_session_login() does not call GET /user and returns the App's bot login instead of a user login
  • Criterion 3: A delivery sent by [bot] starts no roadmap round, but a person's delivery still does
    Verification: Assert webhook filtering correctly ignores deliveries from the App's bot login while processing human-generated deliveries
  • Criterion 4: devops k8s push-secrets --dry-run lists the App key entry without its value and no GH_TOKEN entry
    Verification: Run devops k8s push-secrets --dry-run and confirm the output includes the App private key secret but excludes GH_TOKEN
  • Criterion 5: Git grep returns nothing for machine_account, github_account or GitHubAccountSource
    Verification: Execute git grep -n "machine_account|github_account|GitHubAccountSource" -- src/ and verify no matches are found
  • Criterion 6: Tests pass offline with each call phase under 1 second
    Verification: Run uv run devops ci and confirm all tests pass in offline mode with sub-second execution times per call phase

Key questions

  • Should the organization keep the current login or use a new one?: The organization can keep the current login, which means no URL sweep is needed. If a new login is used, a second pull request will be required for the URL sweep. (proposed)

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#983

Activity

  1. added
    source/agent
    type/feature
    on Oct 18, 2026
  2. dan-petty commented on Oct 18, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Type: type/feature. The candidate proposes a new feature to make the roadmap jobs act as a GitHub App installation on an organization-owned board.
    • Priority: P1-High. The suspended machine account blocks critical deployment and development activities, making this a high-priority issue.
    • Value: High. This change resolves the suspension blockage that affects multiple items and prevents automated release processes.
    • Effort: High. The change involves significant infrastructure and authentication model shifts including moving boards to an organization and adopting GitHub Apps.
  3. dan-petty commented on Oct 26, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at 085ca36 (see proposed design in issue body).

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

    source/agenttype/feature

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions