Skip to content

Fix spfs info across split local/origin objects - #1401

Open
jrray wants to merge 5 commits into
mainfrom
spfs-info-cross-repo
Open

Fix spfs info across split local/origin objects#1401
jrray wants to merge 5 commits into
mainfrom
spfs-info-cross-repo

Conversation

@jrray

@jrray jrray commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

spfs info could fail with unknown-object errors when runtime objects are split across local and origin repositories. This branch now handles that split, adds an explicit fallback mode, and surfaces a user hint when lookup likely needs extra repositories.

For example, spfs info /spfs/path/to/file -r origin now keeps searching when some runtime objects are local-only, and spfs info --origin-local-fallback ... enables primary/fallback reads across local and origin.

Summary of changes:

  • Skip UnknownObject during runtime path traversal so lookup continues instead of aborting.
  • Add spfs info --origin-local-fallback to read through both local and origin repositories.
  • When lookup still fails and unknown objects were skipped, print a hint suggesting extra repos may be needed and recommend --origin-local-fallback.
  • Add targeted tests for no-active-runtime diagnostics and hint gating logic to improve patch coverage.

@jrray jrray self-assigned this Aug 7, 2026
@jrray jrray added the enhancement New feature or request label Aug 8, 2026
@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.42922% with 56 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/spfs-cli/main/src/cmd_info.rs 16.66% 35 Missing ⚠️
crates/spfs/src/find_path.rs 58.00% 21 Missing ⚠️

📢 Thoughts on this report? Let us know!

jrray and others added 4 commits August 7, 2026 17:45
When `spfs info /spfs/...` is run against a selected repo, runtime
stack entries and child references can legitimately be missing from
that repo (for example local-only vs origin-only objects).

Treat `UnknownObject` as a non-fatal miss while walking stack and
child references, so the command continues searching and reports
providers that do exist in the chosen repo.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: J Robert Ray <jrray@imageworks.com>
Add `spfs info --origin-local-fallback` to read objects through a
proxy over both local and origin repositories.

The selected repo remains primary (`local` by default or `--remote
origin`), and the other repo is used as a fallback for missing
objects so mixed-runtime stacks no longer fail on unknown objects.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: J Robert Ray <jrray@imageworks.com>
When `spfs info /spfs/...` cannot find a provider and unknown objects
were skipped during traversal, print a user-facing hint that extra
repositories may be needed and suggest `--origin-local-fallback`.

Add a diagnostics variant of runtime path-provider lookup so callers can
detect whether unknown objects were encountered while searching.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: J Robert Ray <jrray@imageworks.com>
Rebase the branch onto current main and add targeted tests around
new path-provider diagnostics and info hint behavior.

The new tests cover the no-active-runtime path lookup failure mode
and the hint emission predicate used by `spfs info` when unknown
objects were skipped.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: J Robert Ray <jrray@imageworks.com>
@jrray
jrray force-pushed the spfs-info-cross-repo branch from 6128655 to bab55ed Compare August 8, 2026 00:56
Move new test coverage into dedicated `*_test.rs` modules to match
project conventions.

Replace low-signal branch-only tests with runtime behavior tests that
exercise meaningful lookup outcomes: no active runtime, missing stack
objects, missing layer manifests, and empty runtime stack handling.

Keep the info hint assertion focused on user-visible fallback guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: J Robert Ray <jrray@imageworks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant