Skip to content

Commit c6ad791

Browse files
authored
Merge pull request #32 from UiPath/chore/use-core-hitl-methods
chore: use hitl methods from core
2 parents b8112e4 + 3b181fa commit c6ad791

8 files changed

Lines changed: 231 additions & 207 deletions

File tree

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Lint Custom Version
2+
3+
on:
4+
workflow_call:
5+
pull_request:
6+
types: [opened, synchronize, labeled, unlabeled]
7+
8+
jobs:
9+
lint-with-custom-version:
10+
name: Lint with Custom UiPath Version
11+
runs-on: ubuntu-latest
12+
if: contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')
13+
permissions:
14+
contents: read
15+
pull-requests: read
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Extract version from PR
22+
id: extract-version
23+
shell: bash
24+
run: |
25+
# Extract version from PR title only
26+
PR_TITLE="${{ github.event.pull_request.title }}"
27+
28+
# Search for version pattern in title (any x.y.z.dev version)
29+
VERSION=$(echo "$PR_TITLE" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.dev[0-9]+' | head -1)
30+
31+
if [ -z "$VERSION" ]; then
32+
echo "No version found in PR title. Please include version in title like: 2.0.65.dev1004030443"
33+
exit 1
34+
fi
35+
36+
echo "Extracted version: $VERSION"
37+
echo "version=$VERSION" >> $GITHUB_OUTPUT
38+
39+
- name: Setup uv
40+
uses: astral-sh/setup-uv@v5
41+
with:
42+
enable-cache: true
43+
44+
- name: Setup Python
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version-file: ".python-version"
48+
49+
- name: Modify pyproject.toml for custom UiPath version
50+
shell: bash
51+
run: |
52+
# Backup original pyproject.toml
53+
cp pyproject.toml pyproject.toml.backup
54+
55+
# Update the uipath dependency to the custom version
56+
sed -i 's|"uipath>=.*"|"uipath==${{ steps.extract-version.outputs.version }}"|' pyproject.toml
57+
58+
59+
60+
# Add or update [tool.uv.sources] section if it doesn't exist
61+
if ! grep -q "\[tool\.uv\.sources\]" pyproject.toml; then
62+
echo "" >> pyproject.toml
63+
echo "[tool.uv.sources]" >> pyproject.toml
64+
echo 'uipath = { index = "testpypi" }' >> pyproject.toml
65+
else
66+
# Update existing sources if needed
67+
if ! grep -q 'uipath = { index = "testpypi" }' pyproject.toml; then
68+
sed -i '/\[tool\.uv\.sources\]/a uipath = { index = "testpypi" }' pyproject.toml
69+
fi
70+
fi
71+
72+
echo "Modified pyproject.toml to use UiPath version ${{ steps.extract-version.outputs.version }} from testpypi"
73+
echo "=== Modified pyproject.toml content ==="
74+
grep -A5 -B5 "uipath\|testpypi" pyproject.toml || true
75+
76+
- name: Install dependencies
77+
run: uv sync --all-extras
78+
79+
- name: Check static types
80+
run: uv run mypy --config-file pyproject.toml .
81+
82+
- name: Check linting
83+
run: uv run ruff check .
84+
85+
- name: Check formatting
86+
run: uv run ruff format --check .
87+
88+
- name: Restore original pyproject.toml
89+
if: always()
90+
shell: bash
91+
run: |
92+
mv pyproject.toml.backup pyproject.toml

.github/workflows/lint.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,22 @@ on:
44
workflow_call
55

66
jobs:
7+
skip-lint:
8+
name: Skip Lint (Custom Version Testing)
9+
runs-on: ubuntu-latest
10+
if: contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')
11+
permissions:
12+
contents: read
13+
steps:
14+
- name: Skip lint for custom version testing
15+
run: |
16+
echo "Custom version testing enabled - skipping normal lint process"
17+
echo "This job completes successfully to allow PR merging"
18+
719
lint:
820
name: Lint
921
runs-on: ubuntu-latest
22+
if: "!contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')"
1023
permissions:
1124
contents: read
1225

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Test Custom Version
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
UIPATH_URL:
7+
required: true
8+
UIPATH_CLIENT_ID:
9+
required: true
10+
UIPATH_CLIENT_SECRET:
11+
required: true
12+
pull_request:
13+
types: [opened, synchronize, labeled, unlabeled]
14+
15+
jobs:
16+
test-core-dev-version:
17+
name: Test Core Dev Version
18+
runs-on: ${{ matrix.os }}
19+
if: contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')
20+
strategy:
21+
matrix:
22+
python-version: ["3.11", "3.12", "3.13"]
23+
os: [ubuntu-latest, windows-latest]
24+
25+
permissions:
26+
contents: read
27+
pull-requests: read
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Extract version from PR
34+
id: extract-version
35+
shell: bash
36+
run: |
37+
# Extract version from PR title only
38+
PR_TITLE="${{ github.event.pull_request.title }}"
39+
40+
# Search for version pattern in title (any x.y.z.dev version)
41+
VERSION=$(echo "$PR_TITLE" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.dev[0-9]+' | head -1)
42+
43+
if [ -z "$VERSION" ]; then
44+
echo "No version found in PR title. Please include version in title like: 2.0.65.dev1004030443"
45+
exit 1
46+
fi
47+
48+
echo "Extracted version: $VERSION"
49+
echo "version=$VERSION" >> $GITHUB_OUTPUT
50+
51+
- name: Setup uv
52+
uses: astral-sh/setup-uv@v5
53+
with:
54+
enable-cache: true
55+
56+
- name: Setup Python
57+
uses: actions/setup-python@v5
58+
with:
59+
python-version: ${{ matrix.python-version }}
60+
61+
- name: Modify pyproject.toml for custom UiPath version
62+
shell: bash
63+
run: |
64+
# Backup original pyproject.toml
65+
cp pyproject.toml pyproject.toml.backup
66+
67+
# Update the uipath dependency to the custom version
68+
sed -i 's|"uipath>=.*"|"uipath==${{ steps.extract-version.outputs.version }}"|' pyproject.toml
69+
70+
71+
72+
# Add or update [tool.uv.sources] section if it doesn't exist
73+
if ! grep -q "\[tool\.uv\.sources\]" pyproject.toml; then
74+
echo "" >> pyproject.toml
75+
echo "[tool.uv.sources]" >> pyproject.toml
76+
echo 'uipath = { index = "testpypi" }' >> pyproject.toml
77+
else
78+
# Update existing sources if needed
79+
if ! grep -q 'uipath = { index = "testpypi" }' pyproject.toml; then
80+
sed -i '/\[tool\.uv\.sources\]/a uipath = { index = "testpypi" }' pyproject.toml
81+
fi
82+
fi
83+
84+
echo "Modified pyproject.toml to use UiPath version ${{ steps.extract-version.outputs.version }} from testpypi"
85+
echo "=== Modified pyproject.toml content ==="
86+
grep -A5 -B5 "uipath\|testpypi" pyproject.toml || true
87+
88+
- name: Install dependencies with specific UiPath version
89+
run: uv sync --all-extras
90+
91+
- name: Run all tests
92+
run: uv run pytest
93+
env:
94+
UIPATH_URL: ${{ secrets.UIPATH_URL }}
95+
UIPATH_CLIENT_ID: ${{ secrets.UIPATH_CLIENT_ID }}
96+
UIPATH_CLIENT_SECRET: ${{ secrets.UIPATH_CLIENT_SECRET }}
97+
98+
- name: Restore original pyproject.toml
99+
if: always()
100+
shell: bash
101+
run: |
102+
mv pyproject.toml.backup pyproject.toml

.github/workflows/test.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,32 @@ jobs:
1616
contents: read
1717

1818
steps:
19+
# NOTE: Conditions are duplicated on each step instead of using job-level conditionals
20+
# because GitHub expects ALL matrix combinations to report back when using matrix strategies.
21+
# If we use job-level conditionals, matrix jobs won't run at all, leaving them in "pending"
22+
# state and blocking PR merging. Step-level conditionals allow all matrix jobs to start
23+
# and complete successfully, even when steps are skipped.
24+
1925
- name: Checkout
26+
if: "!contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')"
2027
uses: actions/checkout@v4
2128

2229
- name: Setup uv
30+
if: "!contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')"
2331
uses: astral-sh/setup-uv@v5
2432

2533
- name: Setup Python
34+
if: "!contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')"
2635
uses: actions/setup-python@v5
2736
with:
2837
python-version-file: ".python-version"
2938

3039
- name: Install dependencies
40+
if: "!contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')"
3141
run: uv sync --all-extras
3242

3343
- name: Run tests
44+
if: "!contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')"
3445
run: uv run pytest
3546

3647
continue-on-error: true

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-llamaindex"
3-
version = "0.0.24"
3+
version = "0.0.25"
44
description = "UiPath LlamaIndex SDK"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"
@@ -9,7 +9,7 @@ dependencies = [
99
"llama-index-embeddings-azure-openai>=0.3.8",
1010
"llama-index-llms-azure-openai>=0.3.2",
1111
"openinference-instrumentation-llama-index>=4.3.0",
12-
"uipath>=2.0.64",
12+
"uipath>=2.0.65, <2.1.0",
1313
]
1414
classifiers = [
1515
"Development Status :: 3 - Alpha",

0 commit comments

Comments
 (0)