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
14 changes: 4 additions & 10 deletions .github/scripts/detect_changed_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,11 @@ def main():
base_sha = os.getenv("BASE_SHA", "")
head_sha = os.getenv("HEAD_SHA", "")

# On push to main, test all packages
if event_name == "push":
packages = get_all_packages()
print(f"Push to main - testing all {len(packages)} packages:")
for pkg in packages:
print(f" - {pkg}")

# On PR with explicit SHAs, detect changed packages
elif event_name == "pull_request" and base_sha and head_sha:
# If we have explicit SHAs (from PR or push), detect changed packages
if base_sha and head_sha:
packages = get_changed_packages(base_sha, head_sha)
print(f"Pull request - detected {len(packages)} changed package(s):")
event_type = "pull request" if event_name == "pull_request" else "push"
print(f"{event_type.capitalize()} - detected {len(packages)} changed package(s):")
for pkg in packages:
print(f" - {pkg}")

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ jobs:

- name: Detect changed packages
id: detect
run: |
python .github/scripts/detect_changed_packages.py
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
HEAD_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.event.after }}
run: python .github/scripts/detect_changed_packages.py

discover-testcases:
needs: detect-changed-packages
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/lint-custom-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ jobs:

- name: Detect changed packages
id: detect
run: |
python .github/scripts/detect_changed_packages.py
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: python .github/scripts/detect_changed_packages.py

lint-with-custom-version:
name: Lint ${{ matrix.package }} - Custom Version
Expand Down
132 changes: 44 additions & 88 deletions .github/workflows/lint-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,120 +31,66 @@ jobs:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: python .github/scripts/detect_changed_packages.py

lint:
name: Lint ${{ matrix.package }}
needs: detect-changed-packages
if: needs.detect-changed-packages.outputs.count > 0 && !contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/${{ matrix.package }}
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.detect-changed-packages.outputs.packages) }}

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

- 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: "packages/${{ matrix.package }}/.python-version"

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

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"

# Per-package gate jobs that always run
lint-llamaindex:
name: Lint uipath-llamaindex
needs: detect-changed-packages
runs-on: ubuntu-latest
steps:
- name: Check if should skip
- name: Check if package changed
id: check
run: |
# Check for test-core-dev-version label
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'test-core-dev-version') }}" == "true" ]]; then
echo "changed=false" >> $GITHUB_OUTPUT
echo "skip=true" >> $GITHUB_OUTPUT
echo "reason=custom-version-testing" >> $GITHUB_OUTPUT
# Check if package changed
elif echo '${{ needs.detect-changed-packages.outputs.packages }}' | grep -q 'uipath-llamaindex'; then
echo "changed=true" >> $GITHUB_OUTPUT
elif echo '${{ needs.detect-changed-packages.outputs.packages }}' | jq -e 'index("uipath-llamaindex")' > /dev/null; then
echo "skip=false" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
echo "skip=true" >> $GITHUB_OUTPUT
echo "reason=no-changes" >> $GITHUB_OUTPUT
fi

- name: Skip if no changes or custom version testing
if: steps.check.outputs.changed != 'true'
- name: Skip
if: steps.check.outputs.skip == 'true'
run: |
if [[ "${{ steps.check.outputs.reason }}" == "custom-version-testing" ]]; then
echo "Custom version testing enabled - skipping lint"
echo "Skipping - custom version testing enabled"
else
echo "No changes to uipath-llamaindex, skipping lint"
echo "Skipping - no changes to uipath-llamaindex"
fi

- name: Checkout
if: steps.check.outputs.changed == 'true'
if: steps.check.outputs.skip != 'true'
uses: actions/checkout@v4

- name: Setup uv
if: steps.check.outputs.changed == 'true'
if: steps.check.outputs.skip != 'true'
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Setup Python
if: steps.check.outputs.changed == 'true'
if: steps.check.outputs.skip != 'true'
uses: actions/setup-python@v5
with:
python-version-file: "packages/uipath-llamaindex/.python-version"

- name: Install dependencies
if: steps.check.outputs.changed == 'true'
if: steps.check.outputs.skip != 'true'
working-directory: packages/uipath-llamaindex
run: uv sync --all-extras

