Skip to content

feat(frontend): add model file upload and version creation - #8078

Merged
aicam merged 6 commits into
apache:mainfrom
tanishqgandhi1908:feat/model-upload-and-versions
Aug 31, 2026
Merged

aicam merged 6 commits into
apache:mainfrom
tanishqgandhi1908:feat/model-upload-and-versions

Conversation

@tanishqgandhi1908

@tanishqgandhi1908 tanishqgandhi1908 commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Models can now be uploaded to and versioned from the UI. PR 3 of the ML-model frontend series, on top of #8068 and #8072, both merged.

What you can do: upload files to a model, watch them upload, revert or delete staged changes, and commit them as a version. A new Settings tab edits the model's name, description, framework and format. Admin → Settings gains a Model card for the model upload limits.

1. Refactor — no behavior change. The dataset detail page owned the whole upload machinery. This pulls it out into resource-agnostic pieces, addressed by a FileResourceEndpoint descriptor (base path, name query param, and the four
site_settings keys):

  • service/user/file-resource/multipart-upload.service.ts — the ~280-line multipart engine, out of DatasetService
  • service/user/file-resource/staged-file.service.ts — diff, revert, delete
  • component/user/version-uploader/ — the whole "Create New Version" panel (file picker, progress panels, staged list, version box)
  • component/user/staged-objects-list/ — moved out of user-dataset/

2. Feature — models. MODEL_FILE_RESOURCE_ENDPOINT, ModelService version/framework/format calls, the model page's upload panel and Settings tab, and the Admin Model upload card.

Two bugs fixed along the way.

  • Renaming a model while an upload was in flight stranded it. The upload engine captures the resource name when the upload starts, so the remaining part and finish calls kept addressing the old name, and the abort — which reads the name at click time — 404'd as well. The Settings tab now blocks a rename until the panel is idle.
  • Renaming a model left its file tree pointing at the old name. File paths embed the resource name and both preview and single-file download resolve by that path, so every file 404'd until the page was reloaded. The Model Card's "Latest version file" went stale the same way. Renaming now refreshes both and reopens the file you were reading rather than resetting to the version's first. The dataset page has the same bug; it is deliberately left alone here so this PR changes no dataset behavior, and is queued with three other pre-existing dataset fixes for one cleanup PR at the end of the series.

Deliberately not here: Access & visibility (public/private, downloadable) lands in PR 4 — both can be set when creating a model, just not changed afterwards yet. Delete stays on the Models list card. View and like counts stay static 0 until models reach the hub in PR 5.

Screenshot 2026-08-28 at 1 49 22 PM Screenshot 2026-08-28 at 1 49 31 PM Screenshot 2026-08-28 at 1 55 54 PM

Any related issues, documentation, discussions?

Closes #6499.

Follows #8068 (Models page) and #8072 (model detail page), both merged. Does not touch unified search, so it does not depend on #7930.

How was this PR tested?

532 tests pass across the thirteen affected specs, including 72 in the new version-uploader.component.spec.ts.

Every dataset upload test still exists — they moved to the component that now owns that code rather than being deleted. That includes the three loadUploadSettings fallback tests, which pin the invariant the code comments warn about: a failed or unparsable settings fetch must leave the tuning fields alone, because a NaN concurrency limit stalls the queue outright (activeUploads < NaN is never true). Two ngOnInit assertions changed: the dataset page no longer fetches upload tuning itself, so it no longer calls
getPublicSetting on load; the panel does, when it renders. No dataset behavior changed.

New coverage: the model endpoint and its own settings keys, version creation, framework/format editing with rollback on failure, and the Admin upload cards run against both resource families so one cannot write the other's keys.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5)

@github-actions github-actions Bot added feature frontend Changes related to the frontend GUI labels Aug 28, 2026
@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @kunwp1, @xuang7, @mengw15
    You can notify them by mentioning @kunwp1, @xuang7, @mengw15 in a comment.

@codecov-commenter

codecov-commenter commented Aug 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.30792% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.74%. Comparing base (b59c740) to head (22ac69f).
⚠️ Report is 28 commits behind head on main.

Files with missing lines Patch % Lines
...odel/user-model-explorer/model-detail.component.ts 81.25% 13 Missing and 5 partials ⚠️
...el/user-model-explorer/model-detail.component.html 91.37% 5 Missing ⚠️
...onent/admin/settings/admin-settings.component.html 77.77% 2 Missing ⚠️
...ser/version-uploader/version-uploader.component.ts 98.91% 0 Missing and 2 partials ⚠️
...ice/user/file-resource/multipart-upload.service.ts 98.33% 0 Missing and 2 partials ⚠️
...ser/file-resource/testing/fake-xml-http-request.ts 92.30% 0 Missing and 2 partials ⚠️
...ser-dataset-explorer/dataset-detail.component.html 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8078      +/-   ##
============================================
+ Coverage     93.52%   93.74%   +0.22%     
+ Complexity     4709     4707       -2     
============================================
  Files          1195     1191       -4     
  Lines         48466    48255     -211     
  Branches       5378     5376       -2     
