Skip to content

feat: scan preserved configs for retired hook blocks - #1653

Merged
c-vigo merged 4 commits into
devfrom
feature/1652-preserved-hook-drift-scan
Sep 21, 2026
Merged

c-vigo merged 4 commits into
devfrom
feature/1652-preserved-hook-drift-scan

Conversation

@c-vigo

@c-vigo c-vigo commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Description

A hand-edited .pre-commit-config.yaml is preserved on upgrade (#878), so template hook changes never reach it. That is right for hook-stack evolution and wrong for a hook fix: the repos carrying the broken block are exactly the ones the fix was written for.

Concretely, a config scaffolded before #1170 keeps the upstream jackdewinter/pymarkdown hook forever. It is language: python, so prek builds a venv on its own base interpreter while the flake toolchain's pymarkdownlnt targets default_language_version — the C-extension import then fails (ModuleNotFoundError: No module named 'pyjson5.pyjson5'), breaking just precommit, every local markdown commit, and the devkit-upgrade.yml commit step. A stale consumer's auto-upgrade can never land, and nothing says why.

This adds the missing signal: a table-driven scan of preserved files for blocks the template retired because they break.

Closes #1652.

Type of Change

  • feat -- New feature

Changes Made

Changelog Entry

### Added

- **Scan a preserved `.pre-commit-config.yaml` for retired hook blocks**
  ([#1652](https://github.com/vig-os/devkit/issues/1652))

(full entry with sub-bullets is in CHANGELOG.md under ## Unreleased)

Testing

  • Tests pass locally (just test)

tests/bats/init-workspace.bats (6 new, all green):

tests/test_workflow_devkit_upgrade.py (2 new): the step captures the marker into GITHUB_OUTPUT, and the PR-body step routes it through env: (never ${{ }} inside run:).

Full suites green locally: 276/276 bats in init-workspace.bats, 760 pytest (image/integration excluded — they need a rebuilt image), prek run --all-files clean, and the actionlint-over-rendered-workflows gates pass.

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
  • My changes generate no new warnings or errors
  • I have added tests that prove my feature works
  • New and existing unit tests pass locally with my changes

Follow-up (not in this PR)

A warning does not unstick a consumer that is already broken: their upgrade fails at the prek-gated commit step before any PR opens. The only thing that would is a surgical auto-fold of the block when it byte-matches the known old shape (precedent: migrate_root_gitignore, #1145). That edits a consumer-owned file, so it deserves its own issue rather than riding along here — filed as #1654.

@c-vigo
c-vigo merged commit 6acdc4c into dev Sep 21, 2026
12 checks passed
@c-vigo
c-vigo deleted the feature/1652-preserved-hook-drift-scan branch September 21, 2026 06:26
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