Skip to content

Speed up Windows CI setup#3565

Merged
koxudaxi merged 4 commits into
mainfrom
ci/speed-up-windows-setup
Jul 3, 2026
Merged

Speed up Windows CI setup#3565
koxudaxi merged 4 commits into
mainfrom
ci/speed-up-windows-setup

Conversation

@koxudaxi

@koxudaxi koxudaxi commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Chores
    • Improved the CI test workflow with OS-specific setup for Windows vs non-Windows runners.
    • Pinned the toolchain versions on Windows and updated Windows-specific dependency caching to improve installation consistency.
    • Aligned dependency caching across test shards so cache saving happens only for shard 1, and refined cache suffixing for non-Windows shard coordination.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a137e248-8a2d-40e4-8b1e-69dca220f029

📥 Commits

Reviewing files that changed from the base of the PR and between 4a07276 and 14d9007.

📒 Files selected for processing (1)
  • .github/workflows/test.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/test.yaml

📝 Walkthrough

Walkthrough

The test-shard CI job now separates Windows and non-Windows setup for uv and tox. Windows uses pinned tool versions and Windows-specific uv caching, while non-Windows uv cache keying changes and tox remains gated to non-Windows runners.

Changes

CI Workflow Update

Layer / File(s) Summary
Windows uv install
.github/workflows/test.yaml
Adds Windows-only version pins, replaces the Windows uv install with a pinned step, and configures Windows-specific cache paths, invalidation, and versioned cache suffixing.
Non-Windows uv cache key
.github/workflows/test.yaml
Updates the non-Windows uv install step to key its cache suffix off matrix.shard_total and keeps cache saving limited to shard 1.
Windows and non-Windows tox install
.github/workflows/test.yaml
Adds a Windows-only pinned tox and tox-uv install step and gates the existing tox install step to non-Windows runners.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

🚥 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 matches the main change: improving Windows CI setup performance.
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/speed-up-windows-setup

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


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.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

📚 Docs Preview: https://pr-3565.datamodel-code-generator.pages.dev

@codspeed-hq

codspeed-hq Bot commented Jul 3, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 17.59%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 11 improved benchmarks
⏩ 98 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime test_perf_multiple_files_input 3.6 s 3 s +20.41%
WallTime test_perf_kubernetes_style_pydantic_v2 2.6 s 2.2 s +18.56%
WallTime test_perf_graphql_style_pydantic_v2 802.1 ms 677.1 ms +18.46%
WallTime test_perf_stripe_style_pydantic_v2 2 s 1.7 s +18.37%
WallTime test_perf_duplicate_names 1,057.6 ms 895.5 ms +18.11%
WallTime test_perf_deep_nested 5.2 s 4.4 s +17.55%
WallTime test_perf_all_options_enabled 5.4 s 4.6 s +17.52%
WallTime test_perf_openapi_large 3 s 2.5 s +17.33%
WallTime test_perf_large_models_pydantic_v2 3.5 s 3 s +16.64%
WallTime test_perf_aws_style_openapi_pydantic_v2 1.9 s 1.7 s +15.48%
WallTime test_perf_complex_refs 2 s 1.7 s +15.1%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing ci/speed-up-windows-setup (14d9007) with main (a3de5a0)

Open in CodSpeed

Footnotes

  1. 98 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a3de5a0) to head (14d9007).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #3565   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          163       163           
  Lines        34737     34737           
  Branches      4031      4031           
=========================================
  Hits         34737     34737           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@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

🧹 Nitpick comments (1)
.github/workflows/test.yaml (1)

400-422: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider a single source of truth for the pinned versions.

0.11.26, 4.56.1, and 1.35.2 are each hardcoded independently in the version: input, the cache-suffix, and the uv tool install command. A future version bump that misses one of these spots would silently leave a stale cache-suffix (harmless functionally, since uv's cache format tolerates cross-version sharing, but it defeats the intended cache-key precision and can mask which uv/tox/tox-uv combo actually populated a given cache).

♻️ Suggested consolidation via job-level env vars
+    env:
+      OS: ${{ matrix.os }}
+      SHARD_INDEX: ${{ matrix.shard }}
+      SHARD_TOTAL: ${{ matrix.shard_total }}
+      TOX_ENV: ${{ matrix.tox_env }}
+      WINDOWS_UV_VERSION: "0.11.26"
+      WINDOWS_TOX_VERSION: "4.56.1"
+      WINDOWS_TOXUV_VERSION: "1.35.2"
     steps:
     - name: Install uv (Windows)
       if: matrix.os == 'windows-latest'
       uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
       with:
-        version: "0.11.26"
+        version: "${{ env.WINDOWS_UV_VERSION }}"
         ...
-        cache-suffix: "windows-${{ matrix.tox_env }}-uv0.11.26-tox4.56.1-toxuv1.35.2"
+        cache-suffix: "windows-${{ matrix.tox_env }}-uv${{ env.WINDOWS_UV_VERSION }}-tox${{ env.WINDOWS_TOX_VERSION }}-toxuv${{ env.WINDOWS_TOXUV_VERSION }}"
     - name: Install tox (Windows)
       if: matrix.os == 'windows-latest'
-      run: uv tool install --python-preference only-managed --python 3.13 "tox==4.56.1" --with "tox-uv==1.35.2"
+      run: uv tool install --python-preference only-managed --python 3.13 "tox==${{ env.WINDOWS_TOX_VERSION }}" --with "tox-uv==${{ env.WINDOWS_TOXUV_VERSION }}"
🤖 Prompt for 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.

In @.github/workflows/test.yaml around lines 400 - 422, The Windows uv/tox
versions are duplicated across the workflow, so update the Install uv (Windows),
cache-suffix, and Install tox (Windows) steps to read from a single pinned
source instead of hardcoding 0.11.26, 4.56.1, and 1.35.2 in multiple places. Use
a shared job-level environment or equivalent constants so the astral-sh/setup-uv
and uv tool install references stay in sync and any future bump automatically
updates the cache suffix too.
🤖 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 @.github/workflows/test.yaml:
- Around line 414-419: The uv cache key is currently shard-specific in the
workflow’s setup-uv step, which prevents non-Windows shards from reusing each
other’s cache. Update the cache suffix used in the “Install the latest version
of uv” step to be shared across shards, and ensure only one shard is responsible
for saving the cache, following the same pattern used for Windows so all shards
can restore the same dependencies.

---

Nitpick comments:
In @.github/workflows/test.yaml:
- Around line 400-422: The Windows uv/tox versions are duplicated across the
workflow, so update the Install uv (Windows), cache-suffix, and Install tox
(Windows) steps to read from a single pinned source instead of hardcoding
0.11.26, 4.56.1, and 1.35.2 in multiple places. Use a shared job-level
environment or equivalent constants so the astral-sh/setup-uv and uv tool
install references stay in sync and any future bump automatically updates the
cache suffix too.
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c88c0fe5-f1e1-4a56-a71b-1577fd6aafcc

📥 Commits

Reviewing files that changed from the base of the PR and between c7f4938 and edb1b4e.

📒 Files selected for processing (1)
  • .github/workflows/test.yaml

Comment thread .github/workflows/test.yaml Outdated
@koxudaxi koxudaxi merged commit b5d167a into main Jul 3, 2026
59 checks passed
@koxudaxi koxudaxi deleted the ci/speed-up-windows-setup branch July 3, 2026 10:41
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Breaking Change Analysis

Result: No breaking changes detected

Reasoning: PR #3565 changes only the CI workflow file (.github/workflows/test.yaml) to speed up Windows CI setup — pinning uv/tox/tox-uv versions for Windows, adding caching, and adjusting a cache-suffix. It touches no library source code, generated output, Jinja2 templates, CLI options, Python API, defaults, supported Python versions, or error handling. The only deleted line is a cache-suffix string in CI config. Nothing affects end users of datamodel-code-generator, so there are no breaking changes.


This analysis was performed by Claude Code Action

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🎉 Released in 0.68.0

This PR is now available in the latest release. See the release notes for details.

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.

1 participant