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

   ### What changes were proposed in this PR?
   
   Adds the metadata + access-control half of the model management API. Model 
version upload and PyTorch
   file validation follow in a separate PR.
   
   - **Schema:** `model_user_access` table in `texera_ddl.sql` + idempotent 
migration `sql/updates/31.sql` (changeSet 31).
   
   - **`ModelResource`** (`@Path("/model")`)
   
   | Method | Path | Description |
   |---|---|---|
   | POST | `/create` | Create a model; provisions LakeFS repo `model-{mid}`, 
rolls the DB row back if repo init fails, grants the owner `WRITE`. Stores 
`framework` (defaults `pytorch`) and `format`. |
   | DELETE | `/{mid}` | Delete a model (owner-only): removes the LakeFS repo, 
the S3 directory, and the row. |
   | POST | `/update/name` | Rename (write access; validates name; rejects 
duplicate). |
   | POST | `/update/description` | Update description (write access). |
   | POST | `/{mid}/update/publicity` | Toggle `is_public` (write access). |
   | POST | `/{mid}/update/downloadable` | Toggle `is_downloadable` 
(owner-only). |
   | GET | `/list` | Models the user can access, plus public models. |
   | GET | `/{mid}` | Get a model the user can read. |
   | GET | `/public/{mid}` | Get a public model (unauthenticated). |
   
   **`ModelAccessResource`** (`@Path("/access/model")`) — `owner/{mid}`, 
`list/{mid}`, `grant/{mid}/{email}/{privilege}`, `revoke/{mid}/{email}` (all 
write-access-guarded), backed by `model_user_access`.
   - Both registered in `FileService`; storage/util layer reused unchanged.
   
   Stacked on #6860 (#6497) → #6502 (#6495); its diff shows their commits until 
they
   merge.
   
   ### Any related issues, documentation, discussions?
   
   Part of #6498, umbrella #6494.
   
   ### How was this PR tested?
   
   New tests: `ModelResourceSpec` (22 — create/get/list/delete/update/toggle, 
incl. access filtering, duplicate-name and forbidden paths, LakeFS-404 → 404) 
and `ModelAccessResourceSpec` (28 — privilege helpers + grant/list/revoke). 
Run: `sbt "FileService/testOnly *ModelResourceSpec *ModelAccessResourceSpec"` — 
all green; `scalafixAll` + `scalafmtAll` clean.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 4.8)


-- 
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