============================================
- Hits          45326    45237      -89     
+ Misses         1694     1588     -106     
+ Partials       1446     1430      -16     
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from 5db68f6
agent-service 99.32% <ø> (ø) Carriedforward from 5db68f6
amber 89.57% <ø> (-0.02%) ⬇️ Carriedforward from 5db68f6
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from 5db68f6
config-service 86.86% <ø> (ø) Carriedforward from 5db68f6
file-service 87.91% <ø> (ø) Carriedforward from 5db68f6
frontend 96.41% <95.30%> (+0.54%) ⬆️
notebook-migration-service 79.31% <ø> (ø) Carriedforward from 5db68f6
pyamber 98.54% <ø> (ø) Carriedforward from 5db68f6
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from 5db68f6

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tanishqgandhi1908
tanishqgandhi1908 force-pushed the feat/model-upload-and-versions branch from 0564f23 to fb2ad19 Compare August 28, 2026 23:10
tanishqgandhi1908 and others added 3 commits August 28, 2026 16:31
…ection

The card describes the newest version whatever the version picker shows, but
its file name and size were written inside onVersionSelected, guarded on the
selected version happening to be versions[0]. Renaming while browsing an older
version therefore left "Latest version file" on a path built from the old name.

Fetch those facts in their own right instead, mirroring the dataset page's
retrieveLatestVersionFile, and refresh them alongside the tree after a rename.
Using retrieveModelVersionList would also have fixed the display, but it resets
the picker to the newest version, which is not something a rename should do.

Co-Authored-By: Claude Opus 5 <[email protected]>
- Drop the invented .progress-header flex rule. The class is unstyled on main,
  so adding it silently changed the dataset upload row's layout, against this
  PR's claim of leaving dataset behavior alone.
- Stop listing the newest version's objects twice on every model page load.
  onVersionSelected already fetches that tree whenever the newest version is
  the one on screen, so the card now reuses that response and the extra fetch
  runs only when the two differ — after a rename while browsing an older one.
- Reword the conflicting-file modal, which said "in this dataset" and is now
  shown to model owners too.
- Remove a duplicate VersionUploaderComponent import and a comment orphaned
  when its rule moved to the shared panel.

Co-Authored-By: Claude Opus 5 <[email protected]>
… rename

- Port the three loadUploadSettings fallback tests that were dropped when the
  panel moved out of DatasetDetailComponent. They pin the invariant the code
  comment warns about: a failed or unparsable settings fetch must leave the
  fields alone, because a NaN concurrency limit stalls the queue outright
  (`activeUploads < NaN` is never true).
- Renaming a model reopens the file that was on screen instead of resetting to
  the version's first. Only the paths change, so the file is still there.
- Derive the admin upload card's title from FileResourceEndpoint.label, so a
  resource family is named once rather than in two places that could drift.

Co-Authored-By: Claude Opus 5 <[email protected]>
@aicam
aicam self-requested a review August 31, 2026 03:02

@aicam aicam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aicam
aicam enabled auto-merge August 31, 2026 03:03
The upload engine captures the resource name when an upload starts, so renaming
mid-flight leaves the remaining part and finish calls addressed to a model that
no longer answers to that name. Aborting cannot rescue it either: the abort
reads the name at click time, i.e. the new one, so it 404s too and the multipart
session is left for the retry loop to grind through.

The panel now reports whether anything is in flight and the Settings tab
disables the name field until it is idle, with onSaveModelName guarding the same
invariant. The dataset page has the same bug and is left alone here, queued with
the other pre-existing dataset fixes.

Co-Authored-By: Claude Opus 5 <[email protected]>
auto-merge was automatically disabled August 31, 2026 03:16

Head branch was pushed to by a user without write access

@aicam
aicam added this pull request to the merge queue Aug 31, 2026
Merged via the queue into apache:main with commit 50321e4 Aug 31, 2026
26 checks passed
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Oct 5, 2026
)

### What changes were proposed in this PR?

Removes dead code from `DatasetDetailComponent` that its template
stopped using during the dataset page's redesigns. **+2/−46 lines.**
There is no behaviour change.

