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

   ### What changes were proposed in this PR?
   
   Adds `HubEntityModelSpec` covering all three files in 
`amber/.../web/resource/dashboard/hub/` — the entity-kind dispatch types the 
Hub dashboard uses and the jOOQ table lookups they drive. Bundled because the 
three files are a tight `apply(EntityType)` dispatch family.
   
   | File | Behavior pinned |
   | --- | --- |
   | `ActionType.scala` | Four subtypes (`View` / `Like` / `Clone` / `Unlike`) 
expose lowercase `value`; `toString = value` override (what reaches log lines, 
not the case-object name); `fromString` exact-match + case-insensitive; throws 
`IllegalArgumentException` with input in message on unknown / empty; 
`@JsonValue` + `@JsonCreator` Jackson round-trip via `JSONUtils.objectMapper` 
(emits lowercase string, accepts case-insensitive). |
   | `EntityType.scala` | Same shape — `Workflow` / `Dataset` carry 
`"workflow"` / `"dataset"`; toString-equals-value override; case-insensitive 
`fromString`; unknown-input error; Jackson round-trip. |
   | `EntityTables.scala` dispatch | `BaseEntityTable.apply`, 
`LikeTable.apply`, `CloneTable.apply`, `ViewCountTable.apply` each dispatched 
against both `EntityType` subtypes. Each `case object` exposes its `table` / 
`idColumn` / `isPublicColumn` / `uidColumn` / `viewCountColumn` from the 
production jOOQ generated tables — a regression that wired a column to the 
wrong jOOQ field would fail here. `CloneTable(Dataset)` throws 
`IllegalArgumentException` since clone is workflow-only today; a future 
`DatasetCloneTable` should remove that assertion deliberately. |
   
   No production code changed; this is test-only.
   
   ### Any related issues, documentation, discussions?
   
   Closes #5397
   
   ### How was this PR tested?
   
   ```
   sbt "WorkflowExecutionService/Test/testOnly 
org.apache.texera.web.resource.dashboard.hub.HubEntityModelSpec"
   # → 24 tests, all pass
   
   sbt "WorkflowExecutionService/Test/scalafmtCheck"
   # → clean
   ```
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 4.7)


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