Refactor FsRepository's renders - #1159
Conversation
8d8f699 to
edf84c4
Compare
|
Tests are now passing legitimately (at least locally, with an spfs installed from this code). What's left besides general cleanup is creating some new tests that specifically exercise the desired outcome: not creating the renders directory if using fuse. I'm not sure if that is true yet with these changes but the framework for making it possible should be there. |
7ec8e8b to
51a8e45
Compare
631cc72 to
a367c0f
Compare
|
Making progress but the behavior of I'm trying to get it so |
51a8e45 to
470ac8b
Compare
051f03e to
8140bae
Compare
8140bae to
e3cf272
Compare
470ac8b to
60add1c
Compare
acfea7f to
f866c95
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
f866c95 to
e665f18
Compare
There was a problem hiding this comment.
Pull request overview
Refactors SPFS filesystem repositories to make render-store creation optional (or deferred) so the local repo can be opened without creating renders/ for the current user when renders aren’t needed (e.g., FUSE paths, spfs clean).
Changes:
- Introduces typed “render store flavors” (
RenderStore,MaybeRenderStore,NoRenderStore) and threads them throughOpenFsRepository/MaybeOpenFsRepository,FallbackProxy, andRepositoryHandle. - Updates call sites across SPK/SPFS crates to select an appropriate repo flavor based on whether renders are required.
- Adds an integration test asserting that FUSE-backed operations do not create the
renders/directory.
Reviewed changes
Copilot reviewed 60 out of 61 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| cspell.json | Adds mktemp to dictionary for new shell test. |
| crates/spk/src/lib.rs | Normalizes pub use re-export style. |
| crates/spk-storage/src/storage/spfs_test.rs | Updates tests to explicitly create repos with RenderStore. |
| crates/spk-storage/src/storage/spfs.rs | Opens local repo as MaybeRenderStore to avoid eager renders creation. |
| crates/spk-storage/src/fixtures.rs | Updates fixtures to create repos with RenderStore. |
| crates/spk-solve/src/lib.rs | Normalizes re-exports; exposes serde/spfs and solve subcrates. |
| crates/spk-solve/crates/macros/src/lib.rs | Normalizes re-exports used by macros. |
| crates/spk-launcher/src/main.rs | Uses OpenFsRepository<NoRenderStore> in launcher path. |
| crates/spk-cli/group4/src/cmd_view.rs | Minor import consolidation. |
| crates/spk-cli/group3/src/cmd_import_test.rs | Adjusts expectations: repo layout no longer requires renders/. |
| crates/spk-cli/group3/src/cmd_export_test.rs | Adjusts expectations: repo layout no longer requires renders/. |
| crates/spk-cli/group2/src/cmd_ls.rs | Import reshuffle; explicit spk_config / spk_storage usage. |
| crates/spk-cli/group1/src/cmd_completion.rs | Import consolidation for clap_complete. |
| crates/spk-cli/common/src/flags.rs | Import reshuffle; explicit solve/storage aliases. |
| crates/spk-cli/cmd-render/src/cmd_render.rs | Opens local repo with NoRenderStore for render command path that shouldn’t force renders. |
| crates/spk-build/src/build/binary_test.rs | Uses get_local_repository::<RenderStore>() in build tests needing renders. |
| crates/spfs/tests/integration/unprivileged/test_fuse_does_not_create_renders.sh | New integration test asserting FUSE does not create renders/. |
| crates/spfs/src/sync_test.rs | Uses NoRenderStore for sync tests that don’t need renders. |
| crates/spfs/src/storage/tar/repository.rs | Tar repository uses MaybeOpenFsRepository<NoRenderStore> internally. |
| crates/spfs/src/storage/tag_test.rs | Updates test repo creation to RenderStore. |
| crates/spfs/src/storage/repository_test.rs | Updates fs repo creation to RenderStore and handle variant matches. |
| crates/spfs/src/storage/repository.rs | Splits repository traits into payload vs render-store capabilities (LocalPayloads, TryRenderStore, etc.). |
| crates/spfs/src/storage/proxy/repository_test.rs | Updates proxy repo tests to create repos with RenderStore. |
| crates/spfs/src/storage/mod.rs | Re-exports new repository/render-store traits and defaults. |
| crates/spfs/src/storage/handle.rs | Expands RepositoryHandle variants to encode render-store capability. |
| crates/spfs/src/storage/fs/tag.rs | Generalizes tag storage impls over render-store flavor type parameter. |
| crates/spfs/src/storage/fs/repository.rs | Core refactor: render store flavors, creation policies, and generic fs repo types. |
| crates/spfs/src/storage/fs/renderer_win.rs | Renderer now depends on LocalPayloads + TryRenderStore instead of LocalRepository. |
| crates/spfs/src/storage/fs/renderer_unix.rs | Renderer now uses try_render_store(); avoids hard dependency on renders. |
| crates/spfs/src/storage/fs/renderer_test.rs | Updates renderer tests to use RenderStore variant. |
| crates/spfs/src/storage/fs/renderer.rs | Splits rendering APIs based on whether repo has a guaranteed render store. |
| crates/spfs/src/storage/fs/payloads.rs | Generalizes payload storage impls over render-store flavor. |
| crates/spfs/src/storage/fs/mod.rs | Re-exports new fs storage types (render store flavors, policies). |
| crates/spfs/src/storage/fs/manifest_render_path.rs | Adds ManifestRenderPath impl for Arc<T>. |
| crates/spfs/src/storage/fs/hash_store.rs | Adds Debug derive to FsHashStore. |
| crates/spfs/src/storage/fs/database.rs | Generalizes database impls over render-store flavor. |
| crates/spfs/src/storage/fallback/repository_test.rs | Updates fallback proxy tests to use FallbackProxy<RenderStore>. |
| crates/spfs/src/storage/fallback/repository.rs | Makes FallbackProxy generic over render-store flavor and updates conversions/traits. |
| crates/spfs/src/storage/error.rs | Adds new open-repo errors for render-store unavailability/policy mismatch. |
| crates/spfs/src/status_unix.rs | Makes overlay render path explicit with RenderStore generic selection. |
| crates/spfs/src/runtime/storage_test.rs | Updates runtime storage tests to create fs repos with RenderStore. |
| crates/spfs/src/runtime/storage.rs | Updates durable-path lookup for new RepositoryHandle variants. |
| crates/spfs/src/resolve_test.rs | Updates tests to open local repo with RenderStore where required. |
| crates/spfs/src/resolve.rs | Uses NoRenderStore for manifest computation; makes overlay render path generic over render-store type. |
| crates/spfs/src/fixtures.rs | Adds new tmprepo kinds for render-store flavors and updates fixtures accordingly. |
| crates/spfs/src/config_test.rs | Creates remote fs repo with NoRenderStore. |
| crates/spfs/src/config.rs | Makes local repo getters generic over render-store flavor; forces remotes to NoRenderStore. |
| crates/spfs/src/commit_test.rs | Updates repo creation calls to specify RenderStore. |
| crates/spfs/src/clean_test.rs | Expands tests across repo flavors; refactors render-clean test helper. |
| crates/spfs/src/clean.rs | Updates cleaning logic to operate with optional/deferred render store and avoid creating renders. |
| crates/spfs/src/bootstrap_test.rs | Updates repo creation calls to specify RenderStore. |
| crates/spfs/benches/spfs_bench.rs | Uses NoRenderStore for benchmark repo creation. |
| crates/spfs/Cargo.toml | Adds variantly dependency (workspace) for render-store policy enum helpers. |
| crates/spfs-vfs/src/winfsp/mount.rs | Updates VFS read path to handle new RepositoryHandle FS variants. |
| crates/spfs-vfs/src/fuse.rs | Updates FUSE read path to handle new RepositoryHandle FS variants. |
| crates/spfs-cli/main/src/cmd_search.rs | Uses NoRenderStore when searching tags to avoid renders creation. |
| crates/spfs-cli/main/src/cmd_init.rs | Initializes repo as NoRenderStore (no renders created at init). |
| crates/spfs-cli/common/src/lib.rs | Normalizes private re-export style. |
| crates/spfs-cli/common/src/args.rs | Uses LocalPayloads instead of LocalRepository for renderer construction. |
| crates/spfs-cli/cmd-render/src/cmd_render.rs | Splits render-to-dir vs render-to-repo flows using MaybeRenderStore vs RenderStore. |
| Cargo.lock | Records new dependency usage (variantly). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Expand the clean tests to test the multiple flavors of FS repo. Signed-off-by: J Robert Ray <jrray@jrray.org>
Signed-off-by: J Robert Ray <jrray@jrray.org>
Signed-off-by: J Robert Ray <jrray@jrray.org>
Signed-off-by: J Robert Ray <jrray@jrray.org>
Change from_config to return a RepositoryHandle instead of a specific repository type. The conflict stems from the config containing options that would influence what specific repository type is needed to respect the options. Therefore, callers using from_config shouldn't be expected to know which specific repository type is needed, and this keeps the logic of choosing the appropriate arm of RepositoryHandle internal to the individual repository implementations. Signed-off-by: J Robert Ray <jrray@jrray.org>
Signed-off-by: J Robert Ray <jrray@jrray.org>
Signed-off-by: J Robert Ray <jrray@jrray.org>
Signed-off-by: J Robert Ray <jrray@jrray.org>
Signed-off-by: J Robert Ray <jrray@jrray.org>
Signed-off-by: J Robert Ray <jrray@jrray.org>
Signed-off-by: J Robert Ray <jrray@jrray.org>
Signed-off-by: J Robert Ray <jrray@jrray.org>
Signed-off-by: J Robert Ray <jrray@jrray.org>
99eb63d to
693ad96
Compare
Signed-off-by: J Robert Ray <jrray@jrray.org>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 66 out of 67 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
renders_for_all_users now gracefully skips per-user render stores that fail with PathNotInitialized or RenderStorageUnavailable instead of aborting the entire operation. This prevents commands like spfs clean from failing due to a single bad or missing per-user proxy directory. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: J Robert Ray <jrray@jrray.org>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 66 out of 67 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Some RS types like MaybeRenderStore defer on-disk validation in render_store_for_user(), so it always succeeds even when the proxy directory is missing. Add a direct filesystem check for the proxy directory before calling render_store_for_user to ensure users with missing or invalid proxy directories are skipped regardless of the RS type. Also adds a test using MaybeRenderStore to verify the deferred validation path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: J Robert Ray <jrray@jrray.org>
…er blob When try_render_store() returns Err, the else branch now returns a proper Error::NoRenderStorage with the repository address, making the error matchable and consistent with how this case is handled elsewhere (e.g. in clean.rs). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: J Robert Ray <jrray@jrray.org>
cc6345c to
66d457d
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 66 out of 67 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The goal is to make it so it is possible to open repo without creating the renders directory for the current user, in situations where that renders directory will not be used. Examples include when using fuse or when running
spfs clean.This introduces different flavors of a "render store" besides
RenderStorethat either represent a render store that hasn't been created yet (but can be) or the lack of a render store. Operations that don't require a render store can access the local repository without the renders directory being created.WIP: The test suite passes1 with this code but it is unfinished.Footnotes
On my machine... A limitation of the test suite is that it uses the installed spfs binaries instead of the spfs code in the current branch. ↩