GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Optimize CI cache usage by fanninpm · Pull Request #6707 · RustPython/RustPython

Conversation

@fanninpm

@fanninpm fanninpm commented Jan 11, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

When I was working on #6410, I noticed that the CI job "snippets_cpython" was recompiling RustPython even though no Rust code was changed.
I assumed the reason for the recompilation was because the "Check whats_left is not broken" step is recompiling RustPython with different cargo features than were defined earlier in the same job.
This "whats_left" recompilation is what ultimately gets cached/restored by the rust-cache action.
Then, when the "build rustpython" step is run, the difference in Cargo features necessitates a recompilation before the snippets and CPython tests are run.
For each CI run in the "snippets_cpython" job, these two recompilations cost us about 4 minutes on the Ubuntu runner, about 5 minutes on the macOS runner, and about 7-8 minutes on the windows runner.
This PR aims to eliminate the useless recompilations, making the CI run a little bit faster.

Summary by CodeRabbit

  • Chores
    • Updated CI workflow to use OS-specific build configurations, ensuring proper feature compilation across different platforms.

✏️ Tip: You can customize this high-level summary in your review settings.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@coderabbitai

coderabbitai Bot commented Jan 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The CI workflow is modified to apply OS-specific feature flags for WhatsLeft checks. A single unconditional step is replaced with two conditional steps: one for non-macOS runners with threading and jit features, and one for macOS with threading but explicitly excluding jit.

Changes

Cohort / File(s) Summary
CI Workflow Configuration
.github/workflows/ci.yaml
Replaced unconditional WhatsLeft step with two OS-specific conditional steps; non-macOS includes jit feature flag, macOS excludes it with TODO note.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A whisker-twitch through workflows we hop,
macOS takes one path, others don't stop,
JIT features dance on Linux so bright,
While Mac says "not yet"—we'll get it right! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Optimize CI cache usage' is partially related to the changeset. While the PR does address CI caching issues, the actual change shown in the raw_summary involves modifying the 'WhatsLeft check' step with OS-specific conditional logic and feature flags, not directly optimizing cache usage. Revise the title to better reflect the actual change, such as 'Make WhatsLeft check use consistent Cargo features across OS' or 'Run WhatsLeft with OS-specific feature flags to avoid redundant recompilations'.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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
  • X
  • Mastodon
  • Reddit
  • LinkedIn

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Jan 11, 2026

Copy link
Copy Markdown
Contributor

Code has been automatically formatted

The code in this PR has been formatted using cargo fmt --all.
Please pull the latest changes before pushing again:

git pull origin better-ci-cache
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fanninpm

fanninpm commented Jan 11, 2026

Copy link
Copy Markdown
Contributor Author

Code has been automatically formatted

The code in this PR has been formatted using cargo fmt --all. Please pull the latest changes before pushing again:

git pull origin better-ci-cache

@youknowone @ShaharNaveh I didn't even edit the file that was reformatted.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ShaharNaveh

ShaharNaveh commented Jan 11, 2026

Copy link
Copy Markdown
Contributor

Code has been automatically formatted
The code in this PR has been formatted using cargo fmt --all. Please pull the latest changes before pushing again:

git pull origin better-ci-cache

@youknowone @ShaharNaveh I didn't even edit the file that was reformatted.

I think it has something to do with the ruff version, I'll update it

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ShaharNaveh ShaharNaveh mentioned this pull request Jan 11, 2026
Update ruff to 0.14.11 in the CI #6708
Merged
@fanninpm
fanninpm force-pushed the better-ci-cache branch from 8d167e1 to 3f41b76 Compare January 11, 2026 21:26
@fanninpm

fanninpm commented Jan 11, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

