ci: align ruff tooling and add CI workflow#6
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions CI workflow to enforce the repo’s existing lint/format/typecheck/test tooling on pushes to main and PRs targeting main, and aligns the pre-commit ruff hook version with the locked ruff version to avoid import-order churn.
Changes:
- Add
.github/workflows/ci.ymlrunninguv sync --frozen, ruff (check + format check), pyright, and pytest. - Bump
ruff-pre-commithook fromv0.5.0tov0.15.11. - Apply ruff/isort-driven import reordering (and spacing) across several test files.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/ci.yml |
New CI workflow running uv/ruff/pyright/pytest on PRs and pushes to main. |
.pre-commit-config.yaml |
Updates ruff pre-commit hook revision to match the repo’s locked ruff version. |
tests/unit/test_subgraph.py |
Import ordering adjusted (pydantic import moved to the third-party import group). |
tests/unit/test_state_and_reducers.py |
Import ordering adjusted. |
tests/unit/test_runtime_errors.py |
Import ordering adjusted. |
tests/unit/test_projection.py |
Import ordering adjusted. |
tests/unit/test_generics.py |
Import ordering adjusted. |
tests/unit/test_compile_errors.py |
Import spacing adjusted (blank line between third-party and first-party imports). |
tests/conformance/test_conformance.py |
Import spacing adjusted (blank line between third-party and first-party imports). |
tests/conformance/adapter.py |
Import ordering adjusted (pydantic import moved to the third-party import group). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The .pre-commit-config.yaml was pinning ruff v0.5.0 (mid-2024) while
the dev-dep ruff resolved to v0.15.11. The two versions disagree on
isort grouping (newer ruff splits pydantic and openarmature into
separate import groups; v0.5.0 merges them), which caused test files
to ping-pong between forms on every commit cycle.
Bump pre-commit ruff to v0.15.11 to match the dev dep, then run
`ruff check --fix` once to settle the disagreement on the newer
form. Eight test-file imports reordered as a result.
Add `.github/workflows/ci.yml` running:
- Checkout with submodules (the openarmature-spec submodule carries
the conformance fixtures)
- uv sync --frozen
- ruff check
- ruff format --check
- pyright src/ tests/
- pytest -q
Same checks the pre-commit hook runs locally, now also enforced
server-side so PRs from contributors who haven't installed pre-commit
don't bypass them. Concurrency group cancels in-flight runs on the
same ref.
Mirrors LunarCommand/openarmature-examples#3: pin GITHUB_TOKEN to `contents: read`. The workflow only needs to checkout code + the spec submodule; no writes.
389b9cc to
cc6a13d
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Per PR #6 review: the workflow had `uv python install 3.12` while .python-version pins 3.14, creating a CI/dev skew where CI could end up testing a different interpreter than developers run locally. Drop the explicit install step. uv sync auto-provisions whatever .python-version pins, keeping CI and dev aligned. requires-python ">=3.12" in pyproject.toml still establishes 3.12 as the floor; testing the floor specifically is a separate concern (matrix build) we can add later if needed.
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.
Summary
Why now
The repo had no CI at all — only CodeQL (configured at the GitHub repo level, not as a workflow). Pre-commit catches issues locally for contributors who install it, but nothing enforces lint/type/tests server-side. Web-UI commits, fresh clones without pre-commit, and merge-without-review paths all bypass the checks.
What CI runs
`actions/checkout@v4` with `submodules: recursive` so the `openarmature-spec` submodule's conformance fixtures are present. `concurrency` group cancels in-flight runs on the same ref so a fast push doesn't pile up runs.
Test plan