- **Members:** `versionCreatorBaseVersion`, `displayPreciseViewCount` +
`changeViewDisplayStyle()`, and the `formatTime` / `formatSpeed`
aliases. The `format.util` import narrows to `formatCount`.
- **Styles:** `.tag-settings-btn`, `.tag-settings-title`,
`.tag-settings-row` (with its `span` and `::ng-deep .ant-switch` rules),
and `.description-section`.
- **Spec:** the "view flags" case keeps its maximize / right-bar
assertions and drops the three for the removed toggle. It is renamed to
match.

### History

| | |
| --- | --- |
| **Introduced by** | apache#2413 (2024-02-26), "Introduce Dataset GUI":
`versionCreatorBaseVersion`. apache#3269 (2025-02-19): the precise-view-count
toggle. apache#3662 (2025-08-19): the speed/time aliases. apache#4337 (2026-03-29),
"improve dataset detail page layout": the `.tag-settings-*` and
`.description-section` styles |
| **Usage removed by** | apache#3296 (2025-03-10):
`versionCreatorBaseVersion`. apache#4337 (2026-03-29): the view-count toggle.
apache#6493 (2026-07-27): tag settings moved to a Settings tab. apache#7043
(2026-07-30): the description moved to the Data Card tab. apache#8078
(2026-08-31): the speed/time aliases |

Each piece was left behind by a redesign that moved its markup
elsewhere. The oldest has been dead for eighteen months.

### Any related issues, documentation, discussions?

Closes apache#8745

### How was this PR tested?

No new tests. The kept spec cases cover the remaining members.

From `frontend/`:

- `npx ng test --watch=false
--include='**/dataset-detail.component.spec.ts'`: 150 tests, all pass.
- `yarn format:ci`: clean.
- `npx ng build`: success.

To re-check:

```
git grep -n -E "versionCreatorBaseVersion|tag-settings|description-section" -- frontend   # no hits
```

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Nov 26, 2026
### What changes were proposed in this PR?

Remove redundant code from the frontend, the licensing scripts, two
Scala sources and the agent service (**+26/−41 lines**). There is no
behavior change.

- **Dataset and model detail pages:** each `route.params` emission was
switched to `this.route.data`, and the empty `.subscribe()` threw away
what that emitted. The pages now `tap` the params, so the same fetches
run in the same order without the extra subscription. The dataset page's
`THROTTLE_TIME_MS` also becomes file-local: `workspace.component.ts` and
the hub spec import the copy in `hub-workflow-detail.component.ts`,
never this one.
- **Version uploader:** the abort handler's 404 branch called `done()`
and returned, which is what the handler already does for every error it
does not retry. Its three constants become file-local: nothing imported
`FINISHED_TASK_HIDE_DELAY_MS`, and only the spec imported the other two.
The spec now states the retry policy it expects.
- **Computing-unit actions:** `confirmAndTerminate` reads
`unit.computingUnit.uri` and `unit.computingUnit.name` before
`unit?.computingUnit.type`, so the `?.` goes.
- **Loop blocks:** `LOOP_END_OP_TYPE` becomes file-local. Only its spec
imported it, and the spec now checks the backend's `"LoopEnd"` name
directly.
- **Agent interaction:** two imports from `agent.service` become one.
- **Licensing scripts:** `audit_jar_licenses.py` stored each group's
notice hash in a field that nothing reads, and the NOTICE test helper
`make_jar` had an `extra` parameter that no caller passes.
- **`PveResource`:** drops `import javax.ws.rs.DELETE` and `import
javax.ws.rs.PathParam`, which `import javax.ws.rs._` already covers.
- **`SQLSourceOpExec` and `AsterixDBSourceOpExec`:** five fallback arms
list `BOOLEAN`, `STRING` and `ANY` before a trailing `_`, as in `case
AttributeType.BOOLEAN | AttributeType.STRING | AttributeType.ANY | _`.
The `_` matches those types as well, so each becomes `case _`.
- **`agent-service/.dockerignore`:** Docker reads the ignore file at the
root of the build context. CI's image matrix
(`build-and-push-images.yml`) and `bin/build-images.sh` both use the
repository root as the context, and the agent Dockerfile copies
`agent-service/...` paths from there, so the root `.dockerignore`
applies and this file is never read.

