eugenegujing opened a new pull request, #7399: URL: https://github.com/apache/texera/pull/7399
### What changes were proposed in this PR? Adds `ProjectSearchQueryBuilderSpec`, a connection-free unit spec for the project arm of the unified dashboard search. `ProjectSearchQueryBuilder` was the only search query builder without tests — `WorkflowSearchQueryBuilderSpec` already exists, and `DatasetSearchQueryBuilder` is driven from `DatasetResourceSpec`. The spec follows the same conventions as the sibling `WorkflowSearchQueryBuilderSpec` (in-memory jOOQ records rendered with the Postgres dialect, no database connection) and covers the two members the object widens from the trait's `protected` to public: **`toEntryImpl` — the record-to-DTO mapping (4 tests):** copies every `PROJECT` column into the `Project` POJO with distinct fixture values so a wrong-column read cannot pass; passes NULL description/color through (the only two nullable project columns); tags the entry `resourceType == "project"` with the `workflow`/`dataset` payload slots `None` (the dashboard dispatch matches on this value with no default branch, so drift is a runtime `MatchError`); and produces an identical entry regardless of the caller's uid (the project arm computes no ownership flag). **`mappedResourceSchema` — the projection the union and dispatch depend on (5 tests):** pins the inline `'project'` resourceType literal; pins that `PROJECT.CREATION_TIME` is aliased as both the creation and last-modified time — a deliberate alias (the project table has no last-modified column) that keeps projects sortable by edit time instead of NULL-sinking; and pins the color, pid/ownerId, and name/description projection slots. `constructFromClause`, `constructWhereClause`, and `getGroupByFields` stay `override protected` (Scala `protected` grants no same-package access), so they are intentionally out of scope. Every test was mutation-checked: 8 distinct hand-applied mutations of the production object (literal changes, column swaps, dropped alias, empty-POJO copy, `project = None`) each fail the intended test, with production sources restored afterwards. No production file is touched. ### Any related issues, documentation, discussions? Closes #7398 ### How was this PR tested? Nine new tests; the spec is the only change: ``` sbt "WorkflowExecutionService/testOnly org.apache.texera.web.resource.dashboard.ProjectSearchQueryBuilderSpec" ``` ``` [info] Tests: succeeded 9, failed 0, canceled 0, ignored 0, pending 0 [info] All tests passed. ``` The file is formatted with the project's scalafmt (no diff on re-run). ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Fable 5) -- 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]
