Skip to content

ci: align ruff tooling and add CI workflow#6

Merged
chris-colinsky merged 4 commits into
mainfrom
chore/ci-workflow
May 5, 2026
Merged

ci: align ruff tooling and add CI workflow#6
chris-colinsky merged 4 commits into
mainfrom
chore/ci-workflow

Conversation

@chris-colinsky

@chris-colinsky chris-colinsky commented May 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Add `.github/workflows/ci.yml` running ruff/pyright/pytest on every PR and push to `main`. Same checks as the pre-commit hook, now enforced server-side.
  • Bump pre-commit ruff from v0.5.0 (mid-2024) to v0.15.11 to match the dev-dep ruff. The two versions disagreed on isort grouping, causing test files to ping-pong on every commit cycle. With them aligned, eight test-file imports are reordered once and stay put.

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

  • `uv sync --frozen`
  • `ruff check`
  • `ruff format --check`
  • `pyright src/ tests/`
  • `pytest -q`

`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

Copilot AI review requested due to automatic review settings May 5, 2026 02:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml running uv sync --frozen, ruff (check + format check), pyright, and pytest.
  • Bump ruff-pre-commit hook from v0.5.0 to v0.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.

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
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.
Post-rebase: ruff v0.15.11 splits pydantic and openarmature into
separate import groups, where v0.5.0 (the version on main when #5
landed) merged them. The bumped pre-commit hook in this branch
applies the new ordering to test files brought in by #5.
Copilot AI review requested due to automatic review settings May 5, 2026 02:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/ci.yml Outdated
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.
@chris-colinsky chris-colinsky merged commit aedaf28 into main May 5, 2026
4 checks passed
@chris-colinsky chris-colinsky deleted the chore/ci-workflow branch May 5, 2026 02:54
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.

2 participants