Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- main
- 'release/**'
paths:
- 'packages/*/pyproject.toml'
- '!packages/*/samples/**/pyproject.toml'
Expand All @@ -20,8 +21,8 @@ jobs:
detect-publishable-packages:
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.detect.outputs.packages }}
count: ${{ steps.detect.outputs.count }}
packages: ${{ steps.detect.outputs.packages || '[]' }}
count: ${{ steps.detect.outputs.count || '0' }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -33,6 +34,7 @@ jobs:

- name: Detect publishable packages
id: detect
if: ${{ !github.event.created }}
run: python .github/scripts/detect_publishable_packages.py

# --- Tier 0: uipath-core (no internal dependencies) ---
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- main
- 'release/**'

permissions:
contents: read
Expand All @@ -18,6 +19,8 @@ jobs:

test:
uses: ./.github/workflows/test-packages.yml
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

check-versions:
uses: ./.github/workflows/check-version-availability.yml
46 changes: 45 additions & 1 deletion .github/workflows/test-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Test Packages

on:
workflow_call:
secrets:
SONAR_TOKEN:
required: false

permissions:
contents: read
Expand Down Expand Up @@ -176,12 +179,53 @@ jobs:
run: uv sync --all-extras --python ${{ matrix.python-version }}

- name: Run tests
if: steps.check.outputs.skip != 'true'
if: steps.check.outputs.skip != 'true' && !(matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13')
working-directory: packages/uipath
run: uv run pytest

- name: Run tests with coverage
if: steps.check.outputs.skip != 'true' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
working-directory: packages/uipath
run: uv run pytest --cov-report=xml

- name: Upload coverage XML report
if: steps.check.outputs.skip != 'true' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' && always()
uses: actions/upload-artifact@v4
with:
name: coverage-xml-uipath
path: packages/uipath/coverage.xml
retention-days: 30

continue-on-error: true

sonarcloud:
name: SonarCloud
needs: [test-uipath-core, test-uipath-platform, test-uipath]
runs-on: ubuntu-latest
if: always() && needs.test-uipath-core.result != 'failure' && needs.test-uipath-platform.result != 'failure' && needs.test-uipath.result != 'failure'
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download uipath coverage
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: coverage-xml-uipath
path: packages/uipath

- name: Rewrite coverage XML <source> to repo-relative path
run: sed -i -E 's|<source>.*packages/uipath/src</source>\|<source>src</source>|<source>packages/uipath/src</source>|g' packages/uipath/coverage.xml || true

- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@2f77a1ec69fb1d595b06f35ab27e97605bdef703 # v5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

test-gate:
name: Test
needs: [test-uipath-core, test-uipath-platform, test-uipath]
Expand Down
2 changes: 1 addition & 1 deletion packages/uipath/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath"
version = "2.10.37"
version = "2.10.37.post1"
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
3 changes: 3 additions & 0 deletions packages/uipath/src/uipath/_cli/_debug/_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,9 @@ async def _handle_start(self, args: list[Any]) -> None:
f"Debug started: breakpoints={self.state.breakpoints}, step_mode={step_mode}"
)

# handle race conditions, runtime connected to debug bridge before the receiver
await self.emit_execution_started()
Comment on lines +744 to +745
Comment on lines +744 to +745

async def _handle_resume(self, args: list[Any]) -> None:
"""Handle Resume command from SignalR server.

Expand Down
40 changes: 40 additions & 0 deletions packages/uipath/tests/cli/chat/test_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,43 @@ async def test_send_with_datetime_does_not_raise(self) -> None:
assert parsed_data["message"] == "test message"
assert isinstance(parsed_data["timestamp"], str)
assert isinstance(parsed_data["nested"]["created_at"], str)

@pytest.mark.anyio
async def test_handle_start_emits_execution_started(self) -> None:
"""Start command applies breakpoints and re-emits ExecutionStarted."""
bridge = SignalRDebugBridge(
hub_url="wss://test.example.com/signalr",
access_token="test-token",
headers={},
)

mock_client = MagicMock()
mock_client.send = AsyncMock()
bridge._client = mock_client

await bridge._handle_start(
['{"breakpoints": ["node-a", "node-b"], "enableStepMode": true}']
)

assert bridge.state.breakpoints == {"node-a", "node-b"}
assert bridge.state.step_mode is True
mock_client.send.assert_awaited_once()
assert mock_client.send.call_args.kwargs["arguments"][0] == (
"OnExecutionStarted"
)

@pytest.mark.anyio
async def test_handle_start_with_empty_args_does_not_emit(self) -> None:
bridge = SignalRDebugBridge(
hub_url="wss://test.example.com/signalr",
access_token="test-token",
headers={},
)

mock_client = MagicMock()
mock_client.send = AsyncMock()
bridge._client = mock_client

await bridge._handle_start([])

mock_client.send.assert_not_awaited()
2 changes: 1 addition & 1 deletion packages/uipath/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sonar.projectKey=UiPath_uipath-python
sonar.organization=ui
sonar.host.url=https://sonarcloud.io

sonar.sources=packages/uipath/src,packages/uipath-core/src,packages/uipath-platform/src
sonar.tests=packages/uipath/tests,packages/uipath-core/tests,packages/uipath-platform/tests

sonar.python.version=3.11,3.12,3.13
sonar.python.coverage.reportPaths=packages/uipath/coverage.xml

sonar.exclusions=**/samples/**,**/testcases/**,**/template/**,**/_resources/**

sonar.sourceEncoding=UTF-8
Loading