You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "aglinxinyuan (via GitHub)" <gi...@apache.org> on 2026/07/30 04:27:30 UTC

[PR] test(amber): add no-DB specs for the dashboard search query tier [texera]

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

   ### What changes were proposed in this PR?
   
   `FulltextSearchQueryUtilsSpec` was the only spec in the dashboard package. It also proves the approach: a **dialect-only** `DSL.using(SQLDialect.POSTGRES)` context renders jOOQ parts with no connection, and `ctx.newRecord(...)` builds records purely in memory. These three specs extend that to the rest of the connection-free tier.
   
   | New spec | Target | Why it isn't DB-bound |
   |---|---|---|
   | `DashboardResourceSpec` | `getOrderFields`, unknown-`resourceType` guard | both public and pure; the guard throws *before* any query is built |
   | `WorkflowSearchQueryBuilderSpec` | `toEntryImpl`, `mappedResourceSchema` | this object drops the trait's `protected`, widening access to public |
   | `UnifiedResourceSchemaSpec` | `apply`, the `translatedFieldSet` de-dup | 24 default-arg `Field`s, all `DSL.inline`/`cast`/`castNull` |
   
   **`getOrderFields`** — existing coverage was only incidental (via `WorkflowResourceSpec`) and reached `NameAsc`/`Desc`, `ExecutionTimeAsc`/`Desc`, and `EditTime` through the default. This adds `CreateTime` both ways and the non-matching fall-through. It also pins the asc/desc asymmetry:
   
   ```
   Asc  -> "resourceCreationTime" asc
   Desc -> "resourceCreationTime" desc nulls last
   ```
   
   That asymmetry is the point: Postgres defaults to NULLS LAST for ASC and NULLS FIRST for DESC, so the explicit `nullsLast()` on the descending branch is what makes the *observable* ordering symmetric. Dropping it looks like a harmless simplification and silently moves NULLs to the top of every descending page.
   
   **`toEntryImpl`** — covers the projects-aggregate lookup, both comma-split branches, the NULL-privilege fallback to `NONE`, and the ownership flag both ways. The first test deliberately pins the aggregate lookup itself: `toEntryImpl` builds a *fresh* `groupConcatDistinct(WORKFLOW_OF_PROJECT.PID)` rather than reusing the one in `mappedResourceSchema`, so the whole projects feature rides on jOOQ comparing two structurally identical aggregates as equal.
   
   **`UnifiedResourceSchema`** — the counts were measured, not assumed: 24 aliases, collapsing to 6 entries for the all-defaults schema and 17 for the workflow schema.
   
   Assertion strength was checked by **mutating production and confirming red**, then reverting (`git diff -- amber/src/main` is empty):
   
   | Mutation | Caught by |
   |---|---|
   | `desc().nullsLast()` → `desc()` | 2 tests |
   | `EditTime` → `resourceCreationTimeField` | 2 tests |
   | `into(WORKFLOW_OF_USER).getUid == uid` → `into(USER).getUid != uid` | 2 tests |
   | privilege fallback `NONE` → `READ` | 1 test |
   | de-dup guard → `if (true)` | 3 tests |
   
   Out of scope, and noted in-file: `translateRecord`, `resultsOwnersInfo`, `searchAllPublicResourceCall`, `constructQuery` and every fetch path go through `SqlServer.getInstance().createDSLContext()`. `DatasetSearchQueryBuilder` is untouched — all five of its members are `override protected`, and Scala `protected` grants no same-package access.
   
   Two things deliberately **not** asserted, with the reasoning left in the files: `case None => List()` in `getOrderFields` and `case _ => null` in the private `getColumnField` are unreachable (the regex yields only four column names, all mapping non-null); and the projects parser's `NumberFormatException` on a padded separator is real but unproducible in production, so pinning it would only punish someone hardening the parser.
   
   None of these specs reads or writes `FulltextSearchQueryUtils.usePgroonga`, so they neither depend on it nor mutate it — worth stating because two existing specs set that JVM-global and never restore it while amber's suites run concurrently.
   
   Fragilities found in passing, reported rather than changed: `DashboardWorkflow.ownerId` is read as `record.into(USER).getUid` although the projection never selects `USER.UID` — it works only because jOOQ matches the unqualified name `uid` against `workflow_of_user.uid`; and `searchAllResources`'s per-record `resourceType` match has no default arm, so changing the inline `'workflow'` literal becomes a runtime `MatchError`.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7115
   
   ### How was this PR tested?
   
   Three new specs, 27 tests. Run together with the existing sibling spec to confirm nothing in the package regressed — 41 tests, Java 17:
   
   ```
   sbt "WorkflowExecutionService/testOnly org.apache.texera.web.resource.dashboard.DashboardResourceSpec org.apache.texera.web.resource.dashboard.WorkflowSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.UnifiedResourceSchemaSpec org.apache.texera.web.resource.dashboard.FulltextSearchQueryUtilsSpec"
   ```
   
   ```
   [info] Suites: completed 4, aborted 0
   [info] Tests: succeeded 41, failed 0, canceled 0, ignored 0, pending 0
   [info] All tests passed.
   ```
   
   Verified with no Postgres provisioned locally, which is the point. `Test/scalafmtCheck` and `Test/scalafix --check` both `[success]`.
   
   One brittleness to be aware of: the expected strings (`desc nulls last`, `cast(null as timestamp)`, `'workflow' as "resourceType"`) and the de-dup counts are jOOQ **3.19.36** rendering artifacts, so a jOOQ bump could require updating them together.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] test(amber): add no-DB specs for the dashboard search query tier [texera]

Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan merged PR #7116:
URL: https://github.com/apache/texera/pull/7116


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] test(amber): add no-DB specs for the dashboard search query tier [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #7116:
URL: https://github.com/apache/texera/pull/7116#issuecomment-5126446943

   <!-- texera-reviewer-suggestion -->
   ### Automated Reviewer Suggestions
   
   Based on the `git blame` history of the changed files, we recommend the following reviewers:
   
   - No candidates found from `git blame` history.
   


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] test(amber): add no-DB specs for the dashboard search query tier [texera]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #7116:
URL: https://github.com/apache/texera/pull/7116#issuecomment-5126528986

   ## [Codecov](https://app.codecov.io/gh/apache/texera/pull/7116?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 79.59%. Comparing base ([`fe9c490`](https://app.codecov.io/gh/apache/texera/commit/fe9c4900234f535ae80fb002138f8c9386e68bb8?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`22d0b4f`](https://app.codecov.io/gh/apache/texera/commit/22d0b4fa86f3ba7745f49cc98824b17e326523ce?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 5 commits behind head on main.
   :white_check_mark: All tests successful. No failed tests found.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##               main    #7116      +/-   ##
   ============================================
   + Coverage     79.40%   79.59%   +0.18%     
   - Complexity     3803     3833      +30     
   ============================================
     Files          1159     1159              
     Lines         46142    46145       +3     
     Branches       5128     5127       -1     
   ============================================
   + Hits          36639    36728      +89     
   + Misses         7887     7786     -101     
   - Partials       1616     1631      +15     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/texera/pull/7116/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | *Carryforward flag |
   |---|---|---|---|
   | [access-control-service](https://app.codecov.io/gh/apache/texera/pull/7116/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.00% <ø> (ø)` | | Carriedforward from [fe9c490](https://app.codecov.io/gh/apache/texera/commit/fe9c4900234f535ae80fb002138f8c9386e68bb8?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [agent-service](https://app.codecov.io/gh/apache/texera/pull/7116/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.42% <ø> (ø)` | | Carriedforward from [fe9c490](https://app.codecov.io/gh/apache/texera/commit/fe9c4900234f535ae80fb002138f8c9386e68bb8?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [amber](https://app.codecov.io/gh/apache/texera/pull/7116/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.13% <ø> (+0.51%)` | :arrow_up: | |
   | [computing-unit-managing-service](https://app.codecov.io/gh/apache/texera/pull/7116/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `20.49% <ø> (ø)` | | Carriedforward from [fe9c490](https://app.codecov.io/gh/apache/texera/commit/fe9c4900234f535ae80fb002138f8c9386e68bb8?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [config-service](https://app.codecov.io/gh/apache/texera/pull/7116/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `66.66% <ø> (ø)` | | Carriedforward from [fe9c490](https://app.codecov.io/gh/apache/texera/commit/fe9c4900234f535ae80fb002138f8c9386e68bb8?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [file-service](https://app.codecov.io/gh/apache/texera/pull/7116/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `67.21% <ø> (ø)` | | Carriedforward from [fe9c490](https://app.codecov.io/gh/apache/texera/commit/fe9c4900234f535ae80fb002138f8c9386e68bb8?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [frontend](https://app.codecov.io/gh/apache/texera/pull/7116/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `83.05% <ø> (ø)` | | Carriedforward from [fe9c490](https://app.codecov.io/gh/apache/texera/commit/fe9c4900234f535ae80fb002138f8c9386e68bb8?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [notebook-migration-service](https://app.codecov.io/gh/apache/texera/pull/7116/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `78.94% <ø> (ø)` | | Carriedforward from [fe9c490](https://app.codecov.io/gh/apache/texera/commit/fe9c4900234f535ae80fb002138f8c9386e68bb8?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [pyamber](https://app.codecov.io/gh/apache/texera/pull/7116/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `97.36% <ø> (ø)` | | Carriedforward from [fe9c490](https://app.codecov.io/gh/apache/texera/commit/fe9c4900234f535ae80fb002138f8c9386e68bb8?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [workflow-compiling-service](https://app.codecov.io/gh/apache/texera/pull/7116/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.31% <ø> (ø)` | | Carriedforward from [fe9c490](https://app.codecov.io/gh/apache/texera/commit/fe9c4900234f535ae80fb002138f8c9386e68bb8?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   *This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/texera/pull/7116?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] test(amber): add no-DB specs for the dashboard search query tier [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #7116:
URL: https://github.com/apache/texera/pull/7116#issuecomment-5126492419

   <!-- texera-benchmarks-comment -->
   ## ⚠️ Benchmark changes need a look
   
   🟢 2 better · 🔴 5 worse · ⚪ 8 noise (<±5%) · 0 without baseline
   
   > Compared against main `301e3a8` benchmarked on **this same runner**, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.
   
   [Dashboard](https://apache.github.io/texera/dev/bench/) · [Run](https://github.com/apache/texera/actions/runs/30513930910)
   
   | | config | throughput | MB/s | latency | max Δ latest / 7d |
   |---|---|---:|---:|---:|---:|
   | 🔴 | bs=10 sw=10 sl=64 | 429 | 0.262 | 22,629/31,749/31,749 us | 🔴 +12.6% / 🔴 +101.3% |
   | 🟢 | bs=100 sw=10 sl=64 | 940 | 0.574 | 108,416/117,542/117,542 us | 🟢 -14.2% / 🔴 +9.5% |
   | ⚪ | bs=1000 sw=10 sl=64 | 1,111 | 0.678 | 907,235/929,716/929,716 us | ⚪ within ±5% / 🟢 -11.8% |
   
   <details><summary>Baseline details</summary>
   
   Latest main `301e3a8` from same runner
   
   | config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
   |---|---|---:|---:|---:|---:|---:|
   | bs=10 sw=10 sl=64 | throughput | 429 tuples/sec | 477 tuples/sec | 786.12 tuples/sec | -10.1% | -45.4% |
   | bs=10 sw=10 sl=64 | MB/s | 0.262 MB/s | 0.291 MB/s | 0.48 MB/s | -10.0% | -45.4% |
   | bs=10 sw=10 sl=64 | p50 | 22,629 us | 20,100 us | 12,305 us | +12.6% | +83.9% |
   | bs=10 sw=10 sl=64 | p95 | 31,749 us | 30,120 us | 15,774 us | +5.4% | +101.3% |
   | bs=10 sw=10 sl=64 | p99 | 31,749 us | 30,120 us | 18,978 us | +5.4% | +67.3% |
   | bs=100 sw=10 sl=64 | throughput | 940 tuples/sec | 955 tuples/sec | 999.71 tuples/sec | -1.6% | -6.0% |
   | bs=100 sw=10 sl=64 | MB/s | 0.574 MB/s | 0.583 MB/s | 0.61 MB/s | -1.5% | -5.9% |
   | bs=100 sw=10 sl=64 | p50 | 108,416 us | 105,377 us | 100,616 us | +2.9% | +7.8% |
   | bs=100 sw=10 sl=64 | p95 | 117,542 us | 136,953 us | 107,356 us | -14.2% | +9.5% |
   | bs=100 sw=10 sl=64 | p99 | 117,542 us | 136,953 us | 113,255 us | -14.2% | +3.8% |
   | bs=1000 sw=10 sl=64 | throughput | 1,111 tuples/sec | 1,128 tuples/sec | 1,031 tuples/sec | -1.5% | +7.7% |
   | bs=1000 sw=10 sl=64 | MB/s | 0.678 MB/s | 0.688 MB/s | 0.63 MB/s | -1.5% | +7.7% |
   | bs=1000 sw=10 sl=64 | p50 | 907,235 us | 886,818 us | 980,328 us | +2.3% | -7.5% |
   | bs=1000 sw=10 sl=64 | p95 | 929,716 us | 925,214 us | 1,027,528 us | +0.5% | -9.5% |
   | bs=1000 sw=10 sl=64 | p99 | 929,716 us | 925,214 us | 1,054,298 us | +0.5% | -11.8% |
   
   </details>
   
   <details><summary>Raw CSV</summary>
   
   ```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,465.81,200,128000,429,0.262,22628.55,31749.12,31749.12
   1,100,10,64,20,2127.50,2000,1280000,940,0.574,108415.59,117542.27,117542.27
   2,1000,10,64,20,17999.89,20000,12800000,1111,0.678,907234.72,929715.67,929715.67
   ```
   
   </details>
   


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org