coderabbitai[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Jan 11, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot reviewed Jan 11, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this 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

🤖 Fix all issues with AI agents
In @.github/workflows/ci.yaml:
- Around line 422-429: The sed invocation in the CI job names "Check whats_left
is not broken" is incorrectly quoted so it sees a leading double-quote in the
value `"${{ env.CARGO_ARGS }}"`, preventing the pattern `^--` from matching;
update the run lines that call whats_left.py to remove the escaped quotes and
use `${{ env.CARGO_ARGS }}` directly (so the sed expression s/^--[^ ]*// works),
or alternatively change the sed pattern to handle optional leading quotes (e.g.,
s/^"*--[^ ]*//), ensuring both the non-macOS and macOS steps that call python -I
whats_left.py use the fixed form.
🧹 Nitpick comments (1)
.github/workflows/ci.yaml (1)

426-426: Consider creating a tracking issue for the macOS JIT fix.

The TODO comment documents the macOS JIT exclusion, but this workaround might be forgotten over time. Consider opening a GitHub issue to track resolving the underlying JIT issue on macOS.

Would you like me to help draft an issue to track this?

📜 Review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 29bb8b4 and f88cd49.

📒 Files selected for processing (2)
  • .github/workflows/ci.yaml
  • scripts/fix_test.py
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.py: In most cases, Python code should not be edited; bug fixes should be made through Rust code modifications only
Follow PEP 8 style for custom Python code
Use ruff for linting Python code

Files:

  • scripts/fix_test.py
**/*test*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*test*.py: NEVER comment out or delete any test code lines except for removing @unittest.expectedFailure decorators and upper TODO comments
NEVER modify test assertions, test logic, or test data in test files
When a test cannot pass due to missing language features, keep it as expectedFailure and document the reason; do not comment it out
The only acceptable modifications to test files are: (1) Removing @unittest.expectedFailure decorators and the upper TODO comments when tests actually pass, and (2) Adding @unittest.expectedFailure decorators when tests cannot be fixed

Files:

  • scripts/fix_test.py
🧠 Learnings (3)
📚 Learning: 2025-12-27T14:03:49.034Z
Learnt from: CR
Repo: RustPython/RustPython PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-27T14:03:49.034Z
Learning: Applies to **/*.rs : Always run clippy to lint code (`cargo clippy`) before completing tasks and fix any warnings or lints introduced by changes

Applied to files:

  • .github/workflows/ci.yaml
📚 Learning: 2025-08-30T14:40:05.858Z
Learnt from: ShaharNaveh
Repo: RustPython/RustPython PR: 6089
File: scripts/lib_updater.py:292-297
Timestamp: 2025-08-30T14:40:05.858Z
Learning: In scripts/lib_updater.py, the --inplace flag intentionally writes to orig_file (not remote_file) even though patches are applied to remote_file content. This workflow allows updating the original RustPython test file with patches applied to new upstream CPython content.

Applied to files:

  • scripts/fix_test.py
📚 Learning: 2025-09-07T05:38:31.690Z
Learnt from: ShaharNaveh
Repo: RustPython/RustPython PR: 6089
File: scripts/lib_updater.py:198-202
Timestamp: 2025-09-07T05:38:31.690Z
Learning: In scripts/lib_updater.py, the iter_patches function intentionally does not handle SyntaxError from ast.parse(contents). The author confirmed this behavior is fine and intended - the tool should fail fast on unparseable files rather than silently skip processing.

Applied to files:

  • scripts/fix_test.py
🔇 Additional comments (1)
scripts/fix_test.py (1)

30-30: LGTM!

The import reordering follows alphabetical convention and is consistent with ruff formatting mentioned in the PR discussion.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .github/workflows/ci.yaml Resolved

Uh oh!

There was an error while loading. Please reload this page.

@fanninpm

fanninpm commented Jan 11, 2026

Copy link
Copy Markdown
Contributor Author

Here's a git trick for everyone: Assuming you have no files staged, git commit --allow-empty -m 'Do nothing' produces a commit with no files changed and the message "Do nothing".

moreal reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fanninpm
fanninpm force-pushed the better-ci-cache branch from 1018896 to 1411f9e Compare January 20, 2026 02:33
fanninpm added 3 commits January 19, 2026 21:53
@fanninpm
Make whats_left.py compile with same settings as before
dac40a0
@fanninpm
Add --no-default-features to scripts/whats_left.py
c930055
@fanninpm
Build RustPython with no default features
7b54963
@fanninpm
fanninpm force-pushed the better-ci-cache branch from 1411f9e to 7b54963 Compare January 20, 2026 03:10
@fanninpm
Retrigger CI
2c9c72d
@fanninpm
fanninpm marked this pull request as ready for review January 20, 2026 04:43
@fanninpm
fanninpm requested a review from youknowone January 20, 2026 04:43
@ShaharNaveh

ShaharNaveh commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

Here's a git trick for everyone: Assuming you have no files staged, git commit --allow-empty -m 'Do nothing' produces a commit with no files changed and the message "Do nothing".

I usually call the commit "Trigger CI"

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

youknowone
youknowone approved these changes Jan 21, 2026
View reviewed changes
@youknowone
youknowone merged commit 122fac9 into RustPython:main Jan 21, 2026
13 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@fanninpm
fanninpm deleted the better-ci-cache branch January 22, 2026 01:47
This was referenced Mar 7, 2026
Restructure CI with matrix approach and multi-feature support #7376
Merged
Enable jit on macos (CI) #7401
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] left review comments
@youknowone youknowone youknowone approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@fanninpm @ShaharNaveh @youknowone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.