Skip to content

ci: fetch the ADR citation check from .github instead of keeping a copy - #55

Merged
lesnik512 merged 1 commit into
mainfrom
shared-adr-check
Sep 27, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
shared-adr-check

Conversation

@lesnik512

Copy link
Copy Markdown
Member

What

Deletes `tests/test_adr_citations.py` (one of 25 byte-identical copies across the org) and adds a `just adr-check` recipe that fetches the file from `modern-python/.github` at `main` into a temp dir and runs it with `pytest --rootdir=.`. The `lint` job runs it once; it is not on the pytest matrix, since the check is interpreter-independent.

Why

Pilot of "shared test fetched from main" as the way to stop copying this file. The decision to track `main` rather than a pinned ref or a package is deliberate: one place to change the rule, no release step, no version bumps across 25 repos. The trade is that a change in `.github` takes effect everywhere at once, and a failing run cannot be reproduced against the file it saw unless the fetch is repeated while `main` is unchanged.

`--rootdir=.` makes the fetched file see this repo as the root without applying this repo's `addopts` (so the coverage gate does not fire on a one-file run). `adr_check_source` can be overridden to a `file://` path to run a not-yet-merged version of the check.

Depends on

modern-python/.github PR "test: take the repo root from pytest so the ADR check can run from a fetched copy". Until it merges, `main` still has the `file`-based root and the fetched copy scans the temp dir instead of this repo. The `adr-check` step here is only meaningful after that lands.

Verified locally

  • `just adr_check_source=file://<.github worktree>/tests/test_adr_citations.py adr-check`: 7 passed.
  • Same, with a planted broken citation in `eof_fixer/`: fails naming the file and the citation.
  • `just lint-ci` clean; `just test-ci`: 37 passed, coverage 100%.

@lesnik512
lesnik512 merged commit 98265c6 into main Sep 27, 2026
28 checks passed
@lesnik512
lesnik512 deleted the shared-adr-check branch September 27, 2026 18:51
This was referenced Sep 27, 2026
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