Repository navigation
test: prevent fixture maintenance races during scaffold drift - #1941
Merged
Merged
Conversation
This was referenced Oct 27, 2026
gerchowl
added a commit
that referenced
this pull request
Oct 27, 2026
## 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 - [x] `feat` -- New feature - [x] `fix` -- Bug fix - [x] `docs` -- Documentation only - [x] `test` -- Adding or updating tests - [x] `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](#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. - [x] 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 - [x] My code follows the project's style guidelines - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [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 - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [x] 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixture commits can launch detached Git maintenance that removes loose objects while the scaffold-drift step clones the repository. Disable automatic maintenance in test fixture repositories before commits so those readers see stable objects.
Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
disable_git_auto_maintenancehelper intests/conftest.py, configuring repository-localmaintenance.auto=falseandgc.auto=0; document the race and prior art Placeholder-scan tests race against git housekeeping in .git/objects #1815.Changelog Entry
No changelog needed: test-only changes with no user-visible impact, per CLAUDE.md's rule for
testcommits.Testing
Manual Testing Details
uv run --with pytest-xdist pytest tests/test_scaffold_drift.py -k test_nix_drift_reports_clean_then_drift -n 4 --basetemp=$HOME/.cache/devkit-pytest/1939exited 1: both cases failed on the missing maintenance setting. Committed before implementation.uv run --with pytest-xdist pytest tests/test_scaffold_drift.py -n 4 --basetemp=$HOME/.cache/devkit-pytest/1939passed three times, 48 tests each, exit 0 each.uv run --with pytest-xdist pytest tests/test_scaffold_files.py tests/test_floating_tag_move.py tests/test_install_direnv_host.py --basetemp=$HOME/.cache/devkit-pytest/1939(22 passed, exit 0; serial verification). The initial-n 4run exited 1 (21 passed, 1 failed): the host-install cleanup assertion observed another worker's activedevkit-scaffold.*scratch directory. No unrelated test changes made.nix develop; flake evaluation/build and container suites left to CI as required.14ff14725718864ee5933c9f4aade153fead0fc2, including the aggregateTest Summarygate.gh pr checks 1941 --watchexited 0.Checklist
CHANGELOG.mdin the[Unreleased]section (not applicable; explained above)Additional Notes
This test-only change unblocks #1937. Production code is unchanged.
Refs: #1939