| Event | PR / Commit |
| --- | --- |
| Introduced by | Dataset and model detail: apache#2413 (2024-02-26), apache#3269
(2025-02-19), apache#8072 (2026-08-28); version uploader: apache#4136 (2026-01-05),
moved by apache#8078 (2026-08-31); computing-unit actions: apache#4331 (2026-04-09);
loop blocks: apache#8640 (2026-10-24); agent interaction: apache#6009 (2026-11-13);
licensing scripts: apache#4387 (2026-04-29), apache#5417 (2026-06-10);
`PveResource`: apache#5035 (2026-05-13); `SQLSourceOpExec`: apache#1013
(2021-02-11); `AsterixDBSourceOpExec`: apache#1044 (2021-02-25);
`agent-service/.dockerignore`: apache#4495 (2026-04-28) |
| Usage removed by | `agent-service/.dockerignore`: apache#4544 (2026-05-01)
added the agent image's Dockerfile with paths from the repository root,
so no build has read the file. Everything else: unused or redundant
since introduction. |

As of 2026-11-25:
- The SQL sources' fallback arms have listed redundant types for over 5
years.
- The dataset page's discarded subscription is almost 3 years old.
- The version uploader's 404 branch has been redundant for over 10
months.
- `agent-service/.dockerignore` has gone unread for almost 7 months.
- The duplicate agent import is 12 days old.

### Any related issues, documentation, discussions?

Closes apache#9691.

### How was this PR tested?

Ran on this branch and on `main` at `afc2b3db7a` (Windows 11; Node 24
with Yarn 4.14.1; Python 3.12 with pytest 9.0.3 and CI's pinned `ruff`
0.14.7; JDK 17):

```bash
cd frontend
npx ng test --watch=false --include='**/dataset-detail.component.spec.ts' --include='**/model-detail.component.spec.ts' --include='**/version-uploader.component.spec.ts' --include='**/computing-unit-actions.service.spec.ts' --include='**/loop-block.util.spec.ts' --include='**/agent-interaction.component.spec.ts'
npx tsc --noEmit -p src/tsconfig.app.json
npx tsc --noEmit -p src/tsconfig.spec.json
yarn prettier-eslint --list-different $(git diff --name-only --relative origin/main -- src)
yarn eslint $(git diff --name-only --relative origin/main -- src)
cd ..
pytest bin/licensing
ruff check bin/licensing/audit_jar_licenses.py bin/licensing/test_generate_notice_binary.py
python bin/licensing/audit_jar_licenses.py <directory of 60 jars>
sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.source.sql.*" "WorkflowExecutionService/testOnly org.apache.texera.web.resource.pythonvirtualenvironment.*" WorkflowOperator/scalafmtCheckAll WorkflowExecutionService/scalafmtCheckAll "WorkflowOperator/scalafixAll --check" "WorkflowExecutionService/scalafixAll --check"
```

- **Frontend:** the six specs run 379 tests, all passing on both sides.
Both typechecks, prettier-eslint and ESLint pass.
- **Python:** the licensing tests run 53 tests and 5 subtests, all
passing on both sides, and Ruff passes. `audit_jar_licenses.py` prints
the same report on both sides for 60 jars from the local Coursier cache.
- **Scala:**
  - The 11 `source.sql` suites run 204 tests, all passing on both sides.
- The two PVE resource suites run 75 tests on both sides: 74 pass and 1
is canceled. The canceled test needs a file that is not executable,
which this Windows filesystem cannot represent.
  - scalafmt and scalafix pass on both modules.
- **`agent-service/.dockerignore`:** no image was built. The build
context comes from `context="."` for every
`bin/dockerfiles/*.dockerfile` in `build-and-push-images.yml`, and from
the `..` that `bin/build-images.sh` passes from `bin/`.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Nov 27, 2026
### What changes were proposed in this PR?

Remove code that nothing uses from the dataset service, the dataset file
uploader, the Hub component and service, and the canvas glyph service
(**+154/−578 lines**). There is no behavior change.

- **`DatasetService`:** four dead pieces go.
- Six forwarders: `multipartUpload`, `listMultipartUploads`,
`findExistingUploadFiles` and `finalizeMultipartUpload` only call
`MultipartUploadService`, and `resetDatasetFileDiff` and
`getDatasetDiff` only call `StagedFileService`. apache#8078 moved every caller
to those services and kept the forwarders "so existing callers are
untouched"; only specs still called or stubbed them.
- The `GuiConfigService` and `MultipartUploadService` constructor
dependencies that the forwarders and nothing else used.
- The re-exported `MultipartUploadProgress` type, which nothing imports
from here.
- URL constants that nothing outside the service imports. The base paths
become file-local, and the ones used once are written at their call
site.
- **Specs:**
- The dataset spec's 15 cases that tested the upload and staging
services through the forwarders go. `multipart-upload.service.spec.ts`
and `staged-file.service.spec.ts` already cover 12 of them.
- The other three move to `multipart-upload.service.spec.ts`: progress
smoothing, the ETA clamp, and the 0% failure for an empty file. They
account for 84 of the added lines.
- The clamp case now stalls at 10 of 100 bytes. At 50, the clamped and
unclamped ETAs both rounded to 3 s, so it passed with any bound.
- The dataset spec's HTTP cases state the URLs they expect, and the
dataset-detail spec drops its stubs of the removed forwarders.
- **`FilesUploaderComponent`:** the `newUploadFileTreeNodes` field and
its import, unused since apache#3296.
- **Hub:** `HubComponent`'s `isLogin` input and `GuiConfigService`
injection are never read. The dashboard stops passing `isLogin`, and
keeps its own login state. `ActionType.Unlike` has no user; `postUnlike`
keeps its literal endpoint.
- **`JointUIService`:**
- Sixteen constants that nothing imports become file-local: eleven glyph
constants and five CSS class names. Their values are unchanged.
- The `DEFAULT_GROUP_MARGIN` and `DEFAULT_GROUP_MARGIN_BOTTOM` statics
go. apache#3033 removed operator groups, their last reader.
- The attribute blocks for the abbreviated, processed and output count
labels go. apache#3558 removed those labels from the markup.

| Event | PR / Commit |
| --- | --- |
| Introduced by | Forwarders and the re-exported type: apache#8078
(2026-08-31); uploader field: apache#2719 (2024-07-23);
`HubComponent.isLogin`: apache#2725 (2024-09-24); `ActionType.Unlike`: apache#3442
(2025-06-28); group margins: apache#754 (2020-12-11); count-label attributes:
apache#1374 (2021-11-23) and apache#3477 (2025-07-08) |
| Usage removed by | Uploader field: apache#3296 (2025-03-11). Group margins:
apache#3033 (2024-11-13). Count-label attributes: apache#3558 (2025-07-11).
Everything else: unused since introduction. |

As of 2026-11-26:
- `HubComponent.isLogin` and the group margins have gone unread for over
2 years.
- The uploader field has been unused for over a year and a half, and the
count-label attributes for over a year.
- `ActionType.Unlike` has been unused for almost a year and a half.
- The forwarders have had no caller in the almost 3 months they have
existed.

### Any related issues, documentation, discussions?

Closes apache#9719.

### How was this PR tested?

Ran on this branch and on `main` at `927379aa28` (Windows 11; Node 24
with Yarn 4.14.1):

```bash
cd frontend
npx ng test --watch=false --include='**/dataset.service.spec.ts' --include='**/dataset-detail.component.spec.ts' --include='**/files-uploader.component.spec.ts' --include='**/hub.component.spec.ts' --include='**/dashboard.component.spec.ts' --include='**/hub.service.spec.ts' --include='**/joint-ui.service.spec.ts' --include='**/multipart-upload.service.spec.ts'
npx tsc --noEmit -p src/tsconfig.app.json
npx tsc --noEmit -p src/tsconfig.spec.json
npx ngc -p src/tsconfig.app.json --noEmit
yarn prettier-eslint --list-different $(git diff --name-only --relative origin/main -- src)
yarn eslint $(git diff --name-only --relative origin/main -- src | grep -E '\.(ts|html)$')
```

- **Specs:** the eight specs run 357 tests on this branch and 371 on
`main`, all passing.
- The branch drops the dataset spec's 15 forwarder cases and runs 3 of
them in the multipart spec.
- It also drops the Hub component's `isLogin` and `GuiConfigService`
checks, and renames one Hub case for the dropped input.
  - Every other test keeps its name and outcome.
- **Controls:** widening or narrowing the engine's 30% ETA bound fails
the moved clamp case (27 s or 20 s instead of 23 s). At 50 bytes, as on
`main`, the widened bound passed. Dropping the empty-file guard fails
the 0% case.
- **Checks:** both typechecks, the AOT compile (the dashboard template
changes), prettier-eslint and ESLint pass.

To re-check, this returns no hits on this branch and 19 on `main`:

```bash
git grep -nE "public (multipartUpload|listMultipartUploads|findExistingUploadFiles|finalizeMultipartUpload|resetDatasetFileDiff|getDatasetDiff)\(|newUploadFileTreeNodes|Unlike = |texera-operator-(abbreviated|processed|output)-count|private config: GuiConfigService|DEFAULT_GROUP_MARGIN|export const operator(ReuseCacheText|ReuseCacheIcon|ViewResultIcon|Icon|FriendlyName)Class" -- frontend/src/app/dashboard/service/user/dataset frontend/src/app/dashboard/component/user/files-uploader frontend/src/app/hub frontend/src/app/workspace/service/joint-ui
```

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add model management UI

3 participants