Skip to content

Move linting/formatting check into separate CI workflow - #138

Open
cpaniaguam wants to merge 8 commits into
139-drift-on-pandas-3x-breaks-copy-on-write-in-trainersfrom
102-separate-linting-workflow-in-ci-v2
Open

Move linting/formatting check into separate CI workflow#138
cpaniaguam wants to merge 8 commits into
139-drift-on-pandas-3x-breaks-copy-on-write-in-trainersfrom
102-separate-linting-workflow-in-ci-v2

Conversation

@cpaniaguam

@cpaniaguam cpaniaguam commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

This pull request refactors the project's GitHub Actions workflows by separating linting and formatting checks into a dedicated workflow. The main test workflow (run_tests.yml) is now focused solely on running tests and uploading coverage, while all code style and linting checks are handled in a new workflow.

Workflow improvements:

  • Created a new workflow file, .github/workflows/linting_formatting.yml, to run linting and formatting checks using ruff and uv.
  • Removed linting and formatting steps from the main test workflow, .github/workflows/run_tests.yml, to avoid redundancy and streamline responsibilities.

Summary by CodeRabbit

  • Chores
    • Added a dedicated automated linting and formatting workflow for pull requests and reusable CI runs.
    • Integrated linting results into drift monitoring alongside the test matrix.
    • Updated drift reporting to close issues only when both tests and lint checks succeed.
    • Streamlined the test workflow by removing duplicate formatting and linting steps.
    • Organized linting tools into a dedicated development dependency group.

Copilot AI lite review requested due to automatic review settings September 8, 2026 19:34
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 66477ead-ec89-4718-a9d2-41bc708d5a29

📥 Commits

Reviewing files that changed from the base of the PR and between b0b2e3d and f33fe4b.

📒 Files selected for processing (3)
  • .github/workflows/drift.yml
  • .github/workflows/linting_formatting.yml
  • pyproject.toml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The pull request adds a dedicated Ruff workflow, moves Ruff into a lint dependency group, removes duplicate checks from the test workflow, and includes lint status in drift reporting.

Changes

CI workflow separation

Layer / File(s) Summary
Dedicated linting workflow
.github/workflows/linting_formatting.yml, pyproject.toml, .github/workflows/run_tests.yml
The new workflow runs Ruff with lint-only dependencies and read-only repository access. The test workflow removes its duplicate Ruff steps. The dev group includes the new lint group.
Drift reporting integration
.github/workflows/drift.yml
The drift workflow runs linting with the test matrix. The report job records lint failures and closes the drift issue only when tests and lint succeed.

Priority: ⬇️ Low

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

Merge Risk: ⚪ Minimal · up to f33fe

Linting is now executed separately from tests, while drift reporting includes both results. The workflow retains lint enforcement and does not leave an actionable current-head merge risk.

Suggested reviewers: alexanderfengler

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: moving linting and formatting checks into a separate CI workflow.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 102-separate-linting-workflow-in-ci-v2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new lint workflow introduces avoidable CI security/reproducibility and performance issues (token permissions, action pinning, heavy dependency sync, and unpinned uv version).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR refactors CI responsibilities by moving ruff formatting/lint checks out of the main test workflow (run_tests.yml) into a dedicated GitHub Actions workflow, keeping the test workflow focused on executing tests and uploading coverage.

Changes:

  • Removed ruff format/lint steps from .github/workflows/run_tests.yml.
  • Added .github/workflows/linting_formatting.yml to run ruff formatting and linting checks on pull requests.
File summaries
File Description
.github/workflows/run_tests.yml Removes formatting/linting steps so the workflow focuses on tests + Codecov upload.
.github/workflows/linting_formatting.yml Introduces a new PR-triggered workflow to run ruff format checks and linting.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/linting_formatting.yml
Comment thread .github/workflows/linting_formatting.yml
Comment thread .github/workflows/linting_formatting.yml
Comment thread .github/workflows/linting_formatting.yml Outdated
Copilot AI review requested due to automatic review settings September 8, 2026 19:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The workflow split and drift integration are straightforward and do not change application/runtime behavior, with only minor CI hardening/efficiency follow-ups suggested.

Review details

Suppressed comments (2)

