Skip to content

Conversation

Boshen
Copy link
Member

@Boshen Boshen commented Sep 20, 2025

Summary

Split the large src/cache.rs file (2100+ lines) into focused, maintainable modules for better code organization and developer experience.

Changes

  • src/cache/mod.rs - Main module with clean re-exports
  • src/cache/cache_impl.rs - Core Cache struct and implementation (277 lines)
  • src/cache/cached_path.rs - CachedPath and CachedPathImpl structs (223 lines)
  • src/cache/borrowed_path.rs - BorrowedCachedPath helper for efficient lookups (25 lines)
  • src/cache/hasher.rs - IdentityHasher implementation (20 lines)
  • src/cache/thread_local.rs - Thread-local storage utilities (12 lines)

Benefits

Better maintainability - Each file has a clear, focused responsibility
Improved code organization - Related functionality is logically grouped
Easier navigation - Developers can quickly find specific cache components
Reduced merge conflicts - Multiple developers can work on different cache components
Same public API - No breaking changes for users of the library

Test Results

  • ✅ All 149 tests pass successfully
  • ✅ Code compiles without errors
  • ✅ No changes to public interface

Test plan

  • Run cargo check - compiles successfully
  • Run cargo test - all 149 tests pass
  • Verify no breaking changes to public API
  • Confirm module structure follows Rust conventions

🤖 Generated with Claude Code

Copy link

graphite-app bot commented Sep 20, 2025

How to use the Graphite Merge Queue

Add the label merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@Boshen Boshen force-pushed the refactor/split-cache-module branch from fed4a57 to fa74781 Compare September 20, 2025 16:12
Copy link

codecov bot commented Sep 20, 2025

Codecov Report

❌ Patch coverage is 94.54545% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.68%. Comparing base (5cd02b9) to head (ec96dec).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/cache/cached_path.rs 97.26% 4 Missing ⚠️
src/cache/borrowed_path.rs 66.66% 3 Missing ⚠️
src/cache/hasher.rs 75.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #714   +/-   ##
=======================================
  Coverage   94.68%   94.68%           
=======================================
  Files          12       15    +3     
  Lines        2899     2899           
=======================================
  Hits         2745     2745           
  Misses        154      154           

☔ 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.

Copy link

codspeed-hq bot commented Sep 20, 2025

CodSpeed Performance Report

Merging #714 will not alter performance

Comparing refactor/split-cache-module (ec96dec) with main (bfa4a89)1

Summary

✅ 7 untouched
⏩ 2 skipped2

Footnotes

  1. No successful run was found on main (5cd02b9) during the generation of this report, so bfa4a89 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 2 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.

@Boshen Boshen force-pushed the refactor/split-cache-module branch from 0d95a30 to ded3cf7 Compare September 20, 2025 16:18
@Boshen Boshen marked this pull request as draft September 20, 2025 16:18
@Boshen Boshen force-pushed the refactor/split-cache-module branch 2 times, most recently from a5f1c08 to 2284f0f Compare September 21, 2025 05:48
- Add back OnceCell import for yarn_pnp manifest storage
- Fix pnp import to use external crate instead of crate::pnp
- Ensures cargo check --all-features --all-targets passes
- All 134 tests pass with yarn_pnp feature enabled
@Boshen Boshen force-pushed the refactor/split-cache-module branch from 2284f0f to ec96dec Compare September 21, 2025 06:05
@Boshen Boshen marked this pull request as ready for review September 21, 2025 06:11
@Boshen Boshen merged commit 5ed82ec into main Sep 21, 2025
14 checks passed
@Boshen Boshen deleted the refactor/split-cache-module branch September 21, 2025 06:11
@Boshen Boshen mentioned this pull request Sep 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant