Skip to content

fix(frontend): avoid R UI parameter binding collisions - #9314

Merged
kunwp1 merged 1 commit into
apache:mainfrom
carloea2:fix/r-ui-loop-bindings
Nov 10, 2026
Merged

kunwp1 merged 1 commit into
apache:mainfrom
carloea2:fix/r-ui-loop-bindings

Conversation

@carloea2

@carloea2 carloea2 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Reserve script-level R assignments and for iterators when generating a UI parameter variable. Braces do not create an R scope, and loops inside calls also bind their iterator in the script environment. These bindings now reserve their names regardless of nesting, so insertion chooses count_2 or the next available suffix.

Skip function bodies and keep named call arguments separate. Only = retains the argument-depth check; <-, <<-, ->, ->> and loop iterators are recognized inside blocks and calls.

Original R SDK reproduction:

Value Before After
Supplied UI parameter 42 42
Generated parameter variable after the existing loop 3 42
Existing loop iterator 3 3

Any related issues, documentation, discussions?

Closes #9313. Follow-up to #9279. The companion runtime PR Texera/texera-rudf#2 has merged.

How was this PR tested?

Retested on freshly fetched upstream main 1ec692c5da. The ten added binding regressions fail before the review correction and pass afterward. All 67 R parser tests pass, including controls for function-local bindings and named call arguments.

From frontend:

node --max-old-space-size=4096 node_modules/@angular/cli/bin/ng.js test --watch=false --progress=false --include=src/app/workspace/service/code-editor/r-ui-udf-parameters-parser.spec.ts
67 passed

node --max-old-space-size=4096 node_modules/@angular/cli/bin/ng.js test --watch=false --progress=false --coverage --coverage-reporters=lcovonly
7200 passed, 1 skipped across 253 files

corepack yarn format:fix
corepack yarn format:ci

Repository formatting, ESLint and git diff --check passed. The earlier native R 4.5.3 SDK reproduction of the original loop collision remains unchanged; this follow-up verified the new binding cases through the production frontend parser.

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

Generated-by: Codex (GPT-6)

@github-actions github-actions Bot added fix frontend Changes related to the frontend GUI labels Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. A release/* label nominates a backport target; the branch's release manager approving this PR is what sends the fix there. The required Backport Approvals check stays red until every label below is approved, so each manager either approves or removes their own label — which is why the labels left on a merged PR are exactly the branches it reached.

Release branch Analysis
⚠️ release/v1.3 Not labeled automatically — none of the files this PR modifies exist on this branch (frontend/src/app/workspace/service/code-editor/r-ui-udf-parameters-parser.spec.ts, frontend/src/app/workspace/service/code-editor/r-ui-udf-parameters-parser.ts). The fix may target code that isn't on this release, or the files were moved/renamed after the branch was cut. Please check and add release/v1.3 by hand if this fix should be backported here — its release manager then has to approve before this PR can merge.
⚠️ release/v1.2 Not labeled automatically — none of the files this PR modifies exist on this branch (frontend/src/app/workspace/service/code-editor/r-ui-udf-parameters-parser.spec.ts, frontend/src/app/workspace/service/code-editor/r-ui-udf-parameters-parser.ts). The fix may target code that isn't on this release, or the files were moved/renamed after the branch was cut. Please check and add release/v1.2 by hand if this fix should be backported here — its release manager then has to approve before this PR can merge.

Auto-label run.

@github-actions

github-actions Bot commented Nov 4, 2026

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.

@carloea2

carloea2 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/request-review @kunwp1

@codecov-commenter

codecov-commenter commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.30435% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.81%. Comparing base (1ec692c) to head (6a0c492).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../service/code-editor/r-ui-udf-parameters-parser.ts 91.30% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9314      +/-   ##
============================================
- Coverage     91.81%   91.81%   -0.01%     
  Complexity     5020     5020              
============================================
  Files          1277     1277              
  Lines         56369    56408      +39     
  Branches       7359     7378      +19     
============================================
+ Hits          51758    51793      +35     
- Misses         2758     2760       +2     
- Partials       1853     1855       +2     
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø) Carriedforward from 1ec692c
agent-service 99.53% <ø> (ø) Carriedforward from 1ec692c
amber 85.78% <ø> (ø) Carriedforward from 1ec692c
computing-unit-managing-service 64.05% <ø> (ø) Carriedforward from 1ec692c
config-service 87.73% <ø> (ø) Carriedforward from 1ec692c
file-service 82.31% <ø> (ø) Carriedforward from 1ec692c
frontend 96.53% <91.30%> (-0.02%) ⬇️
notebook-migration-service 83.77% <ø> (ø) Carriedforward from 1ec692c
pyamber 98.50% <ø> (ø) Carriedforward from 1ec692c
workflow-compiling-service 78.30% <ø> (ø) Carriedforward from 1ec692c

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

@kunwp1 kunwp1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@carloea2
carloea2 force-pushed the fix/r-ui-loop-bindings branch from 6a7efc7 to 6a0c492 Compare November 10, 2026 20:10
@carloea2 carloea2 changed the title fix(frontend): avoid R UI parameter loop collisions fix(frontend): avoid R UI parameter binding collisions Nov 10, 2026
@carloea2

Copy link
Copy Markdown
Contributor Author

@aglinxinyuan, the review changes are addressed and CI is green. Could you check the latest head and merge if ready?

@kunwp1
kunwp1 added this pull request to the merge queue Nov 10, 2026
Merged via the queue into apache:main with commit 4e14404 Nov 10, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

R UI parameter insertion can reuse script-level loop variables

3 participants