Skip to content

ci: detect public-API breakage with griffe check - #118

Merged
bagowix merged 1 commit into
mainfrom
feat/104-griffe-api-check
Aug 2, 2026
Merged

ci: detect public-API breakage with griffe check#118
bagowix merged 1 commit into
mainfrom
feat/104-griffe-api-check

Conversation

@bagowix

@bagowix bagowix commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add .github/workflows/api-compatibility.yml: a pull-request job that runs
    griffe check interlock --search ., diffing the working tree's public API
    against the latest release tag (removed/renamed objects, changed parameter
    kinds, order or defaults, narrowed return types).
  • Covers interlock/__init__.py's re-exports and interlock/integrations/*,
    which is public even though it is not re-exported.
  • Escape hatch: a detected breakage fails the job unless the PR is labelled
    breaking-change (created on the repo), in which case it's reported as a
    warning instead — a future major release should not be blocked by its own
    tooling.
  • griffe added as a dev-only dependency (uv add --dev griffe); the core
    stays at zero dependencies.
  • Documented the local command and the escape hatch in CONTRIBUTING.md,
    and the tool/command in AGENTS.md.

Checklist

  • Tests added or updated (suite stays at 100% coverage) — no production
    code changed; full suite still passes at 100% coverage
  • uv run ruff format --check and uv run ruff check pass
  • uv run mypy, uv run pyright and uv run pyrefly check pass
  • Docs updated (CONTRIBUTING.md, AGENTS.md) — no user-facing docs/
    change needed (non-goal: no griffe/mkdocstrings API docs generation)
  • CHANGELOG.md [Unreleased] updated
  • Commits follow Conventional Commits
  • uv run zizmor .github/workflows/ passes (new workflow audited clean)

Related issues

Closes #104

Add a pull-request job that diffs the working tree's public API against the
latest release tag with griffe check, covering interlock/__init__.py's
re-exports and interlock/integrations/* (public, not re-exported). A detected
breakage is failable but overridable via the "breaking-change" label, since a
future major release will make one on purpose.
@codecov

codecov Bot commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq

codspeed-hq Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 21 untouched benchmarks


Comparing feat/104-griffe-api-check (79f0cd0) with main (7b1f498)

Open in CodSpeed

@bagowix
bagowix merged commit 8f98a0a into main Aug 2, 2026
15 of 16 checks passed
@bagowix
bagowix deleted the feat/104-griffe-api-check branch August 2, 2026 14:21
bagowix added a commit that referenced this pull request Aug 3, 2026
Every release bumps `interlock.VERSION`, and `griffe check` reports the new
value as a changed attribute — the release mechanism working, not a public-API
breakage. The job was added in #118 and this is the first release since, so it
had never been exercised against a bump: it failed the 2.1.4 release PR and
would have failed every one after it, or forced a misleading `breaking-change`
label onto it.

The `-f github` run still annotates the diff; the gate now reads a `oneline`
run with that one finding filtered out. The filter matches only that attribute,
in that file, for that check — if griffe rewords the message it stops matching
and the job fails, which is the safe direction.
@bagowix bagowix mentioned this pull request Aug 3, 2026
7 tasks
bagowix added a commit that referenced this pull request Aug 3, 2026
## Summary

Prepare the `2.1.4` patch release.

- bump the package version from `2.1.3` to `2.1.4`
- move the current changelog entries from `[Unreleased]` into `2.1.4`
- update changelog comparison links
- update the release version in the comparison page
- regenerate `docs/llms-full.txt`

Everything in `[Unreleased]` is infrastructure, documentation and bug
fixes —
the correctness docs page, the OpenSSF badge, `griffe check`, mutation
testing,
pyrefly, the Codecov move, the supply-chain hardening, plus the
coordinator
lane `task_done()` fix and `EventListener` failure isolation. No public
symbol
was added or changed, so this is a patch, not a minor.

### Why now

The `v2.1.4` tag was pushed while `interlock/version.py` still read
`2.1.3`, so
the release workflow built `2.1.3` artifacts and PyPI rejected the
upload —
that filename already exists and PyPI never allows reuse. The tag has
been
deleted locally and on the remote; it needs to be re-created on the
merge
commit of this PR so the build picks up the bumped version.

### Note on `docs/llms-full.txt`

The regenerated file carries one change that is not from the version
bump:
#87 changed the migration-guide anchors in `docs/migration.md` but did
not
regenerate `llms-full.txt`, so the committed copy had drifted. Running
`scripts/build_llms_full.py` brings it back in sync.

`docs/comparison.md` keeps its "as of July 2026" label: that date
records when
the *other* libraries' versions were checked, and only interlock's own
cell
moves — the same way the 2.1.3 release handled it.

### The griffe gate had to be fixed first

`griffe check` failed this PR on `Attribute value was changed: '2.1.3'
-> '2.1.4'`.
The job landed in #118 and this is the first release since, so it had
never run
against a version bump — it would have failed every release from now on,
or
forced a misleading `breaking-change` label onto each one.

The `-f github` run still annotates the diff; the gate now reads a
`oneline`
run with that single finding filtered out. The filter matches only that
attribute, in that file, for that one check, so it fails closed: if
griffe
rewords the message it stops matching and the job fails. Verified both
ways
locally — the bump alone passes, and a removed public export
(`sync_timeout`) still fails it.

## Checklist

- [x] Test suite passes with 100% coverage (583 passed, 2 skipped)
- [x] `uv run ruff format --check` and `uv run ruff check` pass
- [x] `uv run mypy`, `uv run pyright` and `uv run pyrefly check` pass
- [x] Documentation updated (`docs/`)
- [x] `CHANGELOG.md` `[Unreleased]` updated
- [x] Release artifacts build successfully (`interlock_cb-2.1.4`, sdist
+ wheel)
- [x] Commits follow Conventional Commits

## Related issues

- Includes changes from #83, #97, #102, #103, #104, #105, #107, #113,
#87
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.

Detect public-API breakage with griffe check in CI

1 participant