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

   ### What changes were proposed in this PR?
   
   #6869 and #6872 gave models create/list/access/version-upload. This PR adds 
the remaining read and staged-change endpoints, so the model management UI can 
be built as frontend-only work.
   
   Nine endpoints on `ModelResource`:
   
   | Endpoint | Purpose |
   | --- | --- |
   | `GET /model/presign-download` (+ `-s3`, and `public-` variants of both) | 
signed URL for one file — preview, and how a worker reads a model |
   | `GET /model/{mid}/diff` | list staged (uncommitted) changes |
   | `PUT /model/{mid}/diff?filePath=` | discard one staged change |
   | `POST /model/{mid}/existing-upload-files` | which files the repo already 
holds at the same size, so the client can skip re-uploading large weights |
   | `GET /model/{mid}/versionZip?mvid=\|latest=true` | download a whole 
version |
   | `GET /model/user-model-owners` | owner facet for the list page |
   
   None of it is a second copy of `DatasetResource`. Each piece moved into 
`ResourceUploadService`/`ResourceAccess` parameterised by `ResourceStorage`, 
and the dataset endpoints now call the same code: `DatasetResource` **−285 
lines**, shared layer +226, `ModelResource` +233. Nine new endpoints for a net 
reduction in production code.
   
   Also fixes `listModels` reporting `size = 0` for models reached by grant 
while computing it for public ones.
   
   `framework` and `format` are now validated against a known set (400 
otherwise) so a loader can dispatch on the value. They stay metadata only — a 
model is a folder, and no per-file extension check is applied.
   
   ### Any related issues, documentation, discussions?
   
   - Closes #6498
   - Part of #6494
   - Replaces #6974, which could not be reopened after the branch was rebuilt 
on the current stack
   - Stacked on #6872; base is `main`, so the diff shows the parent PRs' 
commits until they merge
   
   ### How was this PR tested?
   
   New `ModelApiForUiSpec` and `ModelDownloadResourceSpec` cover every 
endpoint, including negative cases (no access, private model anonymous, `mvid` 
and `latest` both/neither). The presign tests fetch the URL and compare bytes 
end to end through MinIO.
   
   ```
   sbt "FileService/test"     # 376/376
   sbt "WorkflowCore/test"    # 787/787
   sbt scalafmtCheckAll "scalafixAll --check"
   ```
   
   ### 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