Skip to content

feat(ci): resolve fork-safe runner classes and lanes - #1937

Merged
gerchowl merged 4 commits into
devfrom
feature/1925-runner-selection-core
Oct 27, 2026
Merged

gerchowl merged 4 commits into
devfrom
feature/1925-runner-selection-core

Conversation

@gerchowl

@gerchowl gerchowl commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Resolve runner classes from GitHub variables with the ADR fork predicate enforced inside the action. Migrate scaffolded CI to class and lane outputs while preserving the deprecated SMALL alias for existing callers.

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

  • Validate each class variable as one label; resolve fork → variable → legacy key → hosted default, with variables winning over the key.
  • Pass only scalar PR context fields; validate ASCII labels independently of locale and compare repository names case-insensitively.
  • Export runners and runner-sources; every lane defaults to SMALL. Pass the extension lane through the existing reusable input.
  • Execute the action Bash in tests for all classes and sources, malformed labels, whitespace, independent fallback, and fork payload variants. Pin workflow routing and forbidden triggers.

Changelog Entry

Added

  • Fork-safe CI runner classes (#1925)
    • Resolve independent runner variables and route CI lanes through validated class outputs.

Testing

uv run --with pytest-xdist pytest tests/test_ci_runner.py tests/test_scaffold_drift.py tests/test_workflow_ci_extension.py -n 4 --basetemp=$HOME/.cache/devkit-pytest/1925

Initial RED: exit 1, 54 failed and 182 passed. Round-two RED: exit 1, all three new regressions failed (E2BIG, UTF-8 label, repository-name case). GREEN: exit 0, 239 passed. Tests committed before implementation. Commit hooks run inside nix develop.

  • Tests pass locally (just test)
  • Manual testing performed (describe below)

Manual Testing Details

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 (edit docs/templates/, then run just docs)
  • 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

Refs: #1925

@gerchowl
gerchowl force-pushed the feature/1925-runner-selection-core branch from c7ce9f9 to d125157 Compare October 27, 2026 09:18
gerchowl added a commit that referenced this pull request Oct 27, 2026
## 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 feature
- [ ] `fix` -- Bug fix
- [ ] `docs` -- Documentation only
- [ ] `chore` -- Maintenance task (deps, config, etc.)
- [ ] `refactor` -- Code restructuring (no behavior change)
- [x] `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

- Add one shared `disable_git_auto_maintenance` helper in
`tests/conftest.py`, configuring repository-local
`maintenance.auto=false` and `gc.auto=0`; document the race and prior
art #1815.
- Apply it to the drift, scaffold-file walk, floating-tag remote,
host-install and flake-consumer fixture repositories before commits.
- Assert both settings in the real drift fixture, preserving the
clean-then-drift behavior test. No retries or sleeps.

## Changelog Entry

No changelog needed: test-only changes with no user-visible impact, per
CLAUDE.md's rule for `test` commits.

## Testing

- [x] Tests pass locally (targeted suites; full suite delegated to CI)
- [x] Manual testing performed (describe below)

### Manual Testing Details

- RED: `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/1939` exited 1: both cases failed
on the missing maintenance setting. Committed before implementation.
- GREEN: `uv run --with pytest-xdist pytest tests/test_scaffold_drift.py
-n 4 --basetemp=$HOME/.cache/devkit-pytest/1939` passed three times, 48
tests each, exit 0 each.
- Related suites: `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 4` run exited 1 (21 passed, 1 failed):
the host-install cleanup assertion observed another worker's active
`devkit-scaffold.*` scratch directory. No unrelated test changes made.
- Commands run inside `nix develop`; flake evaluation/build and
container suites left to CI as required.
- CI watched to completion: all 16 checks passed on
`14ff14725718864ee5933c9f4aade153fead0fc2`, including the aggregate
`Test Summary` gate. `gh pr checks 1941 --watch` exited 0.

## 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 (helper docstring; no
consumer documentation change)
- [ ] I have updated `CHANGELOG.md` in the `[Unreleased]` section (not
applicable; explained 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 (none
required)

## Additional Notes

This test-only change unblocks #1937. Production code is unchanged.

Refs: #1939
@gerchowl
gerchowl force-pushed the feature/1925-runner-selection-core branch from d125157 to 11efdea Compare October 27, 2026 09:25
@gerchowl
gerchowl force-pushed the feature/1925-runner-selection-core branch from 11efdea to 96ea07f Compare October 27, 2026 09:36
@gerchowl
gerchowl merged commit b2d4e70 into dev Oct 27, 2026
16 checks passed
@gerchowl
gerchowl deleted the feature/1925-runner-selection-core branch October 27, 2026 09:44
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