- name: Check static types
if: steps.check.outputs.changed == 'true'
if: steps.check.outputs.skip != 'true'
working-directory: packages/uipath-llamaindex
run: uv run mypy --config-file pyproject.toml .

- name: Check linting
if: steps.check.outputs.changed == 'true'
if: steps.check.outputs.skip != 'true'
working-directory: packages/uipath-llamaindex
run: uv run ruff check .

- name: Check formatting
if: steps.check.outputs.changed == 'true'
if: steps.check.outputs.skip != 'true'
working-directory: packages/uipath-llamaindex
run: uv run ruff format --check .

Expand All @@ -153,62 +99,72 @@ jobs:
needs: detect-changed-packages
runs-on: ubuntu-latest
steps:
- name: Check if should skip
- name: Check if package changed
id: check
run: |
# Check for test-core-dev-version label
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'test-core-dev-version') }}" == "true" ]]; then
echo "changed=false" >> $GITHUB_OUTPUT
echo "skip=true" >> $GITHUB_OUTPUT
echo "reason=custom-version-testing" >> $GITHUB_OUTPUT
# Check if package changed
elif echo '${{ needs.detect-changed-packages.outputs.packages }}' | grep -q 'uipath-openai-agents'; then
echo "changed=true" >> $GITHUB_OUTPUT
elif echo '${{ needs.detect-changed-packages.outputs.packages }}' | jq -e 'index("uipath-openai-agents")' > /dev/null; then
echo "skip=false" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
echo "skip=true" >> $GITHUB_OUTPUT
echo "reason=no-changes" >> $GITHUB_OUTPUT
fi

- name: Skip if no changes or custom version testing
if: steps.check.outputs.changed != 'true'
- name: Skip
if: steps.check.outputs.skip == 'true'
run: |
if [[ "${{ steps.check.outputs.reason }}" == "custom-version-testing" ]]; then
echo "Custom version testing enabled - skipping lint"
echo "Skipping - custom version testing enabled"
else
echo "No changes to uipath-openai-agents, skipping lint"
echo "Skipping - no changes to uipath-openai-agents"
fi

- name: Checkout
if: steps.check.outputs.changed == 'true'
if: steps.check.outputs.skip != 'true'
uses: actions/checkout@v4

- name: Setup uv
if: steps.check.outputs.changed == 'true'
if: steps.check.outputs.skip != 'true'
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Setup Python
if: steps.check.outputs.changed == 'true'
if: steps.check.outputs.skip != 'true'
uses: actions/setup-python@v5
with:
python-version-file: "packages/uipath-openai-agents/.python-version"

- name: Install dependencies
if: steps.check.outputs.changed == 'true'
if: steps.check.outputs.skip != 'true'
working-directory: packages/uipath-openai-agents
run: uv sync --all-extras

- name: Check static types
if: steps.check.outputs.changed == 'true'
if: steps.check.outputs.skip != 'true'
working-directory: packages/uipath-openai-agents
run: uv run mypy --config-file pyproject.toml .

- name: Check linting
if: steps.check.outputs.changed == 'true'
if: steps.check.outputs.skip != 'true'
working-directory: packages/uipath-openai-agents
run: uv run ruff check .

- name: Check formatting
if: steps.check.outputs.changed == 'true'
if: steps.check.outputs.skip != 'true'
working-directory: packages/uipath-openai-agents
run: uv run ruff format --check .

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"
7 changes: 5 additions & 2 deletions .github/workflows/publish-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ jobs:

- name: Detect changed packages
id: detect
run: |
python .github/scripts/detect_changed_packages.py
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: python .github/scripts/detect_changed_packages.py

publish-dev:
name: Publish Dev Build - ${{ matrix.package }}
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ jobs:

- name: Detect changed packages
id: detect
run: |
python .github/scripts/detect_changed_packages.py
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
BASE_SHA: ${{ github.event.before }}
HEAD_SHA: ${{ github.event.after }}
run: python .github/scripts/detect_changed_packages.py

build:
name: Build ${{ matrix.package }}
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test-custom-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ jobs:

- name: Detect changed packages
id: detect
run: |
python .github/scripts/detect_changed_packages.py
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: python .github/scripts/detect_changed_packages.py

test-core-dev-version:
name: Test ${{ matrix.package }} - Custom Version
Expand Down
Loading