Skip to content

fix: green CI — pin ruff and clear the lint it reports - #2

Merged
ArtRiv merged 2 commits into
mainfrom
chore/green-ci
Sep 5, 2026
Merged

ArtRiv merged 2 commits into
mainfrom
chore/green-ci

Conversation

@ArtRiv

@ArtRiv ArtRiv commented Sep 3, 2026

Copy link
Copy Markdown
Owner

CI has been red on main since 2026-05-04 — every push run since then has failed, including commits that changed no Python at all. This makes it green and stops the cause from recurring.

Why it broke

The dev extra asked for ruff>=0.6, so every CI run installed whatever ruff was newest that day. The config selects the UP rule set, which keeps growing: code written against ruff 0.6 fails under 0.15.12 (UP045, UP041, UP037, new import-sorting output). Nothing in the repo had to change for the build to go red.

So the first commit pins ruff==0.15.12. Without the pin, this PR buys a green build until the next ruff release.

The 77 errors

ruff check --fix handled 74 — Optional[X] → X | None, import sorting, unused imports. Three needed a decision, and they are the part worth reviewing:

tests/test_pair_init_client.py:179 pytest.raises(Exception) now expects BadSignatureError, the exception the comment beside it already named. As written the test passed on any error, so a typo raising TypeError would have looked like proof that signature tampering is rejected.
tests/test_signaling_keepalive.py:16 pong_received_times was assigned and never read. That test counts pings and never touches pongs, so the list is leftover, not a missing assertion.
transcribe_engine/protocol/messages.py:167 WireMessage becomes a | union. It is only the return annotation of parse_wire and nothing inspects it at runtime, so this is spelling, and it drops the now-unused Union import.

The second commit is noise, on purpose

ruff format --check is also a CI step, and 37 of 58 files failed it: quote normalisation and the blank line the formatter now wants after a module docstring. I kept it as a separate commit so the first one stays reviewable — read fix: carefully, skim style:.


This branch is cut from main, so it does not depend on #1. Merging this one first makes #1 go green on a re-run.

CI has been red on main since 2026-05-04, on every push, without a line
of source changing in between. The dev extra asked for `ruff>=0.6`, so
each run installed whatever ruff was newest that day; the `UP` rules the
config selects grew, and code written against ruff 0.6 started failing
under 0.15. Pinning is the fix that keeps it from happening again.

`ruff check --fix` handled 74 of the 77: `Optional[X]` to `X | None`,
import sorting, unused imports. The three left needed a decision:

- `pytest.raises(Exception)` in test_pair_init_client now raises on
  `BadSignatureError`, which the comment beside it already named. As
  written, a typo raising TypeError passed the tampering test.
- `pong_received_times` in test_signaling_keepalive was dead; that test
  counts pings and never touches pongs.
- `WireMessage` becomes a `|` union. Nothing inspects it at runtime —
  it is only the return annotation of `parse_wire` — so this is a
  spelling change, and it drops the now-unused `Union` import.
Mechanical, and kept in its own commit so the one before it stays
readable. `ruff format --check` is a CI step and 37 of 58 files failed
it: quote normalisation and the blank line the formatter now wants after
a module docstring. No behaviour anywhere.
@ArtRiv
ArtRiv merged commit 13aab99 into main Sep 5, 2026
2 checks passed
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