Skip to content

MCP Client Configuration updated to multiple MCP client configurations #805

MCP Client Configuration updated to multiple MCP client configurations

MCP Client Configuration updated to multiple MCP client configurations #805

Workflow file for this run

# Workflow for running tests with targeted CI based on changed files
# spell-checker: disable
name: Test Suite
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
# Allows running this workflow manually
workflow_dispatch:
concurrency:
group: pytest-${{ github.ref }}
cancel-in-progress: true
jobs:
detect-changes:
if: github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
python-variants: ${{ steps.changes.outputs.python-variants }}
helm: ${{ steps.changes.outputs.helm }}
opentofu: ${{ steps.changes.outputs.opentofu }}
steps:
- name: Checkout Code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Detect changed files
id: changes
run: |
# workflow_dispatch → run everything
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo 'python-variants=["client","server"]' >> $GITHUB_OUTPUT
echo "helm=true" >> $GITHUB_OUTPUT
echo "opentofu=true" >> $GITHUB_OUTPUT
exit 0
fi
CHANGED=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..HEAD)
echo "Changed files:"
echo "$CHANGED"
# CI wiring shared by every job: changes here re-run all pipelines.
CI_INFRA_RE='^(\.github/workflows/pytest\.yml|\.github/actions/setup-helm/)'
# Python-specific shared paths (project metadata, lint config, common
# test/runtime modules, and the Python composite action).
PYTHON_INFRA_RE="^(pyproject\.toml|pytest\.ini|\.yamllint|src/tests/|src/_version\.py|src/logging_config\.py|\.github/actions/setup-python-uv/)|$CI_INFRA_RE"
CLIENT=false
SERVER=false
if echo "$CHANGED" | grep -qE "^src/client/|$PYTHON_INFRA_RE"; then
CLIENT=true
fi
if echo "$CHANGED" | grep -qE "^src/server/|$PYTHON_INFRA_RE"; then
SERVER=true
fi
VARIANTS="[]"
if [ "$CLIENT" = "true" ] && [ "$SERVER" = "true" ]; then
VARIANTS='["client","server"]'
elif [ "$CLIENT" = "true" ]; then
VARIANTS='["client"]'
elif [ "$SERVER" = "true" ]; then
VARIANTS='["server"]'
fi
echo "python-variants=$VARIANTS" >> $GITHUB_OUTPUT
# Helm — chart sources, the pytest contract suite, or CI wiring.
if echo "$CHANGED" | grep -qE "^helm/|^tests/helm/|$CI_INFRA_RE"; then
echo "helm=true" >> $GITHUB_OUTPUT
else
echo "helm=false" >> $GITHUB_OUTPUT
fi
# OpenTofu — module sources, the pytest suite, or CI wiring.
if echo "$CHANGED" | grep -qE "^opentofu/|^tests/opentofu/|$CI_INFRA_RE"; then
echo "opentofu=true" >> $GITHUB_OUTPUT
else
echo "opentofu=false" >> $GITHUB_OUTPUT
fi
- name: Verify docling versions match
if: steps.changes.outputs.python-variants != '[]' || steps.changes.outputs.opentofu == 'true'
run: |
PYPROJECT=$(grep -oP 'docling==\K[0-9.]+' pyproject.toml)
SERVER=$(grep -oP 'docling==\K[0-9.]+' src/server/Dockerfile)
CLIENT=$(grep -oP 'docling==\K[0-9.]+' src/Dockerfile)
CLOUDINIT=$(grep -oP 'docling==\K[0-9.]+' opentofu/modules/vm/templates/cloudinit-compute.tpl)
echo "pyproject.toml: $PYPROJECT"
echo "src/server/Dockerfile: $SERVER"
echo "src/Dockerfile: $CLIENT"
echo "opentofu/modules/vm/templates/cloudinit-compute.tpl: $CLOUDINIT"
if [ -z "$PYPROJECT" ] || [ -z "$SERVER" ] || [ -z "$CLIENT" ] || [ -z "$CLOUDINIT" ]; then
echo "::error::Failed to extract docling version from one or more files"
exit 1
fi
if [ "$PYPROJECT" != "$SERVER" ] || [ "$PYPROJECT" != "$CLIENT" ] || [ "$PYPROJECT" != "$CLOUDINIT" ]; then
echo "::error::docling version mismatch between pyproject.toml, Dockerfiles, and cloudinit-compute.tpl"
exit 1
fi
check-python:
needs: detect-changes
if: needs.detect-changes.outputs.python-variants != '[]'
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
variant: ${{ fromJSON(needs.detect-changes.outputs.python-variants) }}
name: check-${{ matrix.variant }}
steps:
- name: Checkout Code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Python + uv
uses: ./.github/actions/setup-python-uv
with:
extras: ${{ matrix.variant == 'server' && 'server,otel,dev' || format('{0},dev', matrix.variant) }}
cache-suffix: ${{ matrix.variant }}
- name: Run yamllint
run: yamllint src/${{ matrix.variant }}
- name: Run Pyright
run: pyright src/${{ matrix.variant }}
- name: Run Ruff
run: ruff check src/${{ matrix.variant }}
- name: Run Tests
run: >-
pytest src/${{ matrix.variant }}/tests src/tests -v
--junitxml=test-results-${{ matrix.variant }}.xml
--cov=src/${{ matrix.variant }}
--cov-report=xml:coverage-${{ matrix.variant }}.xml
--cov-report=term
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: test-results-${{ matrix.variant }}
path: |
test-results-${{ matrix.variant }}.xml
coverage-${{ matrix.variant }}.xml
check-helm:
needs: detect-changes
if: needs.detect-changes.outputs.helm == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.11"
- name: Install Python tooling
run: pip install yamllint pytest pyyaml requests
- uses: ./.github/actions/setup-helm
- name: Run yamllint
run: yamllint helm/
# Cache the rendered subchart tarballs in helm/charts/.
# Key on Chart.lock so the cache is invalidated exactly when the
# locked dependency version changes (the only time we want a miss).
- name: Cache helm subcharts
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: helm/charts
key: helm-charts-${{ hashFiles('helm/Chart.lock') }}
- name: Build chart dependencies
# Pulls subchart tarballs into helm/charts/. The repo-add is
# required because `helm dependency build` resolves by repository
# URL via `helm repo list`, not by fetching the URL directly.
# On a cache hit, this becomes a fast no-op verification.
run: |
helm repo add --force-update signoz https://charts.signoz.io
helm dependency build helm/
- name: Run Helm Lint (strict, with required values)
run: >-
helm lint --strict helm/
--set global.api.apiKey=test-api-key
--set client.cookieSecret=test-cookie-32-char-test-key-padding
- name: Run Helm Package (validate chart builds)
run: helm package helm/ --destination "$RUNNER_TEMP/helm-package"
env:
RUNNER_TEMP: ${{ runner.temp }}
# Render every example values file end-to-end. Catches regressions
# the lint+package pair can miss — e.g., a helper rename that breaks
# template resolution, or a schema tightening that rejects a shape
# the example files rely on.
- name: helm template against examples
run: |
shopt -s nullglob
failed=0
for f in helm/examples/*.yaml; do
echo "::group::$f"
if ! helm template ci helm/ \
--values "$f" \
--set global.api.apiKey=ci-test \
--set client.cookieSecret=ci-cookie-32-char-test-key-padding \
--set server.database.adb.skipCrdCheck=true >/dev/null; then
failed=1
fi
echo "::endgroup::"
done
exit "$failed"
# Validate the chart still renders at its declared Chart.yaml
# `kubeVersion` floor; a regression here would mean we've started
# using an API only available in a newer Kubernetes version.
- name: helm template at minimum kubeVersion (1.23.0)
run: >-
helm template ci helm/ --kube-version=1.23.0
--set global.api.apiKey=ci-test
--set client.cookieSecret=ci-cookie-32-char-test-key-padding
# Negative test: the schema must reject pinned-banned tags.
# Inverts the exit code so the step passes only when helm fails.
- name: values.schema.json rejects banned tag
run: |
if helm template ci helm/ \
--set server.image.tag=latest \
--set global.api.apiKey=ci-test \
--set client.cookieSecret=ci-cookie-32-char-test-key-padding \
>/dev/null 2>&1; then
echo "::error::values.schema.json no longer rejects image.tag=latest"
exit 1
fi
- name: Run Helm contract tests
run: pytest tests/helm/ -v
check-opentofu:
needs: detect-changes
if: needs.detect-changes.outputs.opentofu == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.11"
- name: Install Python tooling
run: pip install ruff pytest
- uses: ./.github/actions/setup-helm
- name: Run Ruff
run: ruff check opentofu
- name: Run cfgmgt pytest
# Exercises opentofu/cfgmgt/apply.py helpers (dep resolution, repo
# registration). Needs the helm binary because the helpers shell
# out to `helm dependency list/build/update`. pytest discovers only
# `test_*.py` so the non-test `validate_omr_schema.py` script in the
# same directory is not collected. Tests requiring tofu skip here
# and run in opentofu.yml's verify-iac-static instead.
run: pytest tests/opentofu/ -v
check:
needs:
- detect-changes
- check-python
- check-helm
- check-opentofu
if: always() && (github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Evaluate results
run: |
echo "detect-changes: ${{ needs.detect-changes.result }}"
echo "check-python: ${{ needs.check-python.result }}"
echo "check-helm: ${{ needs.check-helm.result }}"
echo "check-opentofu: ${{ needs.check-opentofu.result }}"
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
echo "One or more jobs failed"
exit 1
fi
echo "All jobs passed or were skipped"