Skip to content

feat(frontend): add the create-model modal - #7144

Draft
tanishqgandhi1908 wants to merge 30 commits into
apache:mainfrom
tanishqgandhi1908:feat/model-ui-create
Draft

feat(frontend): add the create-model modal#7144
tanishqgandhi1908 wants to merge 30 commits into
apache:mainfrom
tanishqgandhi1908:feat/model-ui-create

Conversation

@tanishqgandhi1908

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Adds a "Create Model" button to the Models page and the modal behind it, so creating a model no longer requires curl. The form takes name, description, framework and format dropdowns, and visibility/downloadable toggles; on success it navigates to the new model's detail page.

This is the first of two PRs covering model creation and upload. It deliberately ships create only — after this you can create a model and manage its metadata (rename, description, visibility, sharing, delete), but not yet upload weights to it. The upload half follows in the next PR.

Any related issues, documentation, discussions?

Part of #6499 (Add model management UI). Umbrella: #6494.

Stacked on the multipart-engine refactor PR.

How was this PR tested?

New user-model-creator.component.spec.ts — 10 cases. Three cover sanitizeModelName directly, including one that pins the underscore difference from the dataset sanitizer. The rest cover the component: the four fields render with no version-description field; the framework and format dropdown options equal MODEL_FRAMEWORKS and MODEL_FORMATS exactly, so drift from ModelResource's whitelist fails at test time rather than becoming a 400 at create time; an empty required name calls nothing; a successful create sends the sanitized name plus both toggle values and closes with the result; a sanitized name reports the rename in the toast; a server error surfaces its message, closes with null, and clears the spinner; and cancel closes without touching the backend.

user-model.component.spec.ts gains 3 cases for the button wiring — the modal opens with the right component and no footer, a non-null close navigates to USER_MODEL/:mid, and a dismissal navigates nowhere.

103 tests pass across the 6 affected spec files. The dataset creator's own spec and user-dataset.component.spec.ts pass untouched. tsc --noEmit, eslint and prettier are clean.

cd frontend && npx ng test --watch=false --include src/app/dashboard/component/user/user-model/user-model-creator/user-model-creator.component.spec.ts

Manually verified with gui.tabs.models_enabled = true: creating a model lands on its detail page; My Model!! is sanitized to my-model with the rename reported in the toast; churn_predictor keeps its underscore; a duplicate name surfaces the server error; cancel creates nothing.

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

Generated-by: Claude Code (Claude Opus 5)

aicam and others added 30 commits July 1, 2026 13:57
… 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>
…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>
@github-actions github-actions Bot added feature engine ddl-change Changes to the TexeraDB DDL pyamber frontend Changes related to the frontend GUI infra common platform Non-amber Scala service paths labels Jul 30, 2026
@github-actions

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: @aglinxinyuan, @Yicong-Huang, @Ma77Ball
    You can notify them by mentioning @aglinxinyuan, @Yicong-Huang, @Ma77Ball in a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common ddl-change Changes to the TexeraDB DDL engine feature frontend Changes related to the frontend GUI infra platform Non-amber Scala service paths pyamber

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants