Skip to content

Conversation

@dangusev
Copy link
Contributor

@dangusev dangusev commented Nov 17, 2025

  • Separate ruff and mypy runs for visibility
  • use --frozen flag for uv to keep uv.lock intact. It should also improve UV cache hits, speeding up the CI
  • update ruff version in precommit hooks

Summary by CodeRabbit

  • Chores

    • Enabled frozen install mode, set default Python to 3.13.9, added prune-cache and cache-suffix options, removed prior venv cache step, set default working directory, and clarified the dependency-install step name.
  • CI

    • Added a UV_FROZEN flag, split lint into separate Ruff and mypy jobs, introduced mypy caching, separated core and plugin test runs, adjusted step names, and removed environment-printing steps.
  • Style

    • Bumped Ruff hook, updated local mypy hook commands to use frozen mode and revised paths, and switched dev tooling to mypy[mypyc,faster-cache].

- Separate ruff and mypy runs for visibility
- use `--frozen` flag for uv to keep uv.lock intact
- update ruff version in precommit hooks
@coderabbitai
Copy link

coderabbitai bot commented Nov 17, 2025

Walkthrough

CI and tooling configs updated: python-uv setup action defaults adjusted (python-version, sync-flags, cache inputs, working-directory) and its .venv cache step removed; workflows split lint into separate Ruff and mypy jobs with mypy caching and adjusted test scopes; pre-commit and mypy dev dependency updated.

Changes

