Skip to content

feat: extend GitHub App provisioning for organizations and Nix - #1940

Merged
gerchowl merged 4 commits into
devfrom
feature/1915-gh-app-provision-org-secrets
Oct 27, 2026
Merged

gerchowl merged 4 commits into
devfrom
feature/1915-gh-app-provision-org-secrets

Conversation

@gerchowl

@gerchowl gerchowl commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Extend GitHub App provisioning to store organization secrets with selected-repository visibility, expose a Nix flake app, and report the correct terminal state after a rejected callback.

Type of Change

  • feat -- New feature
  • fix -- Bug fix
  • docs -- Documentation only
  • test -- Adding or updating tests
  • build -- Build system or dependency changes

Modifiers

  • Breaking change (!)

Changes Made

  • Normalize comma-separated repository names before provisioning and reject --repos without --org-secret.
  • Add --org-secret --repos with organization-owner validation and mutual exclusion with --no-secrets; credentials stay on stdin and subprocess output stays captured.
  • Expose nix run .#app-provision through the existing vig-utils package.
  • Preserve callback replay protection while showing “This provisioning run has ended” after rejection or failure.
  • Document selected-repository secrets, the flake entry point, and a SHA-pinned workflow recipe that masks the App token and appends to existing NIX_CONFIG.

Changelog Entry

Added

  • GitHub App organization secrets and Nix entry point (#1915)
    • Store App credentials as organization secrets with selected-repository visibility using --org-secret --repos
    • Run provisioning through nix run .#app-provision and document masked App tokens appended to existing Nix configuration
    • Show a terminal-state page for callbacks after a rejected or failed provisioning attempt

Testing

Round 2: regression tests first produced 3 failures and 1 pass (exit 1), then the full provisioning suite passed (59 tests, exit 0): uv run --with pytest-xdist pytest packages/vig-utils/tests/test_gh_app_provision.py -n 4 --basetemp=$HOME/.cache/devkit-pytest/1915-r2.

  • RED: focused provisioning tests failed on existing repository argv and incorrect replay page (exit 1); validation tests failed on unrecognized flags (exit 1); flake app eval failed on missing attribute (exit 1). Committed tests before implementation.
  • GREEN: uv run --with pytest-xdist pytest packages/vig-utils/tests/test_gh_app_provision.py tests/test_flake_checks.py::test_app_provision_app_points_at_console_script -n 4 --basetemp=$HOME/.cache/devkit-pytest/1915 — 56 passed, exit 0.
  • After extracting credential argument wiring: provisioning suite — 55 passed, exit 0.
  • Manual testing performed

Manual Testing Details

nix run .#app-provision -- --dry-run --name example-bot --owner example --repo example/repo --org-secret --repos repo,other printed the manifest and exited 0. No live App or secrets were created. Full Nix/container suites remain CI checks.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

Rebased onto dev after #1941 merged the fixture maintenance fix for #1939. Final CI passed on rebased head e7b975eb54d7f54ce418d638c0e028ac3985b073, including Test Summary, Project Tests and flake gates.

Secret writes remain sequential and may partially succeed; the existing exclusive recovery PEM behavior applies to both storage modes. Organization plan/policy and installation requirements are documented. App token Nix configuration overrides earlier access-tokens directives while preserving other settings.

Refs: #1915

@gerchowl
gerchowl force-pushed the feature/1915-gh-app-provision-org-secrets branch from 9ac40ec to e7b975e Compare October 27, 2026 09:26
@gerchowl
gerchowl merged commit 3cc86ab into dev Oct 27, 2026
18 checks passed
@gerchowl
gerchowl deleted the feature/1915-gh-app-provision-org-secrets branch October 27, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant