Repository navigation
feat(frontend, amber): add models to the hub and unified search - #7930
Conversation
Automated Reviewer SuggestionsBased on the
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7930 +/- ##
============================================
- Coverage 94.07% 94.06% -0.02%
- Complexity 4809 4812 +3
============================================
Files 1194 1196 +2
Lines 48597 48713 +116
Branches 5857 5866 +9
============================================
+ Hits 45718 45821 +103
- Misses 1428 1437 +9
- Partials 1451 1455 +4
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 406 | 0.248 | 24,021/30,119/30,119 us | 🟢 -23.3% / 🔴 +89.4% |
| ⚪ | bs=100 sw=10 sl=64 | 924 | 0.564 | 105,661/151,497/151,497 us | ⚪ within ±5% / 🔴 +36.9% |
| 🔴 | bs=1000 sw=10 sl=64 | 1,085 | 0.662 | 916,858/1,060,370/1,060,370 us | 🔴 +8.8% / 🟢 -9.4% |
Baseline details
Latest main 8aea604 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 406 tuples/sec | 427 tuples/sec | 750.65 tuples/sec | -4.9% | -45.9% |
| bs=10 sw=10 sl=64 | MB/s | 0.248 MB/s | 0.26 MB/s | 0.458 MB/s | -4.6% | -45.9% |
| bs=10 sw=10 sl=64 | p50 | 24,021 us | 22,182 us | 13,049 us | +8.3% | +84.1% |
| bs=10 sw=10 sl=64 | p95 | 30,119 us | 39,263 us | 15,902 us | -23.3% | +89.4% |
| bs=10 sw=10 sl=64 | p99 | 30,119 us | 39,263 us | 19,184 us | -23.3% | +57.0% |
| bs=100 sw=10 sl=64 | throughput | 924 tuples/sec | 936 tuples/sec | 960.3 tuples/sec | -1.3% | -3.8% |
| bs=100 sw=10 sl=64 | MB/s | 0.564 MB/s | 0.571 MB/s | 0.586 MB/s | -1.2% | -3.8% |
| bs=100 sw=10 sl=64 | p50 | 105,661 us | 104,242 us | 104,199 us | +1.4% | +1.4% |
| bs=100 sw=10 sl=64 | p95 | 151,497 us | 154,647 us | 110,645 us | -2.0% | +36.9% |
| bs=100 sw=10 sl=64 | p99 | 151,497 us | 154,647 us | 120,888 us | -2.0% | +25.3% |
| bs=1000 sw=10 sl=64 | throughput | 1,085 tuples/sec | 1,113 tuples/sec | 993.27 tuples/sec | -2.5% | +9.2% |
| bs=1000 sw=10 sl=64 | MB/s | 0.662 MB/s | 0.679 MB/s | 0.606 MB/s | -2.5% | +9.2% |
| bs=1000 sw=10 sl=64 | p50 | 916,858 us | 892,499 us | 1,012,191 us | +2.7% | -9.4% |
| bs=1000 sw=10 sl=64 | p95 | 1,060,370 us | 974,950 us | 1,054,057 us | +8.8% | +0.6% |
| bs=1000 sw=10 sl=64 | p99 | 1,060,370 us | 974,950 us | 1,081,313 us | +8.8% | -1.9% |
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,492.44,200,128000,406,0.248,24021.03,30119.10,30119.10
1,100,10,64,20,2164.24,2000,1280000,924,0.564,105660.69,151496.70,151496.70
2,1000,10,64,20,18435.87,20000,12800000,1085,0.662,916857.85,1060369.65,1060369.65Models had metadata and access APIs but no discovery: they were absent from the hub's counts, likes, views, tops and user-access endpoints, and from unified search. Adding the entity type is one registry entry plus one descriptor, since the hub and the search layer are now resource-agnostic. New schema carries the engagement tables and the full-text index: model_user_likes, model_view_count, and model in the PGroonga block. texera_ddl.sql only builds that index for a fresh database, so the migration creates it too. ModelSearchQueryBuilder is a projection over the shared query logic, adding framework and format to the union; every other slot is shared with the other versioned resources. getTops needed no change at all -- the descriptor path picks models up on its own. Model search matches on name and description, so the indexed expression is identical to the predicate the builder renders. framework and format are projected for display but not indexed.
805c251 to
bd1f962
Compare
|
/request-review @aicam |
aicam
left a comment
There was a problem hiding this comment.
This PR enables search for models and cause global search also show models. Although we don't have models but to prevent unexpected behavior, lets merge this after frontend fully merged.
apache#7937) ### What changes were proposed in this PR? apache#7922 gave models the file API the management UI needs. This PR adds the last backend pieces, so model sharing and the hub can be built as frontend-only work. **Cover images** — `POST /{mid}/update/cover`, `GET /{mid}/cover` (307 redirect), `GET /{mid}/cover-url` (JSON, since `<img src>` cannot attach the Authorization header on a private model). The `cover_image` column already existed. The resource-agnostic halves move into a shared `CoverImageUtils` and `DatasetResource` is refactored onto it, net **−55 lines** there. The image extension allowlist is a security control, not a convention — a cover is handed to the browser as a presigned URL, so an active document (`.svg`, `.html`) would be a stored-XSS vector, and a duplicated allowlist drifts. A cover path is validated to be `<version>/<file>` and opened defensively. `FileResolver` needs five path segments and throws an `IOException` that file-service registers no mapper for, so a bare file name or a deleted version would otherwise surface as an opaque 500 — and on the read path, one bad write would 500 every render of every card showing that resource. The write path answers 400; the reads treat an unresolvable cover as absent (`{"url": null}` / 404) so the card falls back to its default. **Anonymous version browsing** — `/{mid}/publicVersion/list` and `/{mid}/publicVersion/{mvid}/rootFileNodes`. Without these a logged-out visitor on a public model page gets metadata and then an error. **Framework/format editing** — `POST /update/framework`, `POST /update/format`, plus `other` in both whitelists. The labels were create-only, so a mislabelled model had to be recreated. Both endpoints share `normalizeLabel` with `createModel`, so the edit path cannot reject a value the create path accepted: blank resets the framework to the default and clears the format, and values are trimmed the same way in both. **Routing** — `/api/model` and `/api/access/model` in nginx, the k8s gateway and the frontend dev proxy. Nothing reaches the resource in a real deployment without them. The nginx location carries a trailing slash for symmetry with `/api/access/dataset/`; the LLM `/api/models` route is an exact-match location, which outranks any prefix location, so the two are unambiguous either way. One behavior change on the dataset side: covers now get a path-length check. `dataset.cover_image` is `varchar(246)` via `sql/updates/18.sql`, so an over-long path was a jOOQ-wrapped 500 and is now a 400. The dataset cover endpoints also pick up the unresolvable-path handling above, which they lacked before this branch. ### Any related issues, documentation, discussions? - Part of apache#6501 - **Reviewable on its own.** apache#7922 has merged and `main` has been merged in, so the diff is this PR's work alone. No migration, no schema change. - Independent of apache#7930 (models in the hub and unified search). That PR is amber-side — the dashboard search builders, `EntityTables`/`EntityType`, and `sql/42.sql`; the `ModelResource` it touches is the amber dashboard one, not file-service's. Neither PR calls the other, and this branch compiles and passes its tests on `main` with none of apache#7930 present. They can merge in either order; whichever lands second will hit a one-line conflict in `ModelResourcePermissionsSpec`'s `publicEndpointMethods` set. ### How was this PR tested? New `CoverImageUtilsSpec` pins the allowlist, `.svg`/`.html` rejection, path traversal, absolute paths, the `<version>/<file>` shape and both column-width limits. New `ModelHubApiSpec` drives the covers end to end through LakeFS/MinIO and covers anonymous browsing, including the negative cases: private model anonymous and no-grant, unknown model and version id, a model unpublished after the fact, a bare filename and a nonexistent version rejected at write, a stored cover that stops resolving, and agreement between the public and authenticated file-tree endpoints. `ModelApiForUiSpec` covers the framework/format updates, including trimming, blank-resets-framework and blank-clears-format. `ModelResourcePermissionsSpec` needed the four new `@PermitAll` endpoint names — the guardrail caught them, as intended. The dataset suites pass unmodified, which is what confirms the shared `CoverImageUtils` did not shift dataset behavior. 300 tests across the eight affected suites: sbt "FileService/testOnly *CoverImageUtilsSpec *ModelHubApiSpec *ModelApiForUiSpec *ModelResourcePermissionsSpec *ModelResourceSpec *DatasetResourceSpec *DatasetResourcePermissionsSpec *DatasetAccessResourceSpec" sbt scalafmtCheckAll "scalafixAll --check" ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5) --------- Co-authored-by: ali <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]>
### What changes were proposed in this PR? **Refactor.** `user-dataset-file-renderer`'s `did`/`dvid` inputs become `resourceId`/`versionId`, so a model no longer has to smuggle its ids through dataset-shaped names. `download` moves onto the resource descriptor: `card-item` and `list-item` both carried a `workflow`/`dataset` branch, and both now ask `descriptor.download`. One deliberate behavior change: the branch read `entry.workflow.workflow.name`, which a rename leaves stale, so downloading a just-renamed workflow produced a zip named after the old name. It now reads `entry.name`. Covered by a test. **The model detail page.** A read-only page at `/user/model/:mid`: name, created-at, public/downloadable/framework/format tags, placeholder view and like counters, cover image; a Model Card tab; and a Versions & Files tab with the version picker, file tree, file preview, and single-file and version-ZIP downloads. `ModelService` gains the read endpoints, `DownloadService` the three model downloads, and `ModelResourceDescriptor` a `privateRoute` — so the cards added in apache#8068 now open something. The file renderer takes a `resourceType` input, but resolves its fetch through a new `retrieveSingleFile` descriptor slot rather than growing a `type === "model"` arm, which is the point of the registry. **No Settings tab yet, on purpose.** Metadata editing (name, description, framework, format) lands with upload in the next PR; visibility, sharing and covers in the one after. **View and like counters read a constant `0`, deliberately.** The hub backend has no model entity — `hub/EntityType.scala` is `Seq(Workflow, Dataset)` with a throwing `fromString`, `EntityTables.forType` matches only those two, and there are no `model_user_likes` / `model_view_count` tables, so every hub call from this page would 400. The tags are there so the header matches the dataset page; they get wired up in the hub PR, alongside apache#7930. <img width="807" height="647" alt="Screenshot 2026-08-28 at 11 19 16 AM" src="https://github.com/user-attachments/assets/a22ec4e3-eccc-4a5d-bcb5-3fc5147921f6" /> <img width="1210" height="602" alt="Screenshot 2026-08-28 at 11 18 45 AM" src="https://github.com/user-attachments/assets/eaabec50-7c93-4d36-aa67-11650e4500d7" /> <img width="1228" height="687" alt="Screenshot 2026-08-28 at 11 18 33 AM" src="https://github.com/user-attachments/assets/8974de85-9633-4439-8a4d-4dec0d03e129" /> ### Any related issues, documentation, discussions? Part of apache#6499. Depends on apache#8068. ### How was this PR tested? New: 26 specs for the detail page, 7 for the new `ModelService` methods, 3 for the model downloads, 2 for the renderer's model branch, plus registry coverage for `download` and `retrieveSingleFile`. The refactor's proof is that all 353 existing `user-dataset` specs pass unmodified. Four specs elsewhere needed scaffolding changes, none of them changed expectations: three `card-item` template tests set `entry` without running the input pipeline and now call `initializeEntry()` (a pattern already used in that file), and one `list-item` test moved from `(component as any).downloadService` to `TestBed.inject(DownloadService)`,since the component no longer injects it. Full dashboard and hub suite: 1880 tests, all passing. Verified manually against a local stack. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code
### 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 apache#8068 and apache#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. <img width="1202" height="703" alt="Screenshot 2026-08-28 at 1 49 22 PM" src="https://github.com/user-attachments/assets/ea601483-b68b-4d1e-ab49-5f3246e84211" /> <img width="1138" height="748" alt="Screenshot 2026-08-28 at 1 49 31 PM" src="https://github.com/user-attachments/assets/24240b49-acc3-4da9-9b3d-abfa3519cb04" /> <img width="1070" height="446" alt="Screenshot 2026-08-28 at 1 55 54 PM" src="https://github.com/user-attachments/assets/22c4cb19-1dda-4cff-98f6-72d35a57d585" /> ### Any related issues, documentation, discussions? Closes apache#6499. Follows apache#8068 (Models page) and apache#8072 (model detail page), both merged. Does not touch unified search, so it does not depend on apache#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) --------- Co-authored-by: Claude Opus 5 <[email protected]>
main took 42 for the dataset upload-limit prefix, so the model hub migration renumbers to 43; its content is unchanged.
|
@tanishqgandhi1908 since this PR adds model to backend, frontend should be able to parse it as well, otherwise we might get unexpected behavior. Please include frontend changes as well. |
…combined # Conflicts: # amber/src/main/scala/org/apache/texera/web/resource/dashboard/UnifiedResourceSchema.scala # amber/src/test/scala/org/apache/texera/web/resource/dashboard/UnifiedResourceSchemaSpec.scala # sql/changelog.xml
A stray blank line where initializeEntry was removed. The two comments explaining why routeFor uses find rather than get, and why it caches, went missing in the same edit and are restored with it.
Added frontend changes here in this PR. |
) ### What changes were proposed in this PR? **Root cause.** The dashboard search bar searches every resource kind (`type = null`). Since apache#7930 that query returns model rows too, and `SearchService.search` keeps them. `SearchBarComponent.convertToName` had no model branch, so a model row threw `Unexpected type in SearchResult.` inside the `switchMap` feeding the component's only search subscription. That subscription has no error handler, so the throw ended it and every later keystroke was dropped until reload. ``` Before: type "my" -> a model matches -> convertToName throws -> subscription closed type "wf" -> no request, no suggestions (rest of the session) After: type "my" -> "my-model" suggested a failed request -> no suggestions for that query, nothing cached -> type "wf" -> searches as normal ``` Two changes: 1. **One payload lookup.** `searchResultPayload(item)` in `search-result.ts` returns a row's workflow, dataset or model payload, or `undefined`. The `SearchService.search` filter, its hub enrichment and `convertToName` all read through it, so every row the filter keeps is one the search bar can name, model rows included. Before, the filter and `convertToName` each listed the kinds, and apache#7930 updated only the filter. 2. **Only the request is guarded.** Both HTTP interceptors rethrow, so a 5xx, a dropped connection or a 401 also ended the subscription. `getSearchResults` now catches errors from the request alone, as `FiltersComponent` does. A failed search clears the suggestions and caches nothing, so typing the same text again retries. A row `convertToName` cannot name is a bug, so it is not caught and still reaches the console. ### Any related issues, documentation, discussions? Closes apache#8700. ### How was this PR tested? Tests came first: on unchanged source the new search-bar cases failed, and `search-result.spec.ts` did not compile without `searchResultPayload`. All pass with the fix: | Case | Pins | | --- | --- | | `searchResultPayload` on a workflow, dataset or model row | returns that row's payload | | `searchResultPayload` on an unmodelled kind, or a `null` payload field | `undefined` | | `search` response with an unmodelled row and a row whose payload fields are all `null` | both dropped, the workflow row kept | | `convertToName` on a model-only row | returns the model's name | | model-only search response | the model's name is listed | | response with a row `convertToName` cannot name | the error reaches RxJS's unhandled-error hook instead of an empty dropdown | | failed request (HTTP 500) | that query lists nothing and is not cached; retrying the same query hits the server and lists results | Mutation check, each run against the three specs below and each caught: - moving the catch back below the naming step fails the unnameable-row case; - dropping the request catch, or `defaultIfEmpty`, fails the failed-request case; - dropping `?? undefined` from the helper fails the `null`-payload case; - a filter, `convertToName` or enrichment lookup that no longer covers models fails the model cases; - a filter that stops using the helper (an inline lookup, or a `resourceType` check) fails the funnel case. From `frontend/`: - `npx ng test --watch=false --include='**/search-bar.component.spec.ts' --include='**/dashboard/type/search-result.spec.ts' --include='**/dashboard/service/user/search.service.spec.ts'`: 36 passed. - `yarn --cwd frontend format:ci` (from the repo root): clean. - `node node_modules/typescript/bin/tsc -p src/tsconfig.spec.json --noEmit`, and the same with `src/tsconfig.app.json`: no errors. ### 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)
### What changes were proposed in this PR? Remove unused code from the Scala sources and tests of the Amber engine and web server, `workflow-core`, `workflow-operator`, `observability` and the notebook-migration service, and narrow the database reads of the account, notification, dashboard-search, Hub and Jupyter-registration lookups to the columns and rows they use (**+285/-316 lines**). Production behavior does not change. Two CSV tests that are named for multi-line data now read the multi-line file. **Unused code** - **Unused bindings:** pattern, `catch` and callback bindings that nothing reads become `_` in `ClusterListener`, `DeadLetterMonitorActor`, `Utils`, `SequentialRecordStorage`, the argument parsers of `ComputingUnitMaster` and `ComputingUnitWorker`, `WebsocketInput`, `WorkflowWebsocketResource`, `AiAssistantManager`, `ExecFactory`, `VirtualIdentityUtils`, `URLFetchUtil` and `HtmlVizOpDesc`. The two argument parsers end in `case _`, since `case Nil` already takes the empty list. - **`S3StorageClient.uploadObject`:** - `readChunk` uses a plain `while` loop instead of assigning inside the loop condition. - The parts upload in a `while` loop that adds each `CompletedPart` to the Java list the SDK takes. Before, an `Iterator` of `(partNumber, size)` tuples became a Scala `List` and then went back through `.asJava`. - Each part is copied out of the reused buffer once and streamed from that copy. `buffer.take` and `RequestBody.fromBytes`, which calls `Arrays.copyOf` itself, copied it twice. The content provider gives each SDK attempt a fresh stream over the same bytes. - Part numbers, upload order, part sizes, the `application/octet-stream` content type and the read of the next chunk after each upload are unchanged. - **`SQLSourceOpExec.fetchBatchByBoundary`:** returns the result of the type `match` as a `val` instead of overwriting a `var` that starts as `null`. - **Worker statistics:** `StatisticsManager.getStatistics` drops the executor parameter it has not read since its sink-operator check went away. `DataProcessor` and both statistics specs stop passing an executor to it. - **Telemetry:** `WorkflowMetricsRecorder` drops a `LazyLogging` it never logs with, and `WorkflowMetrics` drops the `Cancelled` outcome and the `Unknown` workflow kind that nothing records. - **Scan sources:** `SkippedRowReporter` drops its uncalled `count`, and `ArrowSourceOpExec` drops a batch counter it only increments. - **Arrow Flight benchmark:** sorts each run's latencies once, instead of once per percentile. - **Test helpers:** - `DPThreadSpec.awaitCond` drops its unused default budget, and the spec's callbacks name their unused argument `_`. - `ExternalAuthProvisionerSpec`'s `seedUser` and `seedUserWithEmail` drop the `avatar` parameter that no test passes. - `DictionaryMatcherOpExecSpec.withExecutor`, `HashJoinOpSpec.tuple` and the tuple builders of `IntervalOpExecSpec` drop defaults that every caller overrides. - `PythonWorkerPool` starts its stdout and stderr reader threads without keeping the references it never reads. - **Test fixtures:** - `TestOperators` drops `asterixDBSourceOpDesc`, a descriptor for the AsterixDB server at `ipubmed4.ics.uci.edu` that only its own `TestOperatorsSpec` case still built. It also drops the `multiLine` parameter that `getCsvScanOpDesc` never read. - `headerlessSmallMultiLineDataCsvScanOpDesc` reads `country_sales_headerless_small_multi_line.csv` again, so `DataProcessingSpec`'s headerless multi-line case runs on multi-line data. - The matching `CSVScanSourceOpDescSpec` case now reads that file too, and checks the scanned rows: 100 rows of 14 fields, a quoted value with commas, and two values with line breaks. **Database reads** - **Account, login and notification queries:** - `AuthResource`'s login query selects the user columns and the password hash, instead of every column of the joined `auth_provider` and `user` rows. `ExternalAuthProvisioner`'s lookup selects only the user columns. - The admin-bootstrap and add-email checks in `AuthResource`, the duplicate-email check in `AdminUserResource` and `UserResource.isJoiningReasonRequired` read one column, or use `selectOne`, instead of a full user row. - `GmailResource` reads only the requester's name and the admins' email addresses, compiles its email regex once, and passes the subject and the domain-suffixed content to `createMimeMessage` instead of copying the `EmailMessage`. - **Dashboard search:** - `searchAllResources` builds its results in one pass over the first `count` rows. Before, it built a list of entries, filtered out the omitted ones, and scanned the list again for `hasMismatch`. - `getOrderFields` drops the `case None` branch and the private `getColumnField` with its `case _ => null`, which its regex makes unreachable, and compiles the regex once. - `WorkflowSearchQueryBuilder` builds its access condition as a `val` instead of overwriting a `DSL.trueCondition()` initializer. `VersionedResourceSearchQueryBuilder` drops a `getGroupByFields` override that returns the base default. - `VersionedResourceTables.hydrate` stops pairing each entry with a resource ID that every caller discarded, drops `idOf`, and reads the owner email from the record without building a `User` POJO. - **Hub (`HubResource`):** - The versioned-resource lookup selects the resource columns, the owner email and the privilege that `hydrate` reads, instead of every joined column. `VersionedResourceTables.hydrationFields` defines that list next to `hydrate`, because a query that left a column out would get a `null` email or privilege without an error. - `isLikedHelper` collects the liked IDs with `fetchSet`. Like/unlike and clone check for an existing row with `fetchExists` instead of fetching it, and like/unlike no longer goes through the batch helper. - `getCounts` reuses each entity type's request group, and drops the zero entries it added for missing view counts, since the lookup already defaults to 0. - **Notebook migration:** `NotebookMigrationResource` stops selecting the notebook ID it never reads, and drops `JSONB` casts that its typed fields make redundant. `JupyterEndpointResolver` selects the two registration URLs instead of a full `user_jupyter` row, and `JupyterProvisioner` derives a healthy registration's token once instead of twice. **Tests for rewritten paths no test reached** - `DatasetSearchQueryBuilderSpec` runs a dataset search over a dataset that lakeFS rejects, and expects it left out with `hasMismatch` set. - `HubResourceSpec` fetches such a dataset by ID and expects it dropped. - `AdminUserResourceSpec` moves a user to an address no other account uses. | Event | PR / Commit | | --- | --- | | Introduced by | Amber engine and web server: apache#945 (2021-01-05), apache#1101 (2021-05-03), apache#1387 (2022-02-10), apache#1381 (2022-05-13), apache#1671 (2022-11-07), apache#1677 (2022-11-07), apache#2060 (2023-07-14), apache#2529 (2024-03-29), apache#2570 (2024-04-07), apache#2808 (2024-09-02); account and notification queries: apache#3080 (2024-11-19), apache#3393 (2025-04-29), apache#3440 (2025-06-08), apache#4185 (2026-02-16), apache#7055 (2026-08-10), apache#7758 (2026-08-21), apache#7639 (2026-08-30), apache#7978 (2026-08-31); dashboard search and Hub: apache#2358 (2024-02-23), apache#2838 (2024-09-25), apache#3252 (2025-02-09), apache#3446 (2025-05-26), apache#3442 (2025-06-28), apache#3519 (2025-07-09), apache#7928 (2026-08-26), apache#7930 (2026-09-01), apache#8890 (2026-10-27); `workflow-core`: apache#2271 (2024-01-18), apache#3183 (2024-12-31), apache#4067 (2025-11-25); `workflow-operator`: apache#1013 (2021-02-11), apache#1866 (2023-03-23), apache#3139 (2024-12-06), apache#3186 (2024-12-31), apache#6947 (2026-10-02); `observability`: apache#5376 (2026-10-27); notebook migration: apache#5258 (2026-06-24), apache#8032 (2026-09-03); tests and benchmark: apache#1044 (2021-02-25), apache#1083 (2021-04-25), apache#1227 (2021-07-25), apache#2254 (2023-12-13), apache#2302 (2024-02-05), apache#3425 (2025-05-26), apache#4836 (2026-05-03), apache#5439 (2026-06-06), apache#5557 (2026-06-11), apache#6077 (2026-07-03), apache#7116 (2026-07-31), apache#7207 (2026-08-14), apache#7870 (2026-08-23), apache#7875 (2026-08-31), apache#9534 (2026-11-19), apache#9518 (2026-11-21) | | Usage removed by | AsterixDB fixture: apache#1118 (2021-05-11, `Disable dependent tests with AsterixDB`) commented out its only test use, which apache#3294 (2025-03-04) deleted; multi-line fixture: apache#3111 (2024-11-26, `Update amber to depend on sub projects`) pointed `headerlessSmallMultiLineDataCsvScanOpDesc` at the single-line file; `awaitCond`'s default budget: apache#9534 (2026-11-19, `test(amber): share engine and service test fixtures`) routed its last callers through a helper that always passes one; `getStatistics`' executor parameter: apache#3312 (2025-03-12, `Remove Sink Operator in the Backend`) dropped its only read, the sink-operator check; everything else: unused or redundant since introduction | As of 2026-11-24, the AsterixDB fixture has had no test use for over 5 years, and the headerless multi-line CSV fixture has read single-line data for about 12 months. ### Any related issues, documentation, discussions? Closes apache#9680. ### How was this PR tested? The first commit (`cb95cd29b7`) ran on its base, `main` at `de3f021dec`. The second commit ran on this branch before it (`2e980903c8`, after merging `main`) and after it, the third likewise on `dee7711a88`, the fourth on `3870a2da97`, and the fifth on `4c244837bf`. Both used Windows 11, JDK 17, `UDF_PYTHON_PATH` set to Python 3.12, and Docker for the RustFS container that `S3StorageClientSpec` starts. The e2e case uses the Hadoop Iceberg catalog because no REST catalog runs on this machine: ```bash WUNUSED='set ThisBuild / scalacOptions += "-Wunused:patvars,params,privates"' sbt "$WUNUSED" "WorkflowCore/testOnly org.apache.texera.amber.core.executor.CoreExecutorReflectionSpec org.apache.texera.amber.util.VirtualIdentityUtilsSpec org.apache.texera.service.util.S3StorageClientSpec" sbt "$WUNUSED" "WorkflowOperator/testOnly org.apache.texera.amber.operator.TestOperatorsSpec org.apache.texera.amber.operator.dictionary.DictionaryMatcherOpExecSpec org.apache.texera.amber.operator.hashJoin.HashJoinOpSpec org.apache.texera.amber.operator.intervalJoin.IntervalOpExecSpec org.apache.texera.amber.operator.source.fetcher.URLFetchUtilSpec org.apache.texera.amber.operator.source.fetcher.URLFetcherOpExecSpec org.apache.texera.amber.operator.source.scan.csv.CSVScanSourceOpDescSpec org.apache.texera.amber.operator.source.scan.csv.CSVScanSourceOpExecSpec org.apache.texera.amber.operator.source.sql.* org.apache.texera.amber.operator.visualization.htmlviz.HtmlVizOpDescSpec org.apache.texera.amber.util.python.PythonWorkerPoolSpec" sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.amber.clustering.ClusterListenerSpec org.apache.texera.amber.engine.architecture.messaginglayer.DeadLetterMonitorActorSpec org.apache.texera.amber.engine.architecture.worker.DPThreadSpec org.apache.texera.amber.engine.common.UtilsSpec org.apache.texera.amber.engine.common.storage.SequentialRecordStorageSpec org.apache.texera.web.ComputingUnitMasterSpec org.apache.texera.web.ComputingUnitWorkerSpec org.apache.texera.web.WebsocketInputSpec org.apache.texera.web.resource.WorkflowWebsocketResourceSpec org.apache.texera.web.resource.aiassistant.AiAssistantManagerSpec org.apache.texera.web.resource.auth.ExternalAuthProvisionerSpec" sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.web.TexeraWebApplicationSpec org.apache.texera.web.resource.GmailResourceSpec org.apache.texera.web.resource.auth.AuthResourceSpec org.apache.texera.web.resource.auth.ExternalAuthProvisionerSpec org.apache.texera.web.resource.auth.OrcidAuthResourceSpec org.apache.texera.web.resource.dashboard.DashboardResourceSpec org.apache.texera.web.resource.dashboard.DatasetSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.ModelSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.UnifiedResourceSchemaSpec org.apache.texera.web.resource.dashboard.VersionedResourceTablesSpec org.apache.texera.web.resource.dashboard.WorkflowSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.admin.user.AdminUserResourceSpec org.apache.texera.web.resource.dashboard.file.DatasetResourceSpec org.apache.texera.web.resource.dashboard.file.WorkflowResourceSpec org.apache.texera.web.resource.dashboard.hub.EntityTablesSpec org.apache.texera.web.resource.dashboard.hub.HubEntityModelSpec org.apache.texera.web.resource.dashboard.hub.HubResourceSpec org.apache.texera.web.resource.dashboard.user.UserResourceSpec org.apache.texera.web.resource.dashboard.user.workflow.WorkflowPublishSpec org.apache.texera.web.service.WorkflowEmailNotifierSpec" STORAGE_ICEBERG_CATALOG_TYPE=hadoop sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.amber.engine.e2e.DataProcessingSpec -- -z headerlessMultiLineDataCsv" sbt "$WUNUSED" Observability/test NotebookMigrationService/test "WorkflowOperator/testOnly org.apache.texera.amber.operator.source.scan.*" sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.amber.engine.architecture.coordinator.promisehandlers.ConsoleMessageHandlerSpec org.apache.texera.amber.engine.architecture.messaginglayer.WorkerTimerServiceSpec org.apache.texera.amber.engine.architecture.worker.DPThreadSpec org.apache.texera.amber.engine.architecture.worker.DataProcessorRPCHandlerInitializerSpec org.apache.texera.amber.engine.architecture.worker.DataProcessorSpec org.apache.texera.amber.engine.architecture.worker.WorkerSpec org.apache.texera.amber.engine.architecture.worker.WorkflowWorkerSpec org.apache.texera.amber.engine.architecture.worker.managers.StatisticsManagerSpec org.apache.texera.amber.engine.architecture.worker.managers.WorkerManagersSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.EndChannelHandlerSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.EndHandlerSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.FinalizeCheckpointHandlerSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.StartChannelHandlerSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.StartHandlerSpec org.apache.texera.amber.engine.common.UtilsSpec org.apache.texera.amber.engine.faulttolerance.CheckpointSpec org.apache.texera.web.observability.WorkflowMetricsRecorderSpec" sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.web.resource.dashboard.DatasetSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.DashboardResourceSpec org.apache.texera.web.resource.dashboard.admin.user.AdminUserResourceSpec org.apache.texera.web.resource.dashboard.hub.HubResourceSpec org.apache.texera.web.ComputingUnitMasterSpec org.apache.texera.web.ComputingUnitWorkerSpec" sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.web.resource.dashboard.DatasetSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.ModelSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.VersionedResourceTablesSpec org.apache.texera.web.resource.dashboard.DashboardResourceSpec org.apache.texera.web.resource.dashboard.hub.EntityTablesSpec org.apache.texera.web.resource.dashboard.hub.HubEntityModelSpec org.apache.texera.web.resource.dashboard.hub.HubResourceSpec" sbt WorkflowCore/scalafmtCheckAll WorkflowOperator/scalafmtCheckAll WorkflowExecutionService/scalafmtCheckAll Observability/scalafmtCheckAll NotebookMigrationService/scalafmtCheckAll "WorkflowCore/scalafixAll --check" "WorkflowOperator/scalafixAll --check" "WorkflowExecutionService/scalafixAll --check" "Observability/scalafixAll --check" "NotebookMigrationService/scalafixAll --check" ``` - JUnit XML, compared per test: - First commit: the first three test commands and the e2e case run 36 suites that load every file the commit changes, and `SQLSourceOpExecSpec` calls `fetchBatchByBoundary` for each numeric type through a mocked JDBC result. All 554 tests pass on `main` and all 553 with the commit. Each test has the same outcome as on `main`; the missing one is the removed `asterixDBSourceOpDesc` case. - Second commit: the fourth command runs the 20 suites that load the account, notification, dashboard-search and Hub code, against an embedded PostgreSQL. All 525 tests pass before and after the commit, each with the same outcome. - Third commit: the sixth and seventh test commands run every `Observability`, `NotebookMigrationService` and scan-source suite, plus the worker, statistics, checkpoint and telemetry suites that load the changed classes. Before and after it, 581 of the 595 tests in these 48 suites pass, each with the same outcome. The other 14 fail on both sides on this machine: 13 `ParquetScanSourceOpDescSpec` cases need Hadoop's Windows binaries, and one `FileScanSourceOpDescSpec` case hits a Windows temp-file lock. - Fourth commit: the eighth test command runs the six suites it touches. All 179 tests pass, the three new ones included. - Fifth commit: the ninth test command runs the seven suites that load `VersionedResourceTables` or the Hub query. All 182 tests pass. - On the second commit's head, all 55 suites of the first two rounds pass, the e2e case included: 1,059 tests. - `S3StorageClientSpec` runs its 34 cases against RustFS 1.0.0 in Testcontainers on both sides. They include a 6 MiB upload (a 5 MiB part and a 1 MiB tail) that downloads back byte for byte, an empty upload, and the abort when the input stream fails after the first part. - With the fixture pointed back at `country_sales_headerless_small.csv`, the strengthened `CSVScanSourceOpDescSpec` case fails: row 8 reads `Republic of the Congo` instead of `Republic,of,the,Congo`. The `DataProcessingSpec` case runs the multi-line file through the engine and gets the same 100 rows that the single-line file gives on `main`. - scalafmt and scalafix pass on all five touched modules. - With `-Wunused:patvars,params,privates`, the compiler reports 26 unused names in the files of the first commit on `main`. That commit removes 24 of them. The other two are `config` and `cr`, which the `@OnOpen` and `@OnClose` methods of `WorkflowWebsocketResource` need for the WebSocket API's signatures; they are reported on both. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5)
What changes were proposed in this PR?
Models can already be created, versioned, uploaded to, shared and published. What they cannot be is found. There is no Models section in the hub, models never appear in search results, and the Models page under Your Work filters a list in the browser rather than querying the server. This PR adds that missing half, backend and frontend together.
Backend. Two new tables,
model_user_likesandmodel_view_count, give models the same engagement tracking workflows and datasets have, andmodeljoins the full-text index block so its name and description are searchable (43.sql, withtexera_ddl.sqlcovering a fresh database). AddingEntityType.Modeland one registry entry is enough to wire up every hub endpoint — counts, likes, views, tops and user-access — because that layer is already resource-agnostic.ModelSearchQueryBuilderteaches unified search about models; it is a projection over shared query logic, andframeworkandformatare the only columns unique to it. The search endpoint gains a model result slot and amodelIdfilter.Frontend. Models now appear in the hub: a sidebar entry, a count and a "Top Loved Models" section on the landing page, and a browse page that lists public models as cards or as a list. Unified search gains a Model type button, and a model card in the results links to the model's page. The Models page under Your Work now searches through the server like the Datasets page does, which gives it the shared filters bar — owner, id and creation date — and drops about 90 lines of in-browser filtering, sorting and owner lookup. The model detail page's view and
like counters, previously hardcoded zeros, now show real numbers and the like button works.
One refactor, worth reading first. Two pieces of shared hub code were guessing at things they can now be told. The hub result page worked out which kind of resource it was showing by looking for substrings in the URL, which is fragile once a third kind exists — it now reads the kind off the route definition. And the hub landing page's cards had their own copy of the "link to my page if I have access, otherwise to the hub" logic, which the resource registry
already provides; they now call it. Neither changes behaviour for workflows or datasets.
the hub actually shows. Pre-existing, affects workflows and datasets too, and fixed in a
follow-up so this PR does not touch their rendering.
Any related issues, documentation, discussions?
Closes #6501 (umbrella #6494).
How was this PR tested?
Backend. 518 tests pass across the dashboard package. New:
ModelSearchQueryBuilderSpecpins the projection, the access scoping and the id filter; model cases inVersionedResourceTablesSpec,EntityTablesSpec,EntityTypeSpecandHubEntityModelSpec; and hub coverage inHubResourceSpecfor likes, view counts,getCounts,getTopsanduser-access, including the case where a workflow, a dataset and a model share an id.UnifiedResourceSchemaSpecandDatasetSearchQueryBuilderSpecconfirm the shared-builder change leaves the dataset and workflow SQL unchanged.ConfigResourceSpecandDefaultsConfigSpeccover the new setting.43.sqlapplied twice for idempotence;scalafmtCheckAllclean.Frontend. 2574 tests pass across
src/app/hub(183),src/app/dashboard(1734) andsrc/app/common(657);tsc --noEmitand Prettier clean. New coverage for model rows through the search pipeline and the unknown-kind row that used to throw; the route-based kind resolution; the hub landing cards' links for all three kinds, including two kinds sharing an id; the model count and Top Loved Models; the hub sidebar entry; the Models page's server query and filters bar; and the detail page's view, like and toggle behaviour.Manually verified: the hub Models browse page, the landing page's count and Top Loved Models, liking a model and watching the count follow, the view counter incrementing on the detail page, the Model button in search, and the new admin toggle showing and hiding the hub entry. Regression checks on hub Workflows and Datasets: the right kind is listed, the card/list toggle appears only for datasets, and the sort options are unchanged.
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5)