Skip to content

fix: forward hydration runtime delegate attributes#143

Closed
andreitava-uip wants to merge 2 commits into
mainfrom
fix/hydration-runtime-attribute-forwarding
Closed

fix: forward hydration runtime delegate attributes#143
andreitava-uip wants to merge 2 commits into
mainfrom
fix/hydration-runtime-attribute-forwarding

Conversation

@andreitava-uip

Copy link
Copy Markdown
Contributor

Summary

  • forward unknown HydrationRuntime attributes to the wrapped delegate runtime
  • add regression coverage for runtime_id-style delegate attributes

Validation

  • uv run ruff format src/uipath/runtime/workspace/hydration.py tests/workspace/test_workspace_hydration.py
  • uv run ruff check src/uipath/runtime/workspace/hydration.py tests/workspace/test_workspace_hydration.py
  • uv run mypy --config-file pyproject.toml .
  • uv run pytest tests/workspace/test_workspace_hydration.py
  • uv run pytest

Copilot AI review requested due to automatic review settings July 6, 2026 07:47
@andreitava-uip andreitava-uip requested a review from a team as a code owner July 6, 2026 07:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the HydrationRuntime wrapper so that runtime-specific “delegate attributes” (e.g., runtime_id) remain accessible through the wrapper instance, and adds a regression test intended to validate that behavior.

Changes:

  • Add HydrationRuntime.__getattr__ to forward unknown attribute access to the wrapped delegate runtime.
  • Extend workspace hydration tests with a regression case for “runtime_id-style” delegate attributes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/uipath/runtime/workspace/hydration.py Adds attribute forwarding to the wrapped runtime via __getattr__.
tests/workspace/test_workspace_hydration.py Adds a regression test for delegate attribute forwarding and updates the test runtime stub.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +261 to +276
def test_hydration_runtime_forwards_delegate_attributes(tmp_path: Path) -> None:
workspace = Workspace.create(tmp_path / "workspace")
delegate = WritingRuntime(workspace.path, UiPathRuntimeStatus.SUCCESSFUL)
runtime = HydrationRuntime(
delegate,
workspace=workspace,
hydrator=WorkspaceHydrator(
workspace_path=workspace.path,
attachments=FakeAttachments(),
),
registry_store=WorkspaceRegistryStore(MemoryStorage(), "runtime-1"),
)

forwarded_runtime = cast(Any, runtime)
assert forwarded_runtime.runtime_id == "runtime-1"
assert forwarded_runtime.workspace_path == workspace.path
Comment on lines +97 to +99
def __getattr__(self, name: str) -> Any:
"""Forward unknown attributes to the wrapped runtime."""
return getattr(self.delegate, name)
@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

@andreitava-uip andreitava-uip marked this pull request as draft July 6, 2026 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants