Skip to content

chore: use hitl methods from core #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 17, 2025
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
92 changes: 92 additions & 0 deletions .github/workflows/lint-custom-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Lint Custom Version

on:
workflow_call:
pull_request:
types: [opened, synchronize, labeled, unlabeled]

jobs:
lint-with-custom-version:
name: Lint with Custom UiPath Version
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')
permissions:
contents: read
pull-requests: read

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Extract version from PR
id: extract-version
shell: bash
run: |
# Extract version from PR title only
PR_TITLE="${{ github.event.pull_request.title }}"

# Search for version pattern in title (any x.y.z.dev version)
VERSION=$(echo "$PR_TITLE" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.dev[0-9]+' | head -1)

if [ -z "$VERSION" ]; then
echo "No version found in PR title. Please include version in title like: 2.0.65.dev1004030443"
exit 1
fi

echo "Extracted version: $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"

- name: Modify pyproject.toml for custom UiPath version
shell: bash
run: |
# Backup original pyproject.toml
cp pyproject.toml pyproject.toml.backup

# Update the uipath dependency to the custom version
sed -i 's|"uipath>=.*"|"uipath==${{ steps.extract-version.outputs.version }}"|' pyproject.toml



# Add or update [tool.uv.sources] section if it doesn't exist
if ! grep -q "\[tool\.uv\.sources\]" pyproject.toml; then
echo "" >> pyproject.toml
echo "[tool.uv.sources]" >> pyproject.toml
echo 'uipath = { index = "testpypi" }' >> pyproject.toml
else
# Update existing sources if needed
if ! grep -q 'uipath = { index = "testpypi" }' pyproject.toml; then
sed -i '/\[tool\.uv\.sources\]/a uipath = { index = "testpypi" }' pyproject.toml
fi
fi

echo "Modified pyproject.toml to use UiPath version ${{ steps.extract-version.outputs.version }} from testpypi"
echo "=== Modified pyproject.toml content ==="
grep -A5 -B5 "uipath\|testpypi" pyproject.toml || true

- name: Install dependencies
run: uv sync --all-extras

- name: Check static types
run: uv run mypy --config-file pyproject.toml .

- name: Check linting
run: uv run ruff check .

- name: Check formatting
run: uv run ruff format --check .

- name: Restore original pyproject.toml
if: always()
shell: bash
run: |
mv pyproject.toml.backup pyproject.toml
13 changes: 13 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@ on:
workflow_call

jobs:
skip-lint:
name: Skip Lint (Custom Version Testing)
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')
permissions:
contents: read
steps:
- name: Skip lint for custom version testing
run: |
echo "Custom version testing enabled - skipping normal lint process"
echo "This job completes successfully to allow PR merging"

lint:
name: Lint
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')"
permissions:
contents: read

Expand Down
102 changes: 102 additions & 0 deletions .github/workflows/test-custom-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Test Custom Version

on:
workflow_call:
secrets:
UIPATH_URL:
required: true
UIPATH_CLIENT_ID:
required: true
UIPATH_CLIENT_SECRET:
required: true
pull_request:
types: [opened, synchronize, labeled, unlabeled]

jobs:
test-core-dev-version:
name: Test Core Dev Version
runs-on: ${{ matrix.os }}
if: contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
os: [ubuntu-latest, windows-latest]

permissions:
contents: read
pull-requests: read

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Extract version from PR
id: extract-version
shell: bash
run: |
# Extract version from PR title only
PR_TITLE="${{ github.event.pull_request.title }}"

# Search for version pattern in title (any x.y.z.dev version)
VERSION=$(echo "$PR_TITLE" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.dev[0-9]+' | head -1)

if [ -z "$VERSION" ]; then
echo "No version found in PR title. Please include version in title like: 2.0.65.dev1004030443"
exit 1
fi

echo "Extracted version: $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Modify pyproject.toml for custom UiPath version
shell: bash
run: |
# Backup original pyproject.toml
cp pyproject.toml pyproject.toml.backup

# Update the uipath dependency to the custom version
sed -i 's|"uipath>=.*"|"uipath==${{ steps.extract-version.outputs.version }}"|' pyproject.toml



# Add or update [tool.uv.sources] section if it doesn't exist
if ! grep -q "\[tool\.uv\.sources\]" pyproject.toml; then
echo "" >> pyproject.toml
echo "[tool.uv.sources]" >> pyproject.toml
echo 'uipath = { index = "testpypi" }' >> pyproject.toml
else
# Update existing sources if needed
if ! grep -q 'uipath = { index = "testpypi" }' pyproject.toml; then
sed -i '/\[tool\.uv\.sources\]/a uipath = { index = "testpypi" }' pyproject.toml
fi
fi

echo "Modified pyproject.toml to use UiPath version ${{ steps.extract-version.outputs.version }} from testpypi"
echo "=== Modified pyproject.toml content ==="
grep -A5 -B5 "uipath\|testpypi" pyproject.toml || true

- name: Install dependencies with specific UiPath version
run: uv sync --all-extras

- name: Run all tests
run: uv run pytest
env:
UIPATH_URL: ${{ secrets.UIPATH_URL }}
UIPATH_CLIENT_ID: ${{ secrets.UIPATH_CLIENT_ID }}
UIPATH_CLIENT_SECRET: ${{ secrets.UIPATH_CLIENT_SECRET }}

- name: Restore original pyproject.toml
if: always()
shell: bash
run: |
mv pyproject.toml.backup pyproject.toml
11 changes: 11 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,32 @@ jobs:
contents: read

steps:
# NOTE: Conditions are duplicated on each step instead of using job-level conditionals
# because GitHub expects ALL matrix combinations to report back when using matrix strategies.
# If we use job-level conditionals, matrix jobs won't run at all, leaving them in "pending"
# state and blocking PR merging. Step-level conditionals allow all matrix jobs to start
# and complete successfully, even when steps are skipped.

- name: Checkout
if: "!contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')"
uses: actions/checkout@v4

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

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

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

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

continue-on-error: true
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-llamaindex"
version = "0.0.24"
version = "0.0.25"
description = "UiPath LlamaIndex SDK"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.10"
Expand All @@ -9,7 +9,7 @@ dependencies = [
"llama-index-embeddings-azure-openai>=0.3.8",
"llama-index-llms-azure-openai>=0.3.2",
"openinference-instrumentation-llama-index>=4.3.0",
"uipath>=2.0.64",
"uipath>=2.0.65, <2.1.0",
]
classifiers = [
"Development Status :: 3 - Alpha",
Expand Down
Loading