Skip to content

ci: add GitHub Actions workflow - #7

Merged
t0kubetsu merged 4 commits into
mainfrom
ci/add-github-actions-workflow
Aug 12, 2026
Merged

ci: add GitHub Actions workflow#7
t0kubetsu merged 4 commits into
mainfrom
ci/add-github-actions-workflow

Conversation

@t0kubetsu

@t0kubetsu t0kubetsu commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What

Adds .github/workflows/ci.yml — lint + tests on push and PR to main, 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 on mailvalidator merged against checks=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:

Measure Why
Actions pinned to full commit SHAs A tag is mutable; @v4 can be repointed at new code
permissions: contents: read The default GITHUB_TOKEN grant is far wider than this needs
persist-credentials: false Otherwise a usable token stays in .git/config for later steps
concurrency + cancel-in-progress A new push supersedes the previous run
fail-fast: false One failing interpreter must not mask the others
timeout-minutes A hung job cannot hold a runner indefinitely

No workflow interpolates github.event.* or github.head_ref into a run: block, so there is no script-injection surface.

Verified locally

ruff clean and the full suite green before opening this PR — CI should be green on merge.

Summary by CodeRabbit

  • New Features

    • Added automated continuous integration checks for code quality and tests across Python 3.11–3.13.
    • Added Ruff linting with a defined set of project rules.
  • Documentation

    • Updated project conventions to document the continuous integration workflow.
  • Chores

    • Added Ruff to the development tooling.
    • Configured reliable, cached, and read-only CI runs with automatic cancellation of superseded checks.

@t0kubetsu
t0kubetsu requested a review from a team as a code owner August 12, 2026 12:48
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b4825500-5d65-42e3-985b-322fc07a0aaa

📥 Commits

Reviewing files that changed from the base of the PR and between e2e8a5d and cc67214.

📒 Files selected for processing (1)
  • pyproject.toml

📝 Walkthrough

Walkthrough

The 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.

Changes

CI and linting

Layer / File(s) Summary
Ruff development configuration
pyproject.toml
The dev extra now includes Ruff. Ruff targets Python 3.11 and enables E4, E7, E9, and F rules.
GitHub Actions validation workflow
.github/workflows/ci.yml, CLAUDE.md
GitHub Actions runs Ruff and pytest on pushes and pull requests to main across Python 3.11–3.13. The workflow uses caching, read-only permissions, cancellation of superseded runs, and a 15-minute timeout. Project documentation describes the workflow.

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

Suggested reviewers: afrittellalhc, nicky-mezzina-lhc

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a GitHub Actions CI workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/add-github-actions-workflow

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown

Greptile Summary

Adds a hardened GitHub Actions workflow that runs linting and tests across Python 3.11–3.13.

  • Installs Ruff through the project’s development extras and defines a stable lint configuration.
  • Documents the new CI workflow in the repository guide.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

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

Comment thread .github/workflows/ci.yml
coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 12, 2026
@t0kubetsu
t0kubetsu dismissed coderabbitai[bot]’s stale review August 12, 2026 13:44

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.
@t0kubetsu
t0kubetsu force-pushed the ci/add-github-actions-workflow branch from 6e386dc to e2e8a5d Compare August 12, 2026 13:45

@coderabbitai coderabbitai Bot 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5f18e4d and e2e8a5d.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • CLAUDE.md
  • pyproject.toml

Comment thread pyproject.toml Outdated
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.
@t0kubetsu
t0kubetsu merged commit bb98b83 into main Aug 12, 2026
5 checks passed
@t0kubetsu
t0kubetsu deleted the ci/add-github-actions-workflow branch August 12, 2026 13:56
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