Cohort / File(s) Summary
UV action
\.github/actions/python-uv-setup/action.yml
Default python-version changed to 3.13.9; default sync-flags updated to include --frozen; added inputs prune-cache: false and cache-suffix: ${{ inputs.python-version }}; added default working-directory: "."; removed .venv cache step; renamed install step label to "Install the project dependencies" (command unchanged).
Workflows
\.github/workflows/run_tests.yml
Adds top-level UV_FROZEN env var; splits lint into separate Ruff and mypy jobs; adds .mypy_cache restore/save; renames install steps; splits tests into core (tests/) and plugin (plugins/*/tests/*.py) scopes; removes explicit environment-name debug step.
Pre-commit & local hooks
.pre-commit-config.yaml
Bumps Ruff hook from v0.12.8v0.14.5; updates local mypy hooks to invoke uv --frozen, adjusts path(s) to agents-core/vision_agents, removes -p vision_agents arg and updates plugin-check invocation (keeps --exclude).
Project deps config
pyproject.toml
Replaces mypy dev-dependency with mypy[mypyc,faster-cache] in the dev dependency-group.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant GH as GitHub Actions
  participant WF as run_tests.yml
  participant UVAction as python-uv-setup action
  participant UV as uv
  participant Ruff as Ruff job
  participant Mypy as Mypy job
  Note over UVAction,UV: setup inputs (python-version: 3.13.9, working-directory: ".")
  GH->>WF: workflow trigger
  WF->>UVAction: setup python & sync (sync-flags include --frozen)
  UVAction->>UV: uv sync --all-extras --dev --frozen
  UV-->>UVAction: dependencies synced
  WF->>Ruff: install deps → run ruff
  WF->>Mypy: install deps → restore .mypy_cache → run mypy core → run mypy plugins → save .mypy_cache
  Ruff-->>WF: results
  Mypy-->>WF: results
  WF-->>GH: complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay attention to .github/actions/python-uv-setup/action.yml for input semantics and removal of the .venv cache step.
  • Verify run_tests.yml job names, mypy cache keys/paths, and the updated test globs.
  • Check .pre-commit-config.yaml local mypy hook commands and paths.
  • Confirm pyproject.toml mypy extras are compatible with CI/tooling.

Possibly related PRs

  • Cache uv deps #194 — touches .github/actions/python-uv-setup/action.yml and cache/setup behavior; likely directly related or overlapping.

Poem

I stand in the pipeline’s bright white mouth,
the flags like frozen breath across my ribs;
uv tightens, a cool surgical braid,
Ruff scratches at the printed skin of files,
and mypy, a small bright thermometer, waits.

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'CI improvements' is vague and generic, using a non-descriptive umbrella term that doesn't convey the specific nature of the changes. Consider a more specific title like 'Separate mypy and ruff checks with frozen dependency locking' to better communicate the main changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/ci-improvements

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/run_tests.yml (1)

38-41: Mypy invocations lack explicit --frozen flag.

Lines 39 and 41 run mypy via uv run without an explicit --frozen flag. Although UV_FROZEN=1 should propagate the behavior at the workflow level, the .pre-commit-config.yaml explicitly includes --frozen in its mypy entries. For consistency and clarity, consider adding --frozen to these uv invocations as well, or document why the workflow-level env var is sufficient.

-      - name: Run mypy core
-        run: uv run mypy --install-types --non-interactive agents-core/vision_agents
-      - name: Run mypy for plugins
-        run: uv run mypy --install-types --non-interactive --exclude 'plugins/.*/tests/.*' plugins
+      - name: Run mypy core
+        run: uv run --frozen mypy --install-types --non-interactive agents-core/vision_agents
+      - name: Run mypy for plugins
+        run: uv run --frozen mypy --install-types --non-interactive --exclude 'plugins/.*/tests/.*' plugins
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8f57c00 and 9cb7b0a.

📒 Files selected for processing (3)
  • .github/actions/python-uv-setup/action.yml (1 hunks)
  • .github/workflows/run_tests.yml (1 hunks)
  • .pre-commit-config.yaml (2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.8)
.github/workflows/run_tests.yml

29-29: property "environment" is not defined in object type {check_run_id: number; container: {id: string; network: string}; services: {string => {id: string; network: string; ports: {string => string}}}; status: string}

(expression)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: unit / Ruff
  • GitHub Check: unit / Test "not integration"
  • GitHub Check: unit / Mypy
  • GitHub Check: unit / Ruff
  • GitHub Check: unit / Mypy
  • GitHub Check: unit / Test "not integration"
🔇 Additional comments (5)
.github/actions/python-uv-setup/action.yml (1)

49-49: Deterministic dependency installation via --frozen.

The addition of the --frozen flag ensures that uv won't update the lock file during CI, maintaining reproducibility across runs. Well done.

.pre-commit-config.yaml (2)

25-31: Frozen mypy invocations align with overall strategy.

Both mypy hooks now use uv run --frozen, ensuring deterministic type checking environments. The path specification for mypy-main targets agents-core/vision_agents explicitly, and the plugins hook maintains its exclusion pattern.


4-4: No breaking changes identified—version bump is safe.

The Ruff v0.14.5 release notes contain no documented breaking changes. The version bump from v0.12.8 to v0.14.5 is compatible with existing configurations.

.github/workflows/run_tests.yml (2)

14-16: UV_FROZEN environment variable establishes frozen mode globally.

Setting UV_FROZEN=1 as a workflow-level environment variable ensures all uv run commands inherit frozen-mode behavior without explicit flags. This is a clean, centralized approach to the deterministic build objective.


19-20: Ruff and mypy job separation improves observability.

Separating these jobs clarifies which linting tool is running, making it easier to identify failures at a glance. The job name accurately reflects its sole responsibility.

@ulgens
Copy link

ulgens commented Nov 17, 2025

Separate ruff and mypy runs for visibility

I'd recommend running pre-commit/prek for handling linters instead of giving each one a new wrapper. If the individual visibilities of the linters are important, they can still be called separately but via pre-commit/prek

Also, this seems related to #100 . Would be nice to have a review together.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6665f43 and 907c08e.

📒 Files selected for processing (1)
  • .github/actions/python-uv-setup/action.yml (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: unit / Mypy
  • GitHub Check: unit / Test "not integration"
  • GitHub Check: unit / Ruff
  • GitHub Check: unit / Mypy
  • GitHub Check: unit / Ruff
  • GitHub Check: unit / Test "not integration"
🔇 Additional comments (1)
.github/actions/python-uv-setup/action.yml (1)

7-15: Updated defaults align well with PR objectives.

The pinned Python version (3.13.9), expanded sync-flags (including --frozen and --link-mode=copy), and new working-directory default are sensible choices for cache hit optimization and reproducibility.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fbb3d8a and 6a401d7.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • .github/workflows/run_tests.yml (3 hunks)
  • pyproject.toml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: unit / Ruff
  • GitHub Check: unit / Test "not integration"
  • GitHub Check: unit / Run Mypy for core
  • GitHub Check: unit / Ruff
  • GitHub Check: unit / Test "not integration"
  • GitHub Check: unit / Run Mypy for core
🔇 Additional comments (3)
pyproject.toml (1)

76-76: Align mypy dependencies with new caching strategy.

Adding mypyc and faster-cache extras improves mypy performance and complements the new caching infrastructure in the workflow.

.github/workflows/run_tests.yml (2)

14-16: Environment variable properly configured for cache optimization.

Setting UV_FROZEN=1 will prevent lock file mutations during CI runs, improving cache hits and addressing the PR objective. The inline comment is helpful.


19-28: Ruff job separation improves CI visibility.

Splitting linting into separate jobs enables independent re-runs and clearer failure attribution, aligning with the PR objectives.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/run_tests.yml (1)

19-28: Consider using pre-commit as a CI orchestrator (optional architectural refactor).

The separation of Ruff and mypy into distinct jobs provides good visibility. However, as noted in the PR comments, delegating orchestration to pre-commit (or prek) while invoking each tool separately through that orchestrator could simplify maintenance and keep tool configuration centralized. This is optional and can be addressed in follow-up work.

Also applies to: 30-53

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f6ed8d8 and ddd7c55.

📒 Files selected for processing (1)
  • .github/workflows/run_tests.yml (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: unit / Mypy
  • GitHub Check: unit / Test "not integration"
  • GitHub Check: unit / Test "not integration"
  • GitHub Check: unit / Mypy
🔇 Additional comments (2)
.github/workflows/run_tests.yml (2)

14-16: Well-structured use of UV_FROZEN environment variable.

Setting UV_FROZEN=1 at the workflow level cleanly implements the PR objective to keep uv.lock intact across all steps, which should improve cache consistency and CI performance. This is a solid approach.


30-53: Mypy job properly structured with correct cache configuration.

The mypy job cleanly separates type checking from linting, and the cache key correctly references only pyproject.toml (not a non-existent mypy.ini). The separation of core and plugin type checks improves visibility as intended.

@dangusev
Copy link
Contributor Author

Hey @ulgens, thanks for keeping an eye on the PRs 👍 .

In the description, I meant separating Ruff and Mypy runs only in CI/CD.
So if one of these checks fails, it's easier to spot which one in the logs.

The precommit hooks work the same as before.

@dangusev dangusev merged commit 944896d into main Nov 17, 2025
8 checks passed
@dangusev dangusev deleted the chore/ci-improvements branch November 17, 2025 19:28
This was referenced Nov 17, 2025
@ulgens
Copy link

ulgens commented Nov 18, 2025

@dangusev I mean

# Current version
uv run mypy --install-types --non-interactive --exclude 'plugins/.*/tests/.*' plugins
# vs
# Recommended version
prek (or pre-commit) run mypy

and

# Current version
uv run ruff check .
vs
# Recommended version
prek (or pre-commit) run ruff

This approach allows to use the same config in multiple places without redefining parameters and dependencies/versions. It decreases the fragmentation, makes the CI config easier to understand and maintain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants