tanishqgandhi1908 opened a new pull request, #7074:
URL: https://github.com/apache/texera/pull/7074

   
   ### 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/[email protected]/resnet/v1/weights/model.pt     ← what a model tree 
returns today
   /models/[email protected]/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)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to