.github/workflows/linting_formatting.yml:30

  • This lint workflow installs the entire dev dependency group before running ruff. In this repo, dev includes heavyweight ML/runtime deps (e.g., keras/bayesflow/sbi/onnxruntime), which will significantly slow lint-only CI and can introduce avoidable install failures. Consider introducing a lightweight dependency group (e.g. lint) that contains only ruff (and any other lint tools) and syncing that here instead.
      - name: Install package
        run: uv sync --group dev

.github/workflows/linting_formatting.yml:9

  • Add explicit minimal token permissions for this job so it doesn't run with broader defaults than necessary (it only needs to read the repository to lint/format-check).
jobs:
  lint:
    runs-on: ubuntu-latest
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 8, 2026 19:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The new lint workflow currently uses floating/unpinned tool versions (and doesn’t pin Python), reducing CI reproducibility and increasing supply-chain risk.

Review details

Suppressed comments (1)

.github/workflows/linting_formatting.yml:20

  • This workflow uses a floating uv version ("latest") and unpinned action tags, which makes CI less reproducible and increases supply-chain risk. It also doesn’t pin a Python version, so uv will rely on whatever Python happens to be preinstalled on ubuntu-latest, which can drift outside the project’s supported range.
      - name: Install uv
        uses: astral-sh/setup-uv@v7
        with:
          version: "latest"

  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 8, 2026 19:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The new lint workflow does not pin/set up a Python version before running uv, which can lead to CI instability relative to the repo’s requires-python constraints.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

.github/workflows/linting_formatting.yml:23

  • This workflow relies on the runner’s default Python, but the repo’s other uv-based workflows explicitly pin Python first (e.g. .github/workflows/run_tests.yml:23-27). Without actions/setup-python, uv sync can start failing if ubuntu-latest changes its default Python and it no longer satisfies requires-python (>=3.12, <3.15).
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 9, 2026 14:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The new lint workflow doesn’t pin a supported Python version (>=3.12), which can make lint CI runs interpreter-dependent and potentially flaky on ubuntu-latest.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

.github/workflows/linting_formatting.yml:23

  • This workflow doesn’t pin a Python version before running uv sync/uv run. The project declares requires-python = ">=3.12, <3.15" (pyproject.toml:20) and other workflows explicitly set up Python, so leaving this to whatever happens to be preinstalled on ubuntu-latest can make lint CI flaky or run under an unsupported interpreter.
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

…py-on-write-in-trainers' into 102-separate-linting-workflow-in-ci-v2
Copilot AI review requested due to automatic review settings September 9, 2026 16:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The PR scope/description doesn’t currently match the included trainer code changes, and the new lint workflow should pin a supported Python version to avoid CI flakiness.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (2)

Previously missed (2) — in code that hasn't changed since the last review.

.github/workflows/linting_formatting.yml:23

  • This workflow runs uv sync/uv run without pinning a Python version. Since the project declares requires-python = ">=3.12, <3.15", relying on the runner's default Python can make lint CI flaky if ubuntu-latest changes. Consider adding actions/setup-python (and matching uv cache settings) like run_tests.yml does.
    src/lanfactory/trainers/jax_mlp.py:595
  • The PR title/description focus on splitting lint/formatting into a separate CI workflow, but this also changes trainer behavior (training history row assignment). Please either update the PR description/title to mention these code changes (and why they're needed), or split the trainer edits into a separate PR to keep CI refactors easy to review/rollback.
  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread src/lanfactory/trainers/torch_mlp.py Outdated
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…py-on-write-in-trainers' into 102-separate-linting-workflow-in-ci-v2
Copilot AI review requested due to automatic review settings September 9, 2026 17:59
@cpaniaguam
cpaniaguam changed the base branch from main to 139-drift-on-pandas-3x-breaks-copy-on-write-in-trainers September 9, 2026 18:00
@cpaniaguam
cpaniaguam added this pull request to stack #141 September 9, 2026 18:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The new linting workflow should be made deterministic (pin Python and align uv caching) and the PR scope/description should be reconciled with the added runtime training-code refactor.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

.github/workflows/linting_formatting.yml:23

  • The linting workflow doesn’t pin a Python version or enable uv caching, so lint/format results (and runtime) can vary with whatever Python happens to be on ubuntu-latest, and reruns won’t benefit from the same cache behavior as run_tests.yml. Add an explicit actions/setup-python step (e.g. 3.12) and enable the uv cache to make linting deterministic and faster.
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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