ci: add GitHub Actions workflow - #7
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe project adds GitHub Actions validation for Ruff and pytest across Python 3.11–3.13. It adds Ruff to development dependencies, configures selected lint rules, and documents the workflow. ChangesCI and linting
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Greptile SummaryAdds a hardened GitHub Actions workflow that runs linting and tests across Python 3.11–3.13.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| .github/workflows/ci.yml | Adds a least-privilege, SHA-pinned CI matrix that installs development dependencies before running Ruff and pytest. |
| pyproject.toml | Adds Ruff to development dependencies and explicitly configures its Python target and lint rules. |
| CLAUDE.md | Updates repository conventions to document the newly added CI workflow. |
Reviews (5): Last reviewed commit: "ci: pin ruff to a tested major" | Re-trigger Greptile
The merge-base changed after approval.
Runs lint and the test suite on push and pull request to main, across Python 3.11-3.13 (the range pyproject declares via requires-python). Hardening applied per GitHub's own recommendations: - actions pinned to full commit SHAs, not floating tags - permissions: contents: read (the default token grant is far wider) - persist-credentials: false, so no token is left in .git/config - concurrency group cancels superseded runs - fail-fast: false, so one interpreter failing does not mask the rest - timeout-minutes, so a hung job cannot occupy a runner indefinitely
The first CI run failed on every module, in two ways tracing to one root cause: lint was never actually pinned down. 1. 'ruff: command not found' — ruff is required by the before-commit checklist but was absent from the dev extras, so pip install -e '.[dev]' never provided it. It passed locally only because developer venvs had it installed by hand. 2. Lint failures on a clean checkout — with no [tool.ruff] section the linted rule set is whatever the installed ruff defaults to, and that widens each release, so a green local run and a red CI run could disagree purely by version. Copies the pattern portscanner already used (the only module that passed): pin target-version, state select = [E4, E7, E9, F] explicitly, add ruff>=0.6 to dev. No source change needed — every module passes this rule set as-is.
Review caught that adding the workflow left the repository guide stating 'No CI config currently present', giving contributors contradictory guidance about whether pushes are checked.
6e386dc to
e2e8a5d
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pyproject.toml`:
- Around line 62-72: Update the dev dependency declaration to pin Ruff to the
tested version instead of allowing any future release through ruff>=0.6; keep
the existing [tool.ruff] configuration and selected rule set unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 214cbedb-99b1-478b-92eb-308a06be51f5
📒 Files selected for processing (3)
.github/workflows/ci.ymlCLAUDE.mdpyproject.toml
Review flagged that ruff>=0.6 with no upper bound lets a future release change lint behaviour without any repository change, since CI installs '.[dev]' with no lock file. This is not hypothetical here: the first CI run of this workflow failed precisely because current ruff widened its defaults beyond what the developer venvs had. The explicit [tool.ruff] select pins which rules run, which is the larger half of the fix; this bounds the remaining drift (rule behaviour, new fixes, interpreter support) to a tested major. Dependabot's github-actions and pip ecosystems will raise it.
What
Adds
.github/workflows/ci.yml— lint + tests on push and PR tomain, across Python 3.11, 3.12 and 3.13.Why
This repository had no CI. Nothing verified that a change compiled, linted, or passed its tests before reaching
main— the recent Dependabot batch onmailvalidatormerged againstchecks=0, where a green "mergeable" only ever meant "no merge conflict".Hardening
Applied per GitHub's published guidance, matching the standard already set by
testing-platform-backend:@v4can be repointed at new codepermissions: contents: readGITHUB_TOKENgrant is far wider than this needspersist-credentials: false.git/configfor later stepsconcurrency+cancel-in-progressfail-fast: falsetimeout-minutesNo workflow interpolates
github.event.*orgithub.head_refinto arun:block, so there is no script-injection surface.Verified locally
ruffclean and the full suite green before opening this PR — CI should be green on merge.Summary by CodeRabbit
New Features
Documentation
Chores