Skip to content

ci: fail on format and lint errors, and test each matrix Python - #29

Merged
hl-tstrawbridge merged 4 commits into
masterfrom
ci/check-format-and-lint
Nov 18, 2026
Merged

hl-tstrawbridge merged 4 commits into
masterfrom
ci/check-format-and-lint

Conversation

@hl-tstrawbridge

@hl-tstrawbridge hl-tstrawbridge commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

CI had three gaps:

  • Fix mode. It ran just validate, whose ruff format and ruff check --fix fix problems in place, so formatting and lint errors never failed a build.
  • Matrix. The Python matrix never took effect: every job used the runner's /usr/bin/python3 (3.14), so nothing tested 3.9–3.13.
  • Push filter. Push builds skipped branch names containing /.

Changes

  • build: pin ruff to 0.17.5: the lock held 0.11.12. An exact pin means a ruff release can't change what CI reports without a commit here.
  • style: sort imports in phantom.py: the one finding ruff 0.17.5 reports on master (I001). Kept apart from the CI change.
  • The two ci: commits:
    • A new just check (ruff format --check, ruff check, pytest). CI runs it; just validate stays for local auto-fixing.
    • UV_PYTHON is set to the matrix version, so uv installs and uses it, and a step asserts the interpreter in use matches it. The setup-python step is gone, because it has no 3.9 build for ubuntu-latest (Ubuntu 26.04), which made the first run of this branch fail at setup.
    • branches: "**" so fix/…-style branches build on push.

Review focus

  • 3.14 added to the matrix. This wasn't in the original ask. Without it, fixing the matrix would drop the only Python CI actually tested until now.
  • The assert step. Each job fails fast if uv picks a different interpreter than the matrix names, so this can't silently regress.

Verification

  • Locally, CI's own sequence (just dev-sync, then just check): format and lint clean, 65 passed, 0 skipped.
  • Python 3.9 and 3.14 each install from the locked file (uv sync --locked): 65 passed, 0 skipped on both.
  • just check fails on a misformatted line (exit 1 at format-check), and lint-check fails on an unsorted, unused import.
  • The assert step passes for a matching interpreter and fails for a mismatched one.
  • CI on this branch (all 6 jobs green, 65 passed and 0 skipped in each; logs show CPython 3.9.25, 3.10.22, 3.11.18, 3.12.16, 3.13.18 and 3.14.4): https://github.com/HurricaneLabs/splunksecrets/actions/runs/44335536580
  • CI on a throwaway branch with one misformatted line (red at format-check: "1 file would be reformatted"; branch since deleted): https://github.com/HurricaneLabs/splunksecrets/actions/runs/44335763908

Docs

None needed. The Justfile comment says which recipe CI runs.

Summary by CodeRabbit

  • Tests
    • Expanded automated testing to include Python 3.14 and branches with slash-separated names.
    • Added a unified check that runs tests and verifies formatting and lint rules; CI now uses this check.
  • Chores
    • Added standalone formatting and lint checks that report issues without modifying files.

The lock held ruff 0.11.12 while the latest is 0.17.5, so local and CI
lint results depended on which one ran. Pin it exactly so a ruff release
cannot change what CI reports without a commit here.
CI ran `just validate`, whose ruff format and ruff check --fix repair
problems in place, so they never failed a build. CI now runs a new
`just check` (ruff format --check, ruff check, pytest); validate stays
for local auto-fixing.

The matrix never took effect: uv used the runner's /usr/bin/python3
(3.14) in every job. Set UV_PYTHON and setup-python to the matrix
version, assert it in a step, and add 3.14 so it stays covered.

Push builds also skipped branch names containing a /, because "*" does
not cross /. Use "**".
setup-python has no 3.9 build for ubuntu-latest (Ubuntu 26.04), so the
3.9 job failed at setup. With UV_PYTHON set, uv downloads its own build
of each matrix version when the runner lacks it.
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The CI workflow now tests Python 3.14 and verifies that uv run uses the matrix Python version. The Justfile adds format and lint checks to the check target. Ruff is pinned to version 0.17.5, and cryptography imports are reordered.

Changes: Python checks and CI

Layer / File(s) Summary
Define local checks and lint tooling
Justfile, pyproject.toml, splunksecrets/phantom.py
The Justfile adds format-check and lint-check targets, then runs them with test through check. Ruff is pinned to 0.17.5. The cryptography imports are reordered.
Configure the CI Python matrix and checks
.github/workflows/tests.yml
The workflow matches branch names containing slashes, adds Python 3.14, selects and verifies the matrix Python version, and runs just check instead of just validate.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: everdrediidx

Merge Risk: Minimal · up to 122b9

This PR makes CI fail on formatting and lint errors and tests each Python version from 3.9 to 3.14. It affects only development and CI tooling, not runtime behavior. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the three main parts of the change: failing CI on format and lint errors, and testing each matrix Python version. The raw summary confirms the workflow now runs the new check recipe, w…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the three main parts of the change: failing CI on format and lint errors, and testing each matrix Python version. The raw summary confirms the workflow now runs the new check recipe, which includes format-check and lint-check, and that the matrix adds Python 3.14 and sets UV_PYTHON per matrix entry. The title is specific and matches the primary changes. Its wording is slightly long (63 characters) but it is clear.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the format line,
Then lints the code to keep it fine.
Python hops through versions new,
Tests run after checks are through.
Ruff rests pinned, imports align,
The rabbit thumps: “All checks are mine!”

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: f925d589-ed32-4fa2-8365-2cef4e3021f8
Commits

Reviewing files that changed from the base of the PR and between 4f88a51 and 122b90c.

Files ignored due to path filters: 1

  • uv.lock is excluded by !**/*.lock
Files selected for processing: 4

  • .github/workflows/tests.yml
  • Justfile
  • pyproject.toml
  • splunksecrets/phantom.py

Included review availability: This review used your included allowance. 6 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour.

@hl-tstrawbridge
hl-tstrawbridge merged commit a1edb7d into master Nov 18, 2026
18 checks passed
@hl-tstrawbridge
hl-tstrawbridge deleted the ci/check-format-and-lint branch November 18, 2026 15:35
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