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

   ### What changes were proposed in this PR?
   
   `VFSURIFactory.decodeURI` returned a positional 4-tuple `(WorkflowIdentity, 
ExecutionIdentity, Option[GlobalPortIdentity], VFSResourceType)` in both Scala 
and Python, so its nine production call sites destructured positionally — 
mostly binding a single field through patterns like `val (_, _, _, 
resourceType) = decodeURI(uri)` — where nothing catches a swapped `_` position, 
and adding a field means touching every site. The Scala doc already advertised 
`@return A VFSUriComponents object`, but no such type existed.
   
   - **Scala**: introduce `case class VFSUriComponents(workflowId, executionId, 
globalPortId, resourceType)` in `VFSURIFactory.scala`; `decodeURI` now returns 
it. All six production call sites (`DocumentFactory` ×3, 
`ExecutionResultService` ×2, `WorkflowExecutionsResource` ×1) read named 
fields; the compiler forced every site to be updated, so none can be missed.
   - **Python**: introduce a matching `VFSUriComponents(NamedTuple)` in 
`vfs_uri_factory.py`; `decode_uri` returns it. A `NamedTuple` keeps positional 
unpacking working alongside named access, so this is non-breaking for any 
external unpacking. The three `document_factory.py` sites read `.resource_type`.
   - **Tests**: the Scala and Python suites' destructurings updated to named 
access; `test_document_factory`'s mocked `decode_uri` now returns a real 
`VFSUriComponents` (production accesses the result by name, so a bare tuple 
would no longer satisfy it).
   
   Pure refactor, no behavior change, symmetric across both languages.
   
   ### Any related issues, documentation, discussions?
   
   Closes #6979.
   
   ### How was this PR tested?
   
   - No new tests — the existing round-trip suites pin the decoded values in 
both languages, and the refactor is validated by them:
     - Scala: `VFSURIFactorySpec` 8/8, `WorkflowExecutionsResourceSpec` 22/22, 
`scalafmtCheck` (WorkflowCore + WorkflowExecutionService, main + Test) all pass 
locally.
     - Python: the two storage suites pass 21/21 locally; `ruff check` and 
`ruff format --check` clean.
   - The Scala side is additionally compile-verified: a tuple destructure of a 
case class does not compile, so every call site was necessarily updated.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (claude-opus-4-8)
   


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