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

   ### What changes were proposed in this PR?
   
   Covers the missing branch cases in the three workspace services. No 
production
   code was changed.
   
   **`UiUdfParametersParserService`** (+9) — the guards for degenerate sources:
   empty and whitespace-only input, a class with no body, an `open()` with no 
body,
   a single-statement `open()` (the trailing-separator ternary's empty arm), a
   declaration on a final line with no trailing newline, a call not reached 
through
   `self`, and a call with a positional argument after a named one. Also the
   identifier rules: punctuation-only, digit-leading, and Python-keyword names.
   
   **`ValidationWorkflowService`** (+3) — a stale operator id, an operator type 
with
   no schema, and the workflow validation error stream.
   
   **`SharedModelChangeHandler`** (+3) — the spec's 29 existing tests all 
originate
   locally, so `transaction.local === false` was never exercised. A second 
`Y.Doc`
   now stands in for a peer: mutating it and syncing the diff back produces a
   genuinely remote transaction (which `yDoc.transact` cannot fake). One test 
adds
   an operator remotely, another applies a remote property change and asserts 
the
   local-only awareness update does *not* run.
   
   Three of the cases the issue lists turned out not to be reachable through the
   public API; the tests assert the behaviour that actually happens instead, 
with a
   comment at each site:
   
   - The parser's `|| "parameter"` fallback cannot run: `\W` characters are each
     replaced with `_`, so a punctuation-only name yields `___`, and an empty 
name
     is rejected earlier by `computeParameterInsertion`.
   - `ValidationWorkflowService`'s `operator === undefined` guards are shadowed 
by
     the graph's own lookup, which throws `operator <id> does not exist` first.
   - Its `operatorSchema === undefined` guards are unreachable because
     `addOperator` rejects an unknown operator type at insertion time — so the 
test
     asserts that rejection.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7683
   
   ### How was this PR tested?
   
   Unit tests, run locally in `frontend/` (all green; failure paths were 
verified by
   breaking assertions to confirm the suites go red):
   
   ```
   ng test --watch=false --include .../ui-udf-parameters-parser.service.spec.ts 
  # 38 passed
   ng test --watch=false --include .../validation-workflow.service.spec.ts      
  # 10 passed
   ng test --watch=false --include .../shared-model-change-handler.spec.ts      
  # 31 passed
   prettier --write <specs>   # clean
   eslint  <specs>            # clean
   ```
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.8 [1M context])
   


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

Reply via email to