The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
ci: skip backend unit tests on ui-only PRs without stranding required checks (#32532)
devin-ai-integration[bot]45f9beed2ad2
diff --git a/.github/actions/detect-backend-changes/action.yml b/.github/actions/detect-backend-changes/action.ymlnew file mode 100644index 00000000000..af01038f294--- /dev/null+++ b/.github/actions/detect-backend-changes/action.yml@@ -0,0 +1,48 @@+name: "Detect backend-relevant changes"+description: >-+ Classify the pull request's changed files with .circleci/scripts/classify_changes.sh+ and expose decision=run|skip. decision=skip means only ui/**, **.md or **.mdx files+ changed, so callers can short-circuit expensive steps while the job still completes+ successfully and satisfies its required status check. The decision defaults to run for+ any non pull_request event or whenever the changed set cannot be resolved, so tests are+ never skipped when the classification is uncertain.++outputs:+ decision:+ description: "run when backend-relevant files changed, otherwise skip"+ value: ${{ steps.classify.outputs.decision }}++runs:+ using: composite+ steps:+ - id: classify+ shell: bash+ env:+ BASE_SHA: ${{ github.event.pull_request.base.sha }}+ run: |+ set -uo pipefail+ if [ -z "${BASE_SHA:-}" ]; then+ echo "detect-backend-changes: not a pull_request event; running job"+ echo "decision=run" >> "${GITHUB_OUTPUT}"+ exit 0+ fi+ if ! git fetch --no-tags --depth=1 origin "${BASE_SHA}" >/dev/null 2>&1; then+ echo "detect-backend-changes: could not fetch base ${BASE_SHA}; running job"+ echo "decision=run" >> "${GITHUB_OUTPUT}"+ exit 0+ fi+ changed="$(git diff --name-only "${BASE_SHA}" HEAD 2>/dev/null)" || {+ echo "detect-backend-changes: git diff failed; running job"+ echo "decision=run" >> "${GITHUB_OUTPUT}"+ exit 0+ }+ if [ -z "${changed}" ]; then+ echo "detect-backend-changes: no changed files vs ${BASE_SHA}; skipping job"+ echo "decision=skip" >> "${GITHUB_OUTPUT}"+ exit 0+ fi+ echo "detect-backend-changes: changed files vs ${BASE_SHA}:"+ printf '%s\n' "${changed}" | sed 's/^/ /'+ decision="$(printf '%s\n' "${changed}" | bash .circleci/scripts/classify_changes.sh backend)" || decision="run"+ echo "detect-backend-changes: decision=${decision}"+ echo "decision=${decision}" >> "${GITHUB_OUTPUT}"diff --git a/.github/workflows/_test-unit-base.yml b/.github/workflows/_test-unit-base.ymlindex 25c6d4a7019..9fd81b27f3b 100644--- a/.github/workflows/_test-unit-base.yml+++ b/.github/workflows/_test-unit-base.yml@@ -45,12 +45,18 @@ jobs:name: Run testsruns-on: ubuntu-latesttimeout-minutes: ${{ inputs.timeout-minutes }}+ outputs:+ decision: ${{ steps.changes.outputs.decision }}steps:- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0with:persist-credentials: false+ - name: Detect backend-relevant changes+ id: changes+ uses: ./.github/actions/detect-backend-changes+- name: Set up Pythonuses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0with:@@ -72,16 +78,19 @@ jobs:${{ runner.os }}-uv-- name: Install dependencies+ if: steps.changes.outputs.decision != 'skip'run: |.github/scripts/uv_sync_with_retries.sh --frozen --group ci --group proxy-dev --extra google --extra proxy --extra semantic-router- name: Generate Prisma client+ if: steps.changes.outputs.decision != 'skip'env:PRISMA_BINARY_CACHE_DIR: ${{ runner.temp }}/prisma-cacherun: |uv run --no-sync prisma generate --schema litellm/proxy/schema.prisma- name: Run tests+ if: steps.changes.outputs.decision != 'skip'env:TEST_PATH: ${{ inputs.test-path }}MAX_FAILURES: ${{ inputs.max-failures }}@@ -114,7 +123,7 @@ jobs:fi- name: Save coverage report- if: always()+ if: always() && steps.changes.outputs.decision != 'skip'uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1with:name: coverage-${{ inputs.artifact-name }}-${{ github.run_id }}-${{ github.run_attempt }}@@ -124,7 +133,7 @@ jobs:upload-coverage:name: Upload coverage to Codecovneeds: run- if: always()+ if: always() && needs.run.outputs.decision != 'skip'runs-on: ubuntu-latestpermissions:contents: readdiff --git a/.github/workflows/test-unit-documentation.yml b/.github/workflows/test-unit-documentation.ymlindex 4cef791a9b3..03f9f0a510b 100644--- a/.github/workflows/test-unit-documentation.yml+++ b/.github/workflows/test-unit-documentation.yml@@ -32,6 +32,10 @@ jobs:path: docs/my-websitepersist-credentials: false+ - name: Detect backend-relevant changes+ id: changes+ uses: ./.github/actions/detect-backend-changes+- name: Set up Pythonuses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0with:@@ -53,10 +57,12 @@ jobs:${{ runner.os }}-uv-- name: Install dependencies+ if: steps.changes.outputs.decision != 'skip'run: |.github/scripts/uv_sync_with_retries.sh --frozen --group ci --group proxy-dev --extra google --extra proxy --extra semantic-router- name: Generate Prisma client+ if: steps.changes.outputs.decision != 'skip'env:PRISMA_BINARY_CACHE_DIR: ${{ runner.temp }}/prisma-cacherun: |@@ -64,6 +70,7 @@ jobs:# Run the same documentation tests that CircleCI ran (as direct Python scripts)- name: Run documentation validation tests+ if: steps.changes.outputs.decision != 'skip'run: |uv run --no-sync python ./tests/documentation_tests/test_env_keys.pyuv run --no-sync python ./tests/documentation_tests/test_router_settings.pydiff --git a/.github/workflows/test-unit-proxy-legacy.yml b/.github/workflows/test-unit-proxy-legacy.ymlindex 8db218cd1fc..0068e80e584 100644--- a/.github/workflows/test-unit-proxy-legacy.yml+++ b/.github/workflows/test-unit-proxy-legacy.yml@@ -49,6 +49,10 @@ jobs:with:persist-credentials: false+ - name: Detect backend-relevant changes+ id: changes+ uses: ./.github/actions/detect-backend-changes+- name: Set up Pythonuses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0with:@@ -70,16 +74,19 @@ jobs:${{ runner.os }}-uv-- name: Install dependencies+ if: steps.changes.outputs.decision != 'skip'run: |.github/scripts/uv_sync_with_retries.sh --frozen --group ci --group proxy-dev --extra google --extra proxy --extra semantic-router- name: Generate Prisma client+ if: steps.changes.outputs.decision != 'skip'env:PRISMA_BINARY_CACHE_DIR: ${{ runner.temp }}/prisma-cacherun: |uv run --no-sync prisma generate --schema litellm/proxy/schema.prisma- name: Run tests - ${{ matrix.test-group.name }}+ if: steps.changes.outputs.decision != 'skip'env:TEST_PATH: ${{ matrix.test-group.path }}run: |