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

[PR] fix(workflow): return 404 for missing workflow type [texera]

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

   ### What changes were proposed in this PR?
   
   Return `404 Not Found` when the workflow type endpoint is requested for a workflow that does not exist. Previously, `getWorkflowType` dereferenced a null DAO result and returned `500 Internal Server Error`.
   
   Before:
   <img width="2690" height="202" alt="image" src="https://github.com/user-attachments/assets/23e711f9-47a4-43f3-8b83-2d8e8d18e375" />
   
   After:
   <img width="2690" height="230" alt="image" src="https://github.com/user-attachments/assets/189d5398-4fa6-4112-95d2-c26c59b0f2de" />
   
   ### Any related issues, documentation, discussions?
   
   Closes #8300
   
   ### How was this PR tested?
   
   - Ran `WorkflowResourceSpec`
   - Verified `GET /api/workflow/type/2147483647` returns `404` instead of `500`
   - Added regression coverage for a missing workflow type
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: ChatGPT (5.5 mini)
   


-- 
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] fix(workflow): return 404 for missing workflow type [texera]

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

   <!-- texera-benchmarks-comment -->
   ## ✅ No material benchmark regressions detected
   
   🟢 4 better · 🔴 0 worse · ⚪ 11 noise (<±5%) · 0 without baseline
   
   > Compared against main `1cbe857` 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/33847951267)
   
   | | config | throughput | MB/s | latency | max Δ latest / 7d |
   |---|---|---:|---:|---:|---:|
   | 🟢 | bs=10 sw=10 sl=64 | 347 | 0.212 | 28,556/36,663/36,663 us | 🟢 -49.9% / 🔴 +129.4% |
   | ⚪ | bs=100 sw=10 sl=64 | 786 | 0.48 | 125,807/160,269/160,269 us | ⚪ within ±5% / 🔴 +46.7% |
   | ⚪ | bs=1000 sw=10 sl=64 | 902 | 0.55 | 1,109,078/1,176,898/1,176,898 us | ⚪ within ±5% / 🔴 +12.9% |
   
   <details><summary>Baseline details</summary>
   
   Latest main `1cbe857` from same runner
   
   | config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
   |---|---|---:|---:|---:|---:|---:|
   | bs=10 sw=10 sl=64 | throughput | 347 tuples/sec | 301 tuples/sec | 755.36 tuples/sec | +15.3% | -54.1% |
   | bs=10 sw=10 sl=64 | MB/s | 0.212 MB/s | 0.183 MB/s | 0.461 MB/s | +15.8% | -54.0% |
   | bs=10 sw=10 sl=64 | p50 | 28,556 us | 29,670 us | 12,938 us | -3.8% | +120.7% |
   | bs=10 sw=10 sl=64 | p95 | 36,663 us | 73,135 us | 15,980 us | -49.9% | +129.4% |
   | bs=10 sw=10 sl=64 | p99 | 36,663 us | 73,135 us | 19,233 us | -49.9% | +90.6% |
   | bs=100 sw=10 sl=64 | throughput | 786 tuples/sec | 797 tuples/sec | 976.3 tuples/sec | -1.4% | -19.5% |
   | bs=100 sw=10 sl=64 | MB/s | 0.48 MB/s | 0.487 MB/s | 0.596 MB/s | -1.4% | -19.4% |
   | bs=100 sw=10 sl=64 | p50 | 125,807 us | 121,641 us | 102,340 us | +3.4% | +22.9% |
   | bs=100 sw=10 sl=64 | p95 | 160,269 us | 155,825 us | 109,262 us | +2.9% | +46.7% |
   | bs=100 sw=10 sl=64 | p99 | 160,269 us | 155,825 us | 118,827 us | +2.9% | +34.9% |
   | bs=1000 sw=10 sl=64 | throughput | 902 tuples/sec | 912 tuples/sec | 1,006 tuples/sec | -1.1% | -10.4% |
   | bs=1000 sw=10 sl=64 | MB/s | 0.55 MB/s | 0.556 MB/s | 0.614 MB/s | -1.1% | -10.5% |
   | bs=1000 sw=10 sl=64 | p50 | 1,109,078 us | 1,094,817 us | 999,855 us | +1.3% | +10.9% |
   | bs=1000 sw=10 sl=64 | p95 | 1,176,898 us | 1,137,829 us | 1,042,833 us | +3.4% | +12.9% |
   | bs=1000 sw=10 sl=64 | p99 | 1,176,898 us | 1,137,829 us | 1,070,722 us | +3.4% | +9.9% |
   
   </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,575.97,200,128000,347,0.212,28556.31,36663.44,36663.44
   1,100,10,64,20,2543.65,2000,1280000,786,0.480,125806.99,160269.09,160269.09
   2,1000,10,64,20,22183.10,20000,12800000,902,0.550,1109078.07,1176898.05,1176898.05
   ```
   
   </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] fix(workflow): return 404 for missing workflow type [texera]

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

   Thanks for the fix. I'm closing this PR as a duplicate of #8140.


-- 
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] fix(workflow): return 404 for missing workflow type [texera]

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

   <!-- texera-reviewer-suggestion -->
   ### Automated Reviewer Suggestions
   
   Based on the `git blame` history of the changed files, we recommend the following reviewers:
   
   - **Contributors with relevant context:** `@yangzhang75`, `@aglinxinyuan`
     You can notify them by mentioning `@yangzhang75`, `@aglinxinyuan` in a comment.
   


-- 
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] fix(workflow): return 404 for missing workflow type [texera]

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

   ## [Codecov](https://app.codecov.io/gh/apache/texera/pull/8398?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 94.01%. Comparing base ([`1cbe857`](https://app.codecov.io/gh/apache/texera/commit/1cbe857007a6526c6087f187667ef3b3c9ade546?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`3608088`](https://app.codecov.io/gh/apache/texera/commit/36080880e9d4c2b29886636f6756ab3952c3b30d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :white_check_mark: All tests successful. No failed tests found.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##               main    #8398      +/-   ##
   ============================================
   - Coverage     94.03%   94.01%   -0.02%     
   + Complexity     4821     4819       -2     
   ============================================
     Files          1204     1204              
     Lines         48991    48993       +2     
     Branches       5956     5957       +1     
   ============================================
   - Hits          46067    46063       -4     
   - Misses         1458     1461       +3     
   - Partials       1466     1469       +3     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/texera/pull/8398/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/8398/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `81.00% <ø> (ø)` | | Carriedforward from [1cbe857](https://app.codecov.io/gh/apache/texera/commit/1cbe857007a6526c6087f187667ef3b3c9ade546?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/8398/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `99.32% <ø> (ø)` | | Carriedforward from [1cbe857](https://app.codecov.io/gh/apache/texera/commit/1cbe857007a6526c6087f187667ef3b3c9ade546?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/8398/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `89.88% <100.00%> (-0.04%)` | :arrow_down: | |
   | [computing-unit-managing-service](https://app.codecov.io/gh/apache/texera/pull/8398/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.67% <ø> (ø)` | | Carriedforward from [1cbe857](https://app.codecov.io/gh/apache/texera/commit/1cbe857007a6526c6087f187667ef3b3c9ade546?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/8398/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `87.12% <ø> (ø)` | | Carriedforward from [1cbe857](https://app.codecov.io/gh/apache/texera/commit/1cbe857007a6526c6087f187667ef3b3c9ade546?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/8398/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `87.91% <ø> (ø)` | | Carriedforward from [1cbe857](https://app.codecov.io/gh/apache/texera/commit/1cbe857007a6526c6087f187667ef3b3c9ade546?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/8398/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `96.79% <ø> (ø)` | | Carriedforward from [1cbe857](https://app.codecov.io/gh/apache/texera/commit/1cbe857007a6526c6087f187667ef3b3c9ade546?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/8398/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `83.57% <ø> (ø)` | | Carriedforward from [1cbe857](https://app.codecov.io/gh/apache/texera/commit/1cbe857007a6526c6087f187667ef3b3c9ade546?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/8398/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `98.47% <ø> (ø)` | | Carriedforward from [1cbe857](https://app.codecov.io/gh/apache/texera/commit/1cbe857007a6526c6087f187667ef3b3c9ade546?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/8398/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.19% <ø> (ø)` | | Carriedforward from [1cbe857](https://app.codecov.io/gh/apache/texera/commit/1cbe857007a6526c6087f187667ef3b3c9ade546?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/8398?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] fix(workflow): return 404 for missing workflow type [texera]

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

   I am working on this one


-- 
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] fix(workflow): return 404 for missing workflow type [texera]

Posted by "xuang7 (via GitHub)" <gi...@apache.org>.
xuang7 closed pull request #8398: fix(workflow): return 404 for missing workflow type
URL: https://github.com/apache/texera/pull/8398


-- 
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] fix(workflow): return 404 for missing workflow type [texera]

Posted by "VuMartin (via GitHub)" <gi...@apache.org>.
VuMartin commented on code in PR #8398:
URL: https://github.com/apache/texera/pull/8398#discussion_r3938830289


##########
amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala:
##########
@@ -848,6 +848,9 @@ class WorkflowResource extends LazyLogging {
   @Path("/type/{wid}")
   def getWorkflowType(@PathParam("wid") wid: Integer): String = {
     val workflow: Workflow = workflowDao.fetchOneByWid(wid)
+    if (workflow == null) {
+      throw new NotFoundException(s"Workflow with id $wid not found")

Review Comment:
   retrievePublicWorkflow is already covered by #8140, which is currently open. Since #8300 is the follow-up for the getWorkflowType issue identified during that review, should I leave the retrievePublicWorkflow fix scoped to #8140?



-- 
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] fix(workflow): return 404 for missing workflow type [texera]

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

   <!-- backport-auto-label-report -->
   ### Backport auto-label report
   
   This `fix:` PR was checked against each actively-supported release branch. `release/*` labels drive the post-merge backport, so add or remove one to change where this fix lands.
   
   | Release branch | Analysis |
   | --- | --- |
   | ✅ `release/v1.3` | Change detected on this branch — label added; this fix is queued to backport here. Requested review from @mengw15. |
   | ✅ `release/v1.2` | Change detected on this branch — label added; this fix is queued to backport here. Requested review from @xuang7. |
   
   _[Auto-label run](https://github.com/apache/texera/actions/runs/33847936579)._


-- 
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] fix(workflow): return 404 for missing workflow type [texera]

Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on code in PR #8398:
URL: https://github.com/apache/texera/pull/8398#discussion_r3939041724


##########
amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala:
##########
@@ -848,6 +848,9 @@ class WorkflowResource extends LazyLogging {
   @Path("/type/{wid}")
   def getWorkflowType(@PathParam("wid") wid: Integer): String = {
     val workflow: Workflow = workflowDao.fetchOneByWid(wid)
+    if (workflow == null) {
+      throw new NotFoundException(s"Workflow with id $wid not found")

Review Comment:
   Yes, keep it scoped to #8140. I checked before answering: #8140 is open, touches these same two files, and closes #8139, so the guard is tracked and landing on its own branch. Withdrawing this as a must-fix on your PR — nothing here needs to change.



##########
amber/src/test/scala/org/apache/texera/web/resource/dashboard/file/WorkflowResourceSpec.scala:
##########
@@ -947,6 +947,12 @@ class WorkflowResourceSpec
     assert(sizes.get(wid) == content.length)
   }
 
+  it should "return NotFoundException for a missing workflow type" in {

Review Comment:
   Verified: line 950 now reads `it should "throw NotFoundException for a missing workflow type"`, matching the sibling at 1059.



-- 
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] fix(workflow): return 404 for missing workflow type [texera]

Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on code in PR #8398:
URL: https://github.com/apache/texera/pull/8398#discussion_r3936820619


##########
amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala:
##########
@@ -848,6 +848,9 @@ class WorkflowResource extends LazyLogging {
   @Path("/type/{wid}")
   def getWorkflowType(@PathParam("wid") wid: Integer): String = {
     val workflow: Workflow = workflowDao.fetchOneByWid(wid)
+    if (workflow == null) {
+      throw new NotFoundException(s"Workflow with id $wid not found")

Review Comment:
   **Must fix:**
   
   `retrievePublicWorkflow` (891 to 897) takes the same path this guard removes. Its `.fetchOne()` returns null for a wid that is missing, deleted, or no longer public, and 897 dereferences it. That one is more reachable: the frontend calls it for shared public links (`workflow-persist.service.ts:47`), so such a link renders 500 instead of 404. Same three-line fix.



##########
amber/src/test/scala/org/apache/texera/web/resource/dashboard/file/WorkflowResourceSpec.scala:
##########
@@ -947,6 +947,12 @@ class WorkflowResourceSpec
     assert(sizes.get(wid) == content.length)
   }
 
+  it should "return NotFoundException for a missing workflow type" in {

Review Comment:
   **Polish:**
   
   The name says "return NotFoundException" while the body asserts a throw. The suite's own sibling case for the same exception reads "throw NotFoundException for a wid that does not exist" (line 1059).
   ```suggestion
     it should "throw NotFoundException for a missing workflow type" in {
   ```



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