Skip to content

Rust CI improvements#7520

Merged
gdesmott merged 6 commits intomasterfrom
rust-ci-improvements
Nov 27, 2025
Merged

Rust CI improvements#7520
gdesmott merged 6 commits intomasterfrom
rust-ci-improvements

Conversation

@LukeMathWalker
Copy link
Collaborator

@LukeMathWalker LukeMathWalker commented Nov 26, 2025

Describe the changes in the pull request

Optimize the Rust build setup for maximum Docker cacheability.
Add package caching to platforms that can run the corresponding GitHub action.

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

Note

Centralizes the pinned Rust nightly via .rust-nightly, adds a root rust-toolchain.toml, and enables GitHub Actions cargo caching to speed Rust tests.

  • CI:
    • Enable Cargo package caching with Swatinem/rust-cache@v2 (workspace src/redisearch_rs -> ../../bin/redisearch_rs).
    • Update scripts to read the pinned nightly from .rust-nightly instead of hardcoded values: build.sh, .install/test_deps/install_rust_deps.sh, tests/deps/setup_rejson.sh; print nightly version during coverage runs.
  • Toolchain:
    • Add root rust-toolchain.toml (channel 1.91.1); remove src/redisearch_rs/rust-toolchain.toml.
    • Introduce .rust-nightly to pin nightly (nightly-2025-07-30).
  • Docker/Context:
    • Update .dockerignore to include .rust-nightly and rust-toolchain.toml in build context.

Written by Cursor Bugbot for commit 58364ec. This will update automatically on new commits. Configure here.

@LukeMathWalker LukeMathWalker added enforce:coverage Run coverage flow even on draft pull request enforce:sanitize Run sanitizer flow even on draft pull request enforce:test Run the test suite even if no code has changed. labels Nov 26, 2025
All nightly-related references to build.sh have been updated
to use .rust-nightly as the source of truth.
It gets rid of unnecessary rebuilds, since the nightly version was
the only thing we cared about from `build.sh` when building the container.
Using a specific version, the CI container is correctly rebuilt whenever that version changes.
It also moves the Rust toolchain file to the root of the repository, to ease
copying it into the container during build.
@codecov
Copy link

codecov bot commented Nov 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.87%. Comparing base (874ce68) to head (58364ec).
⚠️ Report is 15 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7520      +/-   ##
==========================================
- Coverage   85.00%   84.87%   -0.13%     
==========================================
  Files         349      349              
  Lines       53877    53873       -4     
  Branches    14384    14380       -4     
==========================================
- Hits        45797    45724      -73     
- Misses       7884     7957      +73     
+ Partials      196      192       -4     
Flag Coverage Δ
flow 85.16% <ø> (-0.03%) ⬇️
unit 52.26% <ø> (-0.12%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

@LukeMathWalker
Copy link
Collaborator Author

@LukeMathWalker LukeMathWalker added this pull request to the merge queue Nov 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 26, 2025
@gdesmott gdesmott added this pull request to the merge queue Nov 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 27, 2025
@gdesmott gdesmott added this pull request to the merge queue Nov 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 27, 2025
@gdesmott gdesmott added this pull request to the merge queue Nov 27, 2025
Merged via the queue into master with commit 7bc0ece Nov 27, 2025
93 of 104 checks passed
@gdesmott gdesmott deleted the rust-ci-improvements branch November 27, 2025 17:29
@redisearch-backport-pull-request
Copy link
Contributor

Backport failed for 8.2, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 8.2
git worktree add -d .worktree/backport-7520-to-8.2 origin/8.2
cd .worktree/backport-7520-to-8.2
git switch --create backport-7520-to-8.2
git cherry-pick -x 7bc0ece6d10445dccdab9c0ffdce9f2f48418ceb

redisearch-backport-pull-request bot pushed a commit that referenced this pull request Nov 27, 2025
* Move nightly version to a standalone .rust-nightly file.

All nightly-related references to build.sh have been updated
to use .rust-nightly as the source of truth.

* Copy `.rust-nightly` rather than `build.sh` into the CI container.

It gets rid of unnecessary rebuilds, since the nightly version was
the only thing we cared about from `build.sh` when building the container.

* Use a specific stable version of Rust.

Using a specific version, the CI container is correctly rebuilt whenever that version changes.
It also moves the Rust toolchain file to the root of the repository, to ease
copying it into the container during build.

* Cache Rust packages in CI.

* Only use the cache action if Node is supported.

* Trigger build with cache hit

(cherry picked from commit 7bc0ece)
@redisearch-backport-pull-request
Copy link
Contributor

Successfully created backport PR for 8.4:

github-merge-queue bot pushed a commit that referenced this pull request Dec 1, 2025
* Rust CI improvements (#7520)

* Move nightly version to a standalone .rust-nightly file.

All nightly-related references to build.sh have been updated
to use .rust-nightly as the source of truth.

* Copy `.rust-nightly` rather than `build.sh` into the CI container.

It gets rid of unnecessary rebuilds, since the nightly version was
the only thing we cared about from `build.sh` when building the container.

* Use a specific stable version of Rust.

Using a specific version, the CI container is correctly rebuilt whenever that version changes.
It also moves the Rust toolchain file to the root of the repository, to ease
copying it into the container during build.

* Cache Rust packages in CI.

* Only use the cache action if Node is supported.

* Trigger build with cache hit

(cherry picked from commit 7bc0ece)

* fix: Avoid Rust cache contamination across platforms. (#7569)

---------

Co-authored-by: Luca Palmieri <[email protected]>
@LukeMathWalker LukeMathWalker restored the rust-ci-improvements branch February 8, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 8.2 backport 8.4 enforce:coverage Run coverage flow even on draft pull request enforce:sanitize Run sanitizer flow even on draft pull request enforce:test Run the test suite even if no code has changed. size:S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants