Skip to content

feat(vig-utils): add GitHub App provisioning CLI - #1918

Merged
gerchowl merged 4 commits into
devfrom
feature/1909-gh-app-provision
Oct 26, 2026
Merged

gerchowl merged 4 commits into
devfrom
feature/1909-gh-app-provision

Conversation

@gerchowl

@gerchowl gerchowl commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

Add gh-app-provision to vig-utils so users can create a GitHub App through the manifest flow and store its credentials as repository Actions secrets using authenticated gh, without a PAT. The user completes GitHub's Create and Install browser steps.

Type of Change

  • feat -- New feature
  • fix -- Bug fix
  • docs -- Documentation only
  • chore -- Maintenance task (deps, config, etc.)
  • refactor -- Code restructuring (no behavior change)
  • test -- Adding or updating tests
  • ci -- CI/CD pipeline changes
  • build -- Build system or dependency changes
  • revert -- Reverts a previous commit
  • style -- Code style (formatting, whitespace)

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • Port the provisioning helpers, manifest form, callback handling, secret wiring snippet, and server lifecycle into a stdlib module with a console entry point.
  • Add a network-free --dry-run, reverse-proxy --base-url, exclusive mode-0600 --pem-out, and --no-secrets for skipping repository secret writes.
  • Change the private tool's binding contract: default to 127.0.0.1, bind and advertise the exact explicit IPv4 --host, and use loopback behind --base-url. Remove host autodetection and reject wildcard addresses. Remote browsers require an explicit reachable host or proxy.
  • Exchange the manifest code with captured gh api output. Send secret values through stdin to gh secret set; capture subprocess output and sanitize failure messages so codes and credentials never reach terminal or request logs.
  • Document binding, proxy path forwarding, partial secret writes, PEM recovery, timeouts, and exit codes in module help. Close the server on success, failure, timeout, and interruption.

Changelog Entry

Added

  • GitHub App provisioning CLI (#1909)
    • Add gh-app-provision to create an App through GitHub’s manifest flow and store repository secrets, with a network-free --dry-run, reverse-proxy --base-url, exclusive private-key --pem-out, and --no-secrets

Testing

  • Tests pass locally (just test-vig-utils, with four workers and an isolated basetemp outside the repository): 813 passed, exit 0.
  • Manual testing performed (describe below)

Manual Testing Details

  • uv run pytest packages/vig-utils/tests/test_gh_app_provision.py -n 4 --basetemp=$HOME/.cache/devkit-pytest/1909: 34 passed, exit 0, including the eight source tests, console entry point, dry-run side effects, callback success/failure and secret redaction, PEM permissions/exclusive creation, binding rules, skipped secret writes, and cleanup.
  • Recorded failing tests before implementation in separate test commits. The round-3 pre-change run failed six assertions for the old binding and exchange behavior (exit 1).
  • Reviewed the diff and CLI help. Real App provisioning is reserved for the owner after merge; automated exchanges and writes are mocked.
  • Final package-suite verification after the metadata refactor and rebase: uv run --with pytest-xdist pytest packages/vig-utils/tests -n 4 --basetemp=$HOME/.cache/devkit-pytest/1909: 813 passed, exit 0.
  • Full container and Nix evaluation suites are left to CI.
  • Initial CodeQL analysis falsely classified the public slot-name helper and CLI name prefix as secret values. Rename these metadata identifiers to distinguish credential slots from credential contents; retain output-redaction coverage and every security check without suppressions.

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 (module docstring and --help; standalone docs and skill are a separate PR)
  • 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 (none)

Additional Notes

Follow-ups outside this PR: the human docs page and plugin skill (PR 2), organization secrets with selected-repository visibility (--org-secret --repos), the Nix access-tokens recipe, a flake app wrapper, and the owner's real end-to-end provisioning run after merge.

All checks on the final head pass, including CodeQL and the CI Test Summary. Commit hooks, including Bandit and scaffold synchronization, pass. The worktree is clean and the branch includes the latest dev.

Refs: #1909

@gerchowl
gerchowl force-pushed the feature/1909-gh-app-provision branch from 2d6043d to fd7a921 Compare October 26, 2026 18:50
@gerchowl
gerchowl merged commit b603900 into dev Oct 26, 2026
16 checks passed
@gerchowl
gerchowl deleted the feature/1909-gh-app-provision branch October 26, 2026 19:00
gerchowl added a commit that referenced this pull request Oct 26, 2026
## Description

Part A2 of #1909: the human docs page and the agent skill for
`gh-app-provision` (CLI shipped in #1918). Docs and skill only; no
change to `gh_app_provision.py` or its tests.

## Type of Change

- [x] `docs` -- Documentation only

### Modifiers

- [ ] Breaking change (`!`) -- This change breaks backward compatibility

## Changes Made

- `docs/GITHUB_APP_PROVISIONING.md`: App vs PAT, end-to-end flow, the
three binding modes (default `127.0.0.1`, `--host`, `--base-url`) and
the remote-browser failure mode, key handling (`--pem-out`,
`--no-secrets`), the SHA-pinned `actions/create-github-app-token`
snippet, and known limits (#1915, #1919).
- `plugins/devkit/skills/app-provision/SKILL.md`:
`/devkit:app-provision`, with `disable-model-invocation: true` because
it creates an App and writes secrets.
- Links from `docs/WORKFLOW_SECURITY.md`, `packages/vig-utils/README.md`
and `plugins/devkit/README.md`; `app-provision` added to
`EXPECTED_SKILLS` in `tests/test_devkit_plugin.py`.

## Changelog Entry

### Added

- **GitHub App provisioning CLI**
([#1909](#1909))
- Add the [GitHub App provisioning
guide](docs/GITHUB_APP_PROVISIONING.md), linked from
`docs/WORKFLOW_SECURITY.md`, and the `/devkit:app-provision` agent skill

## Testing

- [x] Tests pass locally: TDD does not apply (docs and a skill file).
`tests/test_devkit_plugin.py`: 213 passed. `check-skill-names
plugins/devkit/skills`: exit 0.
- [x] Manual testing performed: every flag named in the docs checked
against `uv run gh-app-provision --help`.

### Manual Testing Details

Pre-commit hooks (pymarkdown, typos, manifest sync) pass.

## Checklist

- [x] My code follows the project's style guidelines
- [x] I have performed a self-review of my code
- [x] I have updated the documentation accordingly
- [x] I have updated `CHANGELOG.md` in the `[Unreleased]` section (and
pasted the entry above)
- [x] My changes generate no new warnings or errors

## Additional Notes

CI may be red on the expired `.vulnixignore` exceptions, which is being
fixed separately.

Refs: #1909
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.

2 participants