Skip to content

fix(frontend, v1.2): improve static error msgs to be user-friendly for unco… - #7012

Open
Yicong-Huang wants to merge 3 commits into
apache:release/v1.2from
Yicong-Huang:backport/6288-improve-static-error-msgs-to-be-user-fri-v1.2
Open

fix(frontend, v1.2): improve static error msgs to be user-friendly for unco… #7012
Yicong-Huang wants to merge 3 commits into
apache:release/v1.2from
Yicong-Huang:backport/6288-improve-static-error-msgs-to-be-user-fri-v1.2

Conversation

@Yicong-Huang

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Backport of #6288 to release/v1.2, cherry-picked from 8a51c56.

Source fix only. Test changes from #6288 were omitted (the touched specs do not exist on release/v1.2 or depend on main-only test infrastructure); only the source fix is carried over, per maintainer guidance.

Any related issues, documentation, discussions?

Backport of #6288. Originally linked #2735.

How was this PR tested?

Release-branch CI runs on this PR. Source change cherry-picked cleanly; test changes intentionally dropped.

Was this PR authored or co-authored using generative AI tooling?

Yes — backport prepared with Claude Code (mechanical cherry-pick + conflict resolution; the change itself is #6288 by its original author).

🤖 Generated with Claude Code

apache#6288)

### What changes were proposed in this PR?
This PR overhauls the static error validation and error messaging across
Texera operators to drastically improve the experience for new users
during workflow editing.

Previously, if a user dragged an operator (like `Projection`, `MySQL`,
or `CSV File Scan`) onto the canvas without configuring it yet, the
system would immediately throw intimidating and cryptic Java exceptions
(e.g., `IllegalArgumentException`, `SQLException: No suitable driver
found`, or `/texera (Is a directory)`).

Changes proposed:
1. **Frontend Global Catch-all**: Updated the regex logic in
`error-frame.component.ts` to cleanly strip internal Java prefixes (like
`java.lang.IllegalArgumentException:` or `requirement failed:`) so the
user only sees the human-readable part of the error message.
2. **Projection Operator**: Updated `ProjectionOpDesc` to explicitly
prompt the user to select an attribute.
3. **Database Sources**: Updated `SQLSourceOpDesc` (and
`AsterixDBSourceOpDesc`) to intercept empty database configuration
fields and return actionable UI instructions (e.g., "Please enter a
valid host name for the database in the properties panel").
4. **File Scan Sources**: Updated all file scan operators
(`ParallelCSV`, `JSONL`, `Arrow`, etc.) to gracefully catch directory
selections and missing files before attempting physical reads, replacing
IOExceptions with clear prompts to select a valid file from the
right-hand panel.

### Any related issues, documentation, discussions?
Issue#2735

### How was this PR tested?
Tested manually by rebuilding the `workflow-compiling-service` and
dragging every modified operator (Projection, MySQL, PostgreSQL,
AsterixDB, CSV, JSONL, Arrow) onto a new workflow canvas. Verified that
the Result Panel correctly displays the newly formatted, user-friendly
instructions instead of raw Java exceptions.

### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Antigravity (DeepMind)

**Tests:**
<img width="890" height="560" alt="WhatsApp Image 2026-07-09 at 12 56
49"
src="https://github.com/user-attachments/assets/4dd8f144-49c4-439f-be9b-89fbbfc6f8dd"
/>

--------------------------------------------------------------------------------------------------------------------------------------
<img width="1143" height="811" alt="image"
src="https://github.com/user-attachments/assets/463ec68b-636c-4ff9-ba65-f907f229c79d"
/>

--------------------------------------------------------------------------------------------------------------------------------------
<img width="1544" height="639" alt="image"
src="https://github.com/user-attachments/assets/923bc582-d825-4b15-8b00-6fff1f651642"
/>

--------------------------------------------------------------------------------------------------------------------------------------
<img width="1397" height="709" alt="image"
src="https://github.com/user-attachments/assets/731510a0-fba1-4a0f-86fd-12b2766e8e17"
/>

--------------------------------------------------------------------------------------------------------------------------------------

---------

(backported from commit 8a51c56)

Co-authored-by: probe <probe@x>
@Yicong-Huang Yicong-Huang added the release/v1.2 back porting to release/v1.2 label Jul 29, 2026
@Yicong-Huang
Yicong-Huang requested a review from xuang7 July 29, 2026 04:44
@github-actions github-actions Bot added engine frontend Changes related to the frontend GUI common platform Non-amber Scala service paths labels Jul 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @mengw15, @officialasishkumar
    You can notify them by mentioning @mengw15, @officialasishkumar in a comment.

@Yicong-Huang Yicong-Huang removed the release/v1.2 back porting to release/v1.2 label Jul 29, 2026
@codecov-commenter

codecov-commenter commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 31.57895% with 65 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.02%. Comparing base (1908ccd) to head (c28261a).

Files with missing lines Patch % Lines
...ra/amber/operator/source/sql/SQLSourceOpDesc.scala 0.00% 18 Missing ⚠️
...operator/source/scan/arrow/ArrowSourceOpDesc.scala 0.00% 15 Missing ⚠️
.../result-panel/error-frame/error-frame.component.ts 0.00% 14 Missing ⚠️
...rator/source/scan/json/JSONLScanSourceOpDesc.scala 0.00% 9 Missing ⚠️
...r/source/sql/asterixdb/AsterixDBSourceOpDesc.scala 0.00% 6 Missing ⚠️
...operator/source/scan/csv/CSVScanSourceOpDesc.scala 90.90% 0 Missing and 1 partial ⚠️
.../source/scan/csv/ParallelCSVScanSourceOpDesc.scala 90.90% 0 Missing and 1 partial ⚠️
...or/source/scan/csvOld/CSVOldScanSourceOpDesc.scala 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##             release/v1.2    #7012      +/-   ##
==================================================
- Coverage           54.08%   54.02%   -0.07%     
  Complexity           1447     1447              
==================================================
  Files                 809      809              
  Lines               34170    34236      +66     
  Branches             3450     3468      +18     
==================================================
+ Hits                18481    18496      +15     
- Misses              14777    14828      +51     
  Partials              912      912              
Flag Coverage Δ *Carryforward flag
access-control-service 64.35% <ø> (ø)
agent-service 34.36% <ø> (ø) Carriedforward from d3c4bea
amber 59.57% <37.03%> (-0.15%) ⬇️
computing-unit-managing-service 1.65% <ø> (ø)
config-service 56.06% <ø> (ø)
file-service 60.53% <ø> (ø)
frontend 47.29% <0.00%> (-0.04%) ⬇️
pyamber 90.94% <ø> (-0.09%) ⬇️ Carriedforward from d3c4bea
python 90.80% <ø> (ø) Carriedforward from d3c4bea
workflow-compiling-service 58.39% <ø> (-0.31%) ⬇️ Carriedforward from d3c4bea

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common engine frontend Changes related to the frontend GUI platform Non-amber Scala service paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants