carloea2 opened a new pull request, #9314: URL: https://github.com/apache/texera/pull/9314
### What changes were proposed in this PR? Reserve script-level R `for` iterators when generating a UI parameter variable. Previously, adding `count` before an existing `for (count in 1:3)` loop reused that binding and silently replaced the supplied parameter value with 3. The inserter now chooses `count_2` (or the next available suffix). Keep function-local iterators separate, including unbraced function bodies and lambda shorthand. Preserve expression boundaries so a helper function does not hide later script-level bindings. | Actual R SDK evaluation | Before | After | | --- | --- | --- | | Supplied UI parameter value | 42 | 42 | | Generated parameter variable after the loop | 3 | 42 | | Existing loop variable | 3 | 3 | ### Any related issues, documentation, discussions? Closes #9313. Follow-up to #9279, which merged before this fix was included. The loop-binding case was noted in its automated review overview. The companion runtime PR Texera/texera-rudf#2 has also merged. Native reproduction used the same R SDK file now present on its upstream `main` branch. ### How was this PR tested? - 7,109 frontend tests passed, one existing skip, with coverage on current upstream `main` plus this fix. - Parameter regression suites cover script-level loops, backtick names, suffix collisions, empty loops, helper functions, control blocks, and function-local loops. - Before the fix, four insertion regressions failed. Actual R 4.5.3 evaluation through the R SDK reproduced `42 -> 3`; the corrected generated declaration preserves 42 while the iterator remains 3. - Repository formatting, changed-file ESLint, and `git diff --check` passed. Full local frontend command, from `frontend/`, with `NG_BUILD_MAX_WORKERS=2`, `RAYON_NUM_THREADS=2`, and a temporary runner config merging the repository's Vitest config with only `test.maxWorkers=2`: ```sh node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng.js test --watch=false --progress=false --coverage --coverage-reporters=lcovonly --runner-config=/path/to/temporary/vitest-local.config.mts ``` Focused regressions: ```sh node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng.js test --watch=false --progress=false --include='src/app/workspace/service/code-editor/*ui*parameters*.spec.ts' --runner-config=/path/to/temporary/vitest-local.config.mts ``` ### Was this PR authored or co-authored using generative AI tooling? Generated-by: OpenAI Codex 0.166.0-alpha.5.1 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
