fix(storage): root model file trees at the models prefix - #7074
Draft
tanishqgandhi1908 wants to merge 27 commits into
Draft
fix(storage): root model file trees at the models prefix#7074tanishqgandhi1908 wants to merge 27 commits into
tanishqgandhi1908 wants to merge 27 commits into
Conversation
… tests Review fixes on apache#5911: use dataset owner email in retrieveLatestDatasetVersion, replace brittle Option.get/.head with headOption, strip datasets prefix on selection-modal reopen, clarify FileResolver docs; add FileResolver/DatasetFileNode and frontend path-helper tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The datasets logical-path prefix strips four leading segments (datasets/owner/dataset/version); update the cover-image test's input path to include the prefix so the extracted relative path is the file name, not an empty string. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Now that models are coming as a separate resource/table, the leading resource-type segment is what selects the backing table, so an unprefixed path can no longer be routed unambiguously. Make the "datasets" prefix required instead of a tolerated fallback, and migrate existing data. - FileResolver: a dataset path must start with the "datasets" segment; unprefixed paths are no longer treated as dataset paths. - pytexera DatasetFileDocument: same rule, mirroring the backend. - FileListerSourceOpExec: parse the now-prefixed datasetVersionPath (skip the "datasets" segment); extracted into a testable helper. - Migration (sql/updates/29.sql): prepend "datasets/" to legacy paths stored in workflow.content and workflow_version.content, covering both the fileName (scan sources) and datasetVersionPath (file lister) operator properties. Only values whose first two segments match an existing (user.email, dataset.name) are rewritten, so local paths and URLs are left untouched; email format is irrelevant (owner may be a username without "@"). Uses create_missing=false and is idempotent. - Example workflows: use datasets-prefixed paths. Tests: FileResolverSpec and WorkflowExecutionsResourceSpec updated; test_dataset_file_document.py updated; new FileListerSourceOpExecSpec. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…l-path-prefix # Conflicts: # frontend/src/app/common/type/datasetVersionFileTree.spec.ts
…format python test - dataset-selection-modal.component.spec.ts: expect the datasets-prefixed selectedPath in version (non-file) mode, matching the emitted path. - test_dataset_file_document.py: apply ruff format (wrap an over-length line) so `ruff format --check` passes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The cover-image endpoints resolve a dataset path built as
{owner}/{name}/{coverImage}. With the prefix now required by FileResolver,
these must carry the datasets/ segment; add it in the set-cover,
get-cover redirect, and cover-url handlers so cover images resolve again.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…storage # Conflicts: # sql/changelog.xml
…rage # Conflicts: # common/workflow-core/src/test/scala/org/apache/texera/amber/core/storage/DocumentFactorySpec.scala
The explicit-access branch of listModels hardcoded size 0 while the public branch computed it, so a user's own models reported no size. Compute it in both, mirroring the dataset listing, and degrade to 0 rather than dropping the row when LakeFS cannot answer.
DatasetFileNode.fromLakeFSRepositoryCommittedObjects hardcoded ResourceType.Datasets as the tree's leading segment. Models reuse that builder, so model file nodes reported paths under /datasets/... . FileResolver dispatches on that segment, so presigning a model file by its logical path resolved against the DATASET table -- a 404, or the wrong resource's file when a user owns a same-named dataset. Make resourceType a required parameter so every call site declares which resource it builds, and extract the scaffolding the two builders duplicated into buildVersionSkeleton and sortChildrenRecursively. fromPhysicalFileNodes stays pinned to Datasets: physical on-disk trees are dataset-only. Datasets are unaffected -- the file-population loop is moved verbatim and the terminal sort makes creation order unobservable. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Backport auto-label reportThis
|
Contributor
Automated Reviewer SuggestionsBased on the
|
xuang7
removed their request for review
July 30, 2026 06:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
DatasetFileNode.fromLakeFSRepositoryCommittedObjects hardcoded ResourceType.Datasets as the tree's leading segment. Models reuse that builder, so every model file node reported a path under /datasets/…:
/datasets/bob@texera.com/resnet/v1/weights/model.pt ← what a model tree returns today
/models/bob@texera.com/resnet/v1/weights/model.pt ← what it should return
FileResolver.resolve dispatches on that leading segment — /datasets/… resolves against the DATASET table, /models/… against MODEL. So any caller that takes a node's path and hands it to the presign endpoint resolves a model file against datasets: a 404 in the common case, and the wrong resource's file if the user happens to own a dataset with the same name as their model. Nothing in the stack hits this yet because no current caller round-trips a model node's path through FileResolver; the model management UI does, which is how it surfaced.
The fix makes resourceType a required parameter, so every call site must declare which resource it is building — no silent default that can drift again. The three dataset call sites pass ResourceType.Datasets; the three model call sites pass ResourceType.Models.
Datasets are unaffected. The file-population loop is moved verbatim, and the terminal sort makes creation order unobservable: every level is sorted by name before the tree is returned, so restructuring the two-pass creation cannot change output.
Any related issues, documentation, discussions?
Part of #6497 (Add model file storage and path resolution)
Related: #6495 (Add a resource-type prefix to logical paths),
Umbrella: #6494.
How was this PR tested?
sbt "FileService/test"
sbt "FileService/scalafixAll" "FileService/scalafmtAll"
FileService/test: 349 tests, 16 suites, 0 failures. ModelDownloadResourceSpec exercises the presign round-trip against a Testcontainers LakeFS + MinIO, so the /models/… prefix is verified end-to-end through FileResolver, not just in a unit test.
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5)