Skip to content

Conversation

@joseph-isaacs
Copy link
Contributor

@joseph-isaacs joseph-isaacs commented Dec 1, 2025

Summary

  • Add cache-suffix input to setup-rust action to allow jobs with different RUSTFLAGS to use separate caches
  • Use cache-suffix: "sanitizer" for the sanitizer test job to prevent cache pollution between sanitizer and non-sanitizer builds

Test plan

  • Verify CI jobs pass
  • Confirm sanitizer job uses separate cache key

🤖 Generated with Claude Code

Add a `cache-suffix` input to setup-rust action to allow jobs with
different RUSTFLAGS to use separate caches. This prevents cache
pollution between sanitizer and non-sanitizer builds.

Signed-off-by: Joe Isaacs <joe@spiraldb.com>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@joseph-isaacs joseph-isaacs enabled auto-merge (squash) December 1, 2025 22:12
@joseph-isaacs joseph-isaacs added the changelog/chore A trivial change label Dec 1, 2025
@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.53%. Comparing base (89b236b) to head (47393b7).
⚠️ Report is 3 commits behind head on develop.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@0ax1 0ax1 self-requested a review December 2, 2025 15:48
repo-token: ${{ secrets.GITHUB_TOKEN }}
toolchain: nightly
components: "rust-src, rustfmt, clippy, llvm-tools-preview"
cache-suffix: "sanitizer"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, do you have a preferred way to get a prefix?

@0ax1
Copy link
Contributor

0ax1 commented Dec 2, 2025

@claude review

@claude
Copy link
Contributor

claude bot commented Dec 2, 2025

Claude finished @0ax1's task —— View job


Code Review Complete ✓

I've reviewed this PR and the changes look good! Here's my detailed feedback:

Summary

This PR adds a cache-suffix input to the setup-rust action to isolate caches for builds with different RUSTFLAGS. This is a smart solution to prevent cache pollution between the sanitizer build (which uses special RUSTFLAGS) and normal builds.

What Changed

  1. .github/actions/setup-rust/action.yml:

    • Added new optional cache-suffix input with empty string default
    • Modified the shared-key in the rust-cache step to conditionally append the suffix using format('-{0}', inputs.cache-suffix)
  2. .github/workflows/ci.yml:

    • Added cache-suffix: "sanitizer" to the sanitizer test job that uses special RUSTFLAGS

Review Feedback

✅ Strengths:

  • The implementation correctly addresses the cache pollution issue between sanitizer and non-sanitizer builds
  • The conditional suffix syntax ${{ inputs.cache-suffix && format('-{0}', inputs.cache-suffix) || '' }} is idiomatic and clean
  • The default empty string ensures backward compatibility for existing jobs
  • The suffix is only applied where needed (sanitizer job)
  • Good documentation in the input description explaining the purpose

💡 Suggestions:

  1. Consider applying to other jobs with special RUSTFLAGS: Looking at the workflow, there are other jobs that might benefit from cache isolation:

    • The rust-coverage job (line 334) has RUSTFLAGS: "-Cinstrument-coverage -A warnings"
    • This could potentially cause cache conflicts with other builds
  2. Documentation: Consider adding a comment in the workflow near the sanitizer job explaining why the cache-suffix is needed, for future maintainers. Something like:

    # Use separate cache due to different RUSTFLAGS (sanitizer flags)
    cache-suffix: "sanitizer"
  3. Regarding the review comment about prefix: The current implementation uses a suffix approach which is appropriate since:

    • It maintains all the existing cache key components in order
    • The conditional format ensures clean key generation
    • If you wanted a prefix instead, you'd use: ${{ inputs.cache-suffix && format('{0}-', inputs.cache-suffix) || '' }}rust-cache-...
    • However, suffix is more intuitive here since it's an optional modifier to the base key

🎯 Recommendation:
This PR is ready to merge. The implementation is sound and solves the stated problem effectively. The optional suggestions above are minor enhancements that could be addressed in follow-up work if desired.

Overall Assessment:Approved - Clean, well-scoped change that solves a real problem.


@joseph-isaacs joseph-isaacs merged commit a09481c into develop Dec 2, 2025
51 of 52 checks passed
@joseph-isaacs joseph-isaacs deleted the ci-cache-suffix branch December 2, 2025 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/chore A trivial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants