Skip to content

fix(operator, v1.2): interpolate desc.url so failure message shows the URL - #6996

Open
Yicong-Huang wants to merge 1 commit into
release/v1.2from
backport/6800-interpolate-desc-url-so-failure-message-v1.2
Open

fix(operator, v1.2): interpolate desc.url so failure message shows the URL #6996
Yicong-Huang wants to merge 1 commit into
release/v1.2from
backport/6800-interpolate-desc-url-so-failure-message-v1.2

Conversation

@Yicong-Huang

@Yicong-Huang Yicong-Huang commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Backport of #6800 to release/v1.2, cherry-picked from 97f0fdb. The cherry-pick applied cleanly.

Follows the Direct Backport Push convention; opened as a PR (rather than a direct push) per a backport-coverage audit.

Any related issues, documentation, discussions?

Backport of #6800. Originally linked #6755.

How was this PR tested?

Release-branch CI runs on this PR. Cherry-pick applied cleanly onto release/v1.2; no manual conflict resolution was needed.

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

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

🤖 Generated with Claude Code

…6800)

### What changes were proposed in this PR?

Fixes a Scala string-interpolation bug in `URLFetcherOpExec`'s
fetch-failure fallback.

The failure branch built its message with `s"Fetch failed for URL:
$desc.url"`. In an `s"..."` interpolator, `$desc` expands only the
identifier `desc` (the `URLFetcherOpDesc` instance) and `.url` is
appended as literal text. Because `LogicalOp` overrides `toString` with
`ToStringBuilder.reflectionToString`, the resulting `URL content` cell
contained the entire descriptor dump instead of the URL:

```
Fetch failed for URL: org.apache.texera.amber.operator.source.fetcher.URLFetcherOpDesc@5624b9e8[decodingMethod=UTF_8,url=https://this-host-does-not-exist.invalid/x,dummyPropertyList=List(),inputPorts=<null>,operatorId=URLFetcherOpDesc-...,operatorVersion=N/A,outputPorts=<null>].url
```

This both malforms the message and leaks internal operator fields
(`operatorId`, `inputPorts`, `dummyPropertyList`, …) into user-facing
output.

The fix wraps the member access in braces so only `desc.url` is
interpolated:

```diff
-      case None => IOUtils.toInputStream(s"Fetch failed for URL: $desc.url", "UTF-8")
+      case None => IOUtils.toInputStream(s"Fetch failed for URL: ${desc.url}", "UTF-8")
```

Now the message reads as intended:

```
Fetch failed for URL: https://this-host-does-not-exist.invalid/x
```

### Any related issues, documentation, discussions?

Closes #6755

### How was this PR tested?

Added an automated regression test to `URLFetcherOpExecSpec` that
exercises the fetch-failure branch **offline and deterministically**:
pointing the operator at a `file://` URL for a nonexistent path makes
`URLFetchUtil.getInputStreamFromURL` return `None` with no network
dependency. The test asserts the fallback cell is exactly `Fetch failed
for URL: <url>` and does **not** contain the descriptor dump
(`URLFetcherOpDesc`, `operatorId`, …), so it fails on the pre-fix
`$desc.url` behavior and passes with the fix.

```
sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.source.fetcher.URLFetcherOpExecSpec"
...
Tests: succeeded 3, failed 0, canceled 0, ignored 0, pending 0
All tests passed.
```

Also reproduced end-to-end before the fix by pointing a **URL Fetcher**
operator at an unreachable address
(`https://this-host-does-not-exist.invalid/x`) and inspecting the `URL
content` output cell: it showed the full `URLFetcherOpDesc[...]` dump
followed by `.url`; after the fix it shows `Fetch failed for URL:
https://this-host-does-not-exist.invalid/x`.

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

Generated-by: Claude Code (Claude Opus 4.8)

---------

(backported from commit 97f0fdb)

Signed-off-by: Kary Zheng <150742834+kz930@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Xinyuan Lin <xinyual3@uci.edu>
Co-authored-by: Yicong Huang <17627829+Yicong-Huang@users.noreply.github.com>
@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:11
@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:

  • No candidates found from git blame history.

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

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.40%. Comparing base (fd5f487) to head (2643d77).
⚠️ Report is 2 commits behind head on release/v1.2.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@                Coverage Diff                 @@
##             release/v1.2    #6996      +/-   ##
==================================================
- Coverage           53.95%   52.40%   -1.56%     
- Complexity           1441     2493    +1052     
==================================================
  Files                 809     1077     +268     
  Lines               34144    42265    +8121     
  Branches             3448     4546    +1098     
==================================================
+ Hits                18421    22147    +3726     
- Misses              14815    18813    +3998     
- Partials              908     1305     +397     
Flag Coverage Δ *Carryforward flag
access-control-service 64.61% <ø> (ø)
agent-service 34.36% <ø> (ø) Carriedforward from fd5f487
amber 52.53% <100.00%> (-7.08%) ⬇️
computing-unit-managing-service 1.65% <ø> (ø)
config-service 56.06% <ø> (ø)
file-service 58.59% <ø> (ø)
frontend 47.19% <ø> (ø) Carriedforward from fd5f487
pyamber 90.87% <ø> (ø) Carriedforward from fd5f487
python 90.74% <ø> (ø) Carriedforward from fd5f487
workflow-compiling-service 58.69% <ø> (ø)

*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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants