mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-21 18:58:42 +00:00
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 7.1.4 to 7.1.6. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/astral-sh/setup-uv/releases">astral-sh/setup-uv's releases</a>.</em></p> <blockquote> <h2>v7.1.6 🌈 add OS version to cache key to prevent binary incompatibility</h2> <h2>Changes</h2> <p>This release will invalidate your cache existing keys!</p> <p>The os version e.g. <code>ubuntu-22.04</code> is now part of the cache key. This prevents failing builds when a cache got populated with wheels built with different tools (e.g. glibc) than are present on the runner where the cache got restored.</p> <h2>🐛 Bug fixes</h2> <ul> <li>feat: add OS version to cache key to prevent binary incompatibility <a href="https://github.com/eifinger"><code>@eifinger</code></a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/716">#716</a>)</li> </ul> <h2>🧰 Maintenance</h2> <ul> <li>chore: update known checksums for 0.9.17 @<a href="https://github.com/apps/github-actions">github-actions[bot]</a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/714">#714</a>)</li> </ul> <h2>⬆️ Dependency updates</h2> <ul> <li>Bump actions/checkout from 5.0.0 to 6.0.1 @<a href="https://github.com/apps/dependabot">dependabot[bot]</a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/712">#712</a>)</li> <li>Bump actions/setup-node from 6.0.0 to 6.1.0 @<a href="https://github.com/apps/dependabot">dependabot[bot]</a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/715">#715</a>)</li> </ul> <h2>v7.1.5 🌈 allow setting <code>cache-local-path</code> without <code>enable-cache: true</code></h2> <h2>Changes</h2> <p><a href="https://redirect.github.com/astral-sh/setup-uv/pull/612">astral-sh/setup-uv#612</a> fixed a faulty behavior where this action set <code>UV_CACHE_DIR</code> even though <code>enable-cache</code> was <code>false</code>. It also fixed the cases were the cache dir is already configured in a settings file like <code>pyproject.toml</code> or <code>UV_CACHE_DIR</code> was already set. Here the action shouldn't overwrite or set <code>UV_CACHE_DIR</code>.</p> <p>These fixes introduced an unwanted behavior: You can still set <code>cache-local-path</code> but this action didn't do anything. This release fixes that.</p> <p>You can now use <code>cache-local-path</code> to automatically set <code>UV_CACHE_DIR</code> even when <code>enable-cache</code> is <code>false</code> (or gets set to false by default e.g. on self-hosted runners)</p> <pre lang="yaml"><code>- name: This is now possible uses: astral-sh/setup-uv@v7 with: enable-cache: false cache-local-path: "/path/to/cache" </code></pre> <h2>🐛 Bug fixes</h2> <ul> <li>allow cache-local-path w/o enable-cache <a href="https://github.com/eifinger"><code>@eifinger</code></a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/707">#707</a>)</li> </ul> <h2>🧰 Maintenance</h2> <ul> <li>set biome files.maxSize to 2MiB <a href="https://github.com/eifinger"><code>@eifinger</code></a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/708">#708</a>)</li> <li>chore: update known checksums for 0.9.16 @<a href="https://github.com/apps/github-actions">github-actions[bot]</a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/706">#706</a>)</li> <li>chore: update known checksums for 0.9.15 @<a href="https://github.com/apps/github-actions">github-actions[bot]</a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/704">#704</a>)</li> <li>chore: use <code>npm ci --ignore-scripts</code> everywhere <a href="https://github.com/woodruffw"><code>@woodruffw</code></a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/699">#699</a>)</li> <li>chore: update known checksums for 0.9.14 @<a href="https://github.com/apps/github-actions">github-actions[bot]</a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/700">#700</a>)</li> <li>chore: update known checksums for 0.9.13 @<a href="https://github.com/apps/github-actions">github-actions[bot]</a> (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/694">#694</a>)</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="681c641aba"><code>681c641</code></a> Bump actions/checkout from 5.0.0 to 6.0.1 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/712">#712</a>)</li> <li><a href="2e85713bb0"><code>2e85713</code></a> Bump actions/setup-node from 6.0.0 to 6.1.0 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/715">#715</a>)</li> <li><a href="58b6d7b303"><code>58b6d7b</code></a> fix: add OS version to cache key to prevent binary incompatibility (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/716">#716</a>)</li> <li><a href="e8b52af86e"><code>e8b52af</code></a> chore: update known checksums for 0.9.17 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/714">#714</a>)</li> <li><a href="ed21f2f24f"><code>ed21f2f</code></a> Bump peter-evans/create-pull-request from 7.0.8 to 7.0.9 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/695">#695</a>)</li> <li><a href="93202d8fbe"><code>93202d8</code></a> bump dependencies (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/709">#709</a>)</li> <li><a href="5ce090076d"><code>5ce0900</code></a> set biome files.maxSize to 2MiB (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/708">#708</a>)</li> <li><a href="4180991cd9"><code>4180991</code></a> allow cache-local-path w/o enable-cache (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/707">#707</a>)</li> <li><a href="0439606c8e"><code>0439606</code></a> Bump github/codeql-action from 4.30.9 to 4.31.6 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/698">#698</a>)</li> <li><a href="7dd56c18e9"><code>7dd56c1</code></a> chore: update known checksums for 0.9.16 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/706">#706</a>)</li> <li>Additional commits viewable in <a href="1e862dfacb...681c641aba">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
578 lines
22 KiB
YAML
578 lines
22 KiB
YAML
name: Backward Compatibility Check
|
|
|
|
run-name: Check backward compatibility for config.yaml files
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- 'release-[0-9]+.[0-9]+.[0-9]+.[0-9]+'
|
|
- 'release-[0-9]+.[0-9]+.[0-9]+'
|
|
- 'release-[0-9]+.[0-9]+'
|
|
paths:
|
|
- 'src/llama_stack/core/datatypes.py'
|
|
- 'src/llama_stack/providers/datatypes.py'
|
|
- 'src/llama_stack/distributions/**/config.yaml'
|
|
- 'tests/backward_compat/**'
|
|
- '.github/workflows/backward-compat.yml'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
check-main-compatibility:
|
|
name: Check Compatibility with main
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout PR branch
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
with:
|
|
fetch-depth: 0 # Need full history to access main branch
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
|
|
with:
|
|
enable-cache: true
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
uv sync --group dev
|
|
|
|
- name: Extract config.yaml files from main branch
|
|
id: extract_configs
|
|
run: |
|
|
# Get list of config.yaml paths from main
|
|
git fetch origin main
|
|
CONFIG_PATHS=$(git ls-tree -r --name-only origin/main | grep "src/llama_stack/distributions/.*/config.yaml$" || true)
|
|
|
|
if [ -z "$CONFIG_PATHS" ]; then
|
|
echo "No config.yaml files found in main branch"
|
|
exit 1
|
|
fi
|
|
|
|
# Extract all configs to a temp directory
|
|
mkdir -p /tmp/main_configs
|
|
echo "Extracting configs from main branch:"
|
|
|
|
while IFS= read -r config_path; do
|
|
if [ -z "$config_path" ]; then
|
|
continue
|
|
fi
|
|
|
|
# Extract filename for storage
|
|
filename=$(basename $(dirname "$config_path"))
|
|
echo " - $filename (from $config_path)"
|
|
|
|
git show origin/main:"$config_path" > "/tmp/main_configs/${filename}.yaml"
|
|
done <<< "$CONFIG_PATHS"
|
|
|
|
echo ""
|
|
echo "Extracted $(ls /tmp/main_configs/*.yaml | wc -l) config files"
|
|
|
|
- name: Test all configs from main
|
|
id: test_configs
|
|
continue-on-error: true
|
|
run: |
|
|
# Run pytest once with all configs parameterized
|
|
if COMPAT_TEST_CONFIGS_DIR=/tmp/main_configs uv run pytest tests/backward_compat/test_run_config.py -v; then
|
|
echo "failed=false" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "failed=true" >> $GITHUB_OUTPUT
|
|
exit 1
|
|
fi
|
|
|
|
- name: Check for breaking change acknowledgment
|
|
id: check_ack
|
|
if: steps.test_configs.outputs.failed == 'true'
|
|
run: |
|
|
echo "Breaking changes detected. Checking for acknowledgment..."
|
|
|
|
# Check PR title for '!:' marker (conventional commits)
|
|
PR_TITLE="${{ github.event.pull_request.title }}"
|
|
if [[ "$PR_TITLE" =~ ^[a-z]+\!: ]]; then
|
|
echo "✓ Breaking change acknowledged in PR title"
|
|
echo "acknowledged=true" >> $GITHUB_OUTPUT
|
|
exit 0
|
|
fi
|
|
|
|
# Check commit messages for BREAKING CHANGE:
|
|
if git log origin/main..HEAD --format=%B | grep -q "BREAKING CHANGE:"; then
|
|
echo "✓ Breaking change acknowledged in commit message"
|
|
echo "acknowledged=true" >> $GITHUB_OUTPUT
|
|
exit 0
|
|
fi
|
|
|
|
echo "✗ Breaking change NOT acknowledged"
|
|
echo "acknowledged=false" >> $GITHUB_OUTPUT
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
- name: Evaluate results
|
|
if: always()
|
|
run: |
|
|
FAILED="${{ steps.test_configs.outputs.failed }}"
|
|
ACKNOWLEDGED="${{ steps.check_ack.outputs.acknowledged }}"
|
|
|
|
if [[ "$FAILED" == "true" ]]; then
|
|
if [[ "$ACKNOWLEDGED" == "true" ]]; then
|
|
echo ""
|
|
echo "⚠️ WARNING: Breaking changes detected but acknowledged"
|
|
echo ""
|
|
echo "This PR introduces backward-incompatible changes to config.yaml."
|
|
echo "The changes have been properly acknowledged."
|
|
echo ""
|
|
exit 0 # Pass the check
|
|
else
|
|
echo ""
|
|
echo "❌ ERROR: Breaking changes detected without acknowledgment"
|
|
echo ""
|
|
echo "This PR introduces backward-incompatible changes to config.yaml"
|
|
echo "that will break existing user configurations."
|
|
echo ""
|
|
echo "To acknowledge this breaking change, do ONE of:"
|
|
echo " 1. Add '!:' to your PR title (e.g., 'feat!: change xyz')"
|
|
echo " 2. Add the 'breaking-change' label to this PR"
|
|
echo " 3. Include 'BREAKING CHANGE:' in a commit message"
|
|
echo ""
|
|
exit 1 # Fail the check
|
|
fi
|
|
fi
|
|
|
|
test-integration-main:
|
|
name: Run Integration Tests with main Config
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout PR branch
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Extract ci-tests config.yaml from main
|
|
run: |
|
|
git fetch origin main
|
|
git show origin/main:src/llama_stack/distributions/ci-tests/config.yaml > /tmp/main-ci-tests-config.yaml
|
|
echo "Extracted ci-tests config.yaml from main branch"
|
|
|
|
- name: Setup test environment
|
|
uses: ./.github/actions/setup-test-environment
|
|
with:
|
|
python-version: '3.12'
|
|
client-version: 'latest'
|
|
setup: 'ollama'
|
|
suite: 'base'
|
|
inference-mode: 'replay'
|
|
|
|
- name: Run integration tests with main config
|
|
id: test_integration
|
|
continue-on-error: true
|
|
uses: ./.github/actions/run-and-record-tests
|
|
with:
|
|
stack-config: /tmp/main-ci-tests-config.yaml
|
|
setup: 'ollama'
|
|
inference-mode: 'replay'
|
|
suite: 'base'
|
|
|
|
- name: Check for breaking change acknowledgment
|
|
id: check_ack
|
|
if: steps.test_integration.outcome == 'failure'
|
|
run: |
|
|
echo "Integration tests failed. Checking for acknowledgment..."
|
|
|
|
# Check PR title for '!:' marker (conventional commits)
|
|
PR_TITLE="${{ github.event.pull_request.title }}"
|
|
if [[ "$PR_TITLE" =~ ^[a-z]+\!: ]]; then
|
|
echo "✓ Breaking change acknowledged in PR title"
|
|
echo "acknowledged=true" >> $GITHUB_OUTPUT
|
|
exit 0
|
|
fi
|
|
|
|
# Check commit messages for BREAKING CHANGE:
|
|
if git log origin/main..HEAD --format=%B | grep -q "BREAKING CHANGE:"; then
|
|
echo "✓ Breaking change acknowledged in commit message"
|
|
echo "acknowledged=true" >> $GITHUB_OUTPUT
|
|
exit 0
|
|
fi
|
|
|
|
echo "✗ Breaking change NOT acknowledged"
|
|
echo "acknowledged=false" >> $GITHUB_OUTPUT
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
- name: Evaluate integration test results
|
|
if: always()
|
|
run: |
|
|
TEST_FAILED="${{ steps.test_integration.outcome == 'failure' }}"
|
|
ACKNOWLEDGED="${{ steps.check_ack.outputs.acknowledged }}"
|
|
|
|
if [[ "$TEST_FAILED" == "true" ]]; then
|
|
if [[ "$ACKNOWLEDGED" == "true" ]]; then
|
|
echo ""
|
|
echo "⚠️ WARNING: Integration tests failed with main config but acknowledged"
|
|
echo ""
|
|
exit 0 # Pass the check
|
|
else
|
|
echo ""
|
|
echo "❌ ERROR: Integration tests failed with main config without acknowledgment"
|
|
echo ""
|
|
echo "To acknowledge this breaking change, do ONE of:"
|
|
echo " 1. Add '!:' to your PR title (e.g., 'feat!: change xyz')"
|
|
echo " 2. Include 'BREAKING CHANGE:' in a commit message"
|
|
echo ""
|
|
exit 1 # Fail the check
|
|
fi
|
|
fi
|
|
|
|
test-integration-release:
|
|
name: Run Integration Tests with Latest Release (Informational)
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout PR branch
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Get latest release
|
|
id: get_release
|
|
run: |
|
|
# Get the latest release from GitHub
|
|
LATEST_TAG=$(gh release list --limit 1 --json tagName --jq '.[0].tagName' 2>/dev/null || echo "")
|
|
|
|
if [ -z "$LATEST_TAG" ]; then
|
|
echo "No releases found, skipping release compatibility check"
|
|
echo "has_release=false" >> $GITHUB_OUTPUT
|
|
exit 0
|
|
fi
|
|
|
|
echo "Latest release: $LATEST_TAG"
|
|
echo "has_release=true" >> $GITHUB_OUTPUT
|
|
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
- name: Extract ci-tests config.yaml from release
|
|
if: steps.get_release.outputs.has_release == 'true'
|
|
id: extract_config
|
|
run: |
|
|
RELEASE_TAG="${{ steps.get_release.outputs.tag }}"
|
|
|
|
# Try with src/ prefix first (newer releases), then without (older releases)
|
|
if git show "$RELEASE_TAG:src/llama_stack/distributions/ci-tests/config.yaml" > /tmp/release-ci-tests-config.yaml 2>/dev/null; then
|
|
echo "Extracted ci-tests config.yaml from release $RELEASE_TAG (src/ path)"
|
|
echo "has_config=true" >> $GITHUB_OUTPUT
|
|
elif git show "$RELEASE_TAG:llama_stack/distributions/ci-tests/config.yaml" > /tmp/release-ci-tests-config.yaml 2>/dev/null; then
|
|
echo "Extracted ci-tests config.yaml from release $RELEASE_TAG (old path)"
|
|
echo "has_config=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "::warning::ci-tests/config.yaml not found in release $RELEASE_TAG"
|
|
echo "has_config=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Setup test environment
|
|
if: steps.get_release.outputs.has_release == 'true' && steps.extract_config.outputs.has_config == 'true'
|
|
uses: ./.github/actions/setup-test-environment
|
|
with:
|
|
python-version: '3.12'
|
|
client-version: 'latest'
|
|
setup: 'ollama'
|
|
suite: 'base'
|
|
inference-mode: 'replay'
|
|
|
|
- name: Run integration tests with release config (PR branch)
|
|
id: test_release_pr
|
|
if: steps.get_release.outputs.has_release == 'true' && steps.extract_config.outputs.has_config == 'true'
|
|
continue-on-error: true
|
|
uses: ./.github/actions/run-and-record-tests
|
|
with:
|
|
stack-config: /tmp/release-ci-tests-config.yaml
|
|
setup: 'ollama'
|
|
inference-mode: 'replay'
|
|
suite: 'base'
|
|
|
|
- name: Checkout main branch to test baseline
|
|
if: steps.get_release.outputs.has_release == 'true' && steps.extract_config.outputs.has_config == 'true'
|
|
run: |
|
|
git checkout origin/main
|
|
|
|
- name: Setup test environment for main
|
|
if: steps.get_release.outputs.has_release == 'true' && steps.extract_config.outputs.has_config == 'true'
|
|
uses: ./.github/actions/setup-test-environment
|
|
with:
|
|
python-version: '3.12'
|
|
client-version: 'latest'
|
|
setup: 'ollama'
|
|
suite: 'base'
|
|
inference-mode: 'replay'
|
|
|
|
- name: Run integration tests with release config (main branch)
|
|
id: test_release_main
|
|
if: steps.get_release.outputs.has_release == 'true' && steps.extract_config.outputs.has_config == 'true'
|
|
continue-on-error: true
|
|
uses: ./.github/actions/run-and-record-tests
|
|
with:
|
|
stack-config: /tmp/release-ci-tests-config.yaml
|
|
setup: 'ollama'
|
|
inference-mode: 'replay'
|
|
suite: 'base'
|
|
|
|
- name: Report results and post PR comment
|
|
if: always() && steps.get_release.outputs.has_release == 'true' && steps.extract_config.outputs.has_config == 'true'
|
|
run: |
|
|
RELEASE_TAG="${{ steps.get_release.outputs.tag }}"
|
|
PR_OUTCOME="${{ steps.test_release_pr.outcome }}"
|
|
MAIN_OUTCOME="${{ steps.test_release_main.outcome }}"
|
|
|
|
if [[ "$PR_OUTCOME" == "failure" && "$MAIN_OUTCOME" == "success" ]]; then
|
|
# NEW breaking change - PR fails but main passes
|
|
echo "::error::🚨 This PR introduces a NEW breaking change!"
|
|
|
|
# Check if we already posted a comment (to avoid spam on every push)
|
|
EXISTING_COMMENT=$(gh pr view ${{ github.event.pull_request.number }} --json comments --jq '.comments[] | select(.body | contains("🚨 New Breaking Change Detected") and contains("Integration tests")) | .id' | head -1)
|
|
|
|
if [[ -z "$EXISTING_COMMENT" ]]; then
|
|
gh pr comment ${{ github.event.pull_request.number }} --body "## 🚨 New Breaking Change Detected
|
|
|
|
**Integration tests against release \`$RELEASE_TAG\` are now failing**
|
|
|
|
⚠️ This PR introduces a breaking change that affects compatibility with the latest release.
|
|
|
|
- Users on release \`$RELEASE_TAG\` may not be able to upgrade
|
|
- Existing configurations may break
|
|
|
|
The tests pass on \`main\` but fail with this PR's changes.
|
|
|
|
> **Note:** This is informational only and does not block merge.
|
|
> Consider whether this breaking change is acceptable for users."
|
|
else
|
|
echo "Comment already exists, skipping to avoid spam"
|
|
fi
|
|
|
|
cat >> $GITHUB_STEP_SUMMARY <<EOF
|
|
## 🚨 NEW Breaking Change Detected
|
|
|
|
**Integration tests against release \`$RELEASE_TAG\` FAILED**
|
|
|
|
⚠️ **This PR introduces a NEW breaking change**
|
|
|
|
- Tests **PASS** on main branch ✅
|
|
- Tests **FAIL** on PR branch ❌
|
|
- Users on release \`$RELEASE_TAG\` may not be able to upgrade
|
|
- Existing configurations may break
|
|
|
|
> **Note:** This is informational only and does not block merge.
|
|
> Consider whether this breaking change is acceptable for users.
|
|
EOF
|
|
|
|
elif [[ "$PR_OUTCOME" == "failure" ]]; then
|
|
# Existing breaking change - both PR and main fail
|
|
echo "::warning::Breaking change already exists in main branch"
|
|
|
|
cat >> $GITHUB_STEP_SUMMARY <<EOF
|
|
## ⚠️ Release Compatibility Test Failed (Existing Issue)
|
|
|
|
**Integration tests against release \`$RELEASE_TAG\` FAILED**
|
|
|
|
- Tests **FAIL** on main branch ❌
|
|
- Tests **FAIL** on PR branch ❌
|
|
- This breaking change already exists in main (not introduced by this PR)
|
|
|
|
> **Note:** This is informational only.
|
|
EOF
|
|
|
|
else
|
|
# Success - tests pass
|
|
cat >> $GITHUB_STEP_SUMMARY <<EOF
|
|
## ✅ Release Compatibility Test Passed
|
|
|
|
Integration tests against release \`$RELEASE_TAG\` passed successfully.
|
|
This PR maintains compatibility with the latest release.
|
|
EOF
|
|
fi
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
check-schema-release-compatibility:
|
|
name: Check Schema Compatibility with Latest Release (Informational)
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout PR branch
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
|
|
with:
|
|
enable-cache: true
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
uv sync --group dev
|
|
|
|
- name: Get latest release
|
|
id: get_release
|
|
run: |
|
|
# Get the latest release from GitHub
|
|
LATEST_TAG=$(gh release list --limit 1 --json tagName --jq '.[0].tagName' 2>/dev/null || echo "")
|
|
|
|
if [ -z "$LATEST_TAG" ]; then
|
|
echo "No releases found, skipping release compatibility check"
|
|
echo "has_release=false" >> $GITHUB_OUTPUT
|
|
exit 0
|
|
fi
|
|
|
|
echo "Latest release: $LATEST_TAG"
|
|
echo "has_release=true" >> $GITHUB_OUTPUT
|
|
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
- name: Extract configs from release
|
|
if: steps.get_release.outputs.has_release == 'true'
|
|
id: extract_release_configs
|
|
run: |
|
|
RELEASE_TAG="${{ steps.get_release.outputs.tag }}"
|
|
|
|
# Get config.yaml files from the release (try both src/ and old path)
|
|
CONFIG_PATHS=$(git ls-tree -r --name-only "$RELEASE_TAG" | grep "llama_stack/distributions/.*/config.yaml$" || true)
|
|
|
|
if [ -z "$CONFIG_PATHS" ]; then
|
|
echo "::warning::No config.yaml files found in release $RELEASE_TAG"
|
|
echo "has_configs=false" >> $GITHUB_OUTPUT
|
|
exit 0
|
|
fi
|
|
|
|
# Extract all configs to a temp directory
|
|
mkdir -p /tmp/release_configs
|
|
echo "Extracting configs from release $RELEASE_TAG:"
|
|
|
|
while IFS= read -r config_path; do
|
|
if [ -z "$config_path" ]; then
|
|
continue
|
|
fi
|
|
|
|
filename=$(basename $(dirname "$config_path"))
|
|
echo " - $filename (from $config_path)"
|
|
|
|
git show "$RELEASE_TAG:$config_path" > "/tmp/release_configs/${filename}.yaml" 2>/dev/null || true
|
|
done <<< "$CONFIG_PATHS"
|
|
|
|
echo ""
|
|
echo "Extracted $(ls /tmp/release_configs/*.yaml 2>/dev/null | wc -l) config files"
|
|
echo "has_configs=true" >> $GITHUB_OUTPUT
|
|
|
|
- name: Test against release configs (PR branch)
|
|
id: test_schema_pr
|
|
if: steps.get_release.outputs.has_release == 'true' && steps.extract_release_configs.outputs.has_configs == 'true'
|
|
continue-on-error: true
|
|
run: |
|
|
RELEASE_TAG="${{ steps.get_release.outputs.tag }}"
|
|
COMPAT_TEST_CONFIGS_DIR=/tmp/release_configs uv run pytest tests/backward_compat/test_run_config.py -v --tb=short
|
|
|
|
- name: Checkout main branch to test baseline
|
|
if: steps.get_release.outputs.has_release == 'true' && steps.extract_release_configs.outputs.has_configs == 'true'
|
|
run: |
|
|
git checkout origin/main
|
|
|
|
- name: Install dependencies for main
|
|
if: steps.get_release.outputs.has_release == 'true' && steps.extract_release_configs.outputs.has_configs == 'true'
|
|
run: |
|
|
uv sync --group dev
|
|
|
|
- name: Test against release configs (main branch)
|
|
id: test_schema_main
|
|
if: steps.get_release.outputs.has_release == 'true' && steps.extract_release_configs.outputs.has_configs == 'true'
|
|
continue-on-error: true
|
|
run: |
|
|
RELEASE_TAG="${{ steps.get_release.outputs.tag }}"
|
|
COMPAT_TEST_CONFIGS_DIR=/tmp/release_configs uv run pytest tests/backward_compat/test_run_config.py -v --tb=short
|
|
|
|
- name: Report results and post PR comment
|
|
if: always() && steps.get_release.outputs.has_release == 'true' && steps.extract_release_configs.outputs.has_configs == 'true'
|
|
run: |
|
|
RELEASE_TAG="${{ steps.get_release.outputs.tag }}"
|
|
PR_OUTCOME="${{ steps.test_schema_pr.outcome }}"
|
|
MAIN_OUTCOME="${{ steps.test_schema_main.outcome }}"
|
|
|
|
if [[ "$PR_OUTCOME" == "failure" && "$MAIN_OUTCOME" == "success" ]]; then
|
|
# NEW breaking change - PR fails but main passes
|
|
echo "::error::🚨 This PR introduces a NEW schema breaking change!"
|
|
|
|
# Check if we already posted a comment (to avoid spam on every push)
|
|
EXISTING_COMMENT=$(gh pr view ${{ github.event.pull_request.number }} --json comments --jq '.comments[] | select(.body | contains("🚨 New Schema Breaking Change Detected")) | .id' | head -1)
|
|
|
|
if [[ -z "$EXISTING_COMMENT" ]]; then
|
|
gh pr comment ${{ github.event.pull_request.number }} --body "## 🚨 New Schema Breaking Change Detected
|
|
|
|
**Schema validation against release \`$RELEASE_TAG\` is now failing**
|
|
|
|
⚠️ This PR introduces a schema breaking change that affects compatibility with the latest release.
|
|
|
|
- Users on release \`$RELEASE_TAG\` will not be able to upgrade
|
|
- Existing config.yaml configurations will fail validation
|
|
|
|
The tests pass on \`main\` but fail with this PR's changes.
|
|
|
|
> **Note:** This is informational only and does not block merge.
|
|
> Consider whether this breaking change is acceptable for users."
|
|
else
|
|
echo "Comment already exists, skipping to avoid spam"
|
|
fi
|
|
|
|
cat >> $GITHUB_STEP_SUMMARY <<EOF
|
|
## 🚨 NEW Schema Breaking Change Detected
|
|
|
|
**Schema validation against release \`$RELEASE_TAG\` FAILED**
|
|
|
|
⚠️ **This PR introduces a NEW schema breaking change**
|
|
|
|
- Tests **PASS** on main branch ✅
|
|
- Tests **FAIL** on PR branch ❌
|
|
- Users on release \`$RELEASE_TAG\` will not be able to upgrade
|
|
- Existing config.yaml configurations will fail validation
|
|
|
|
> **Note:** This is informational only and does not block merge.
|
|
> Consider whether this breaking change is acceptable for users.
|
|
EOF
|
|
|
|
elif [[ "$PR_OUTCOME" == "failure" ]]; then
|
|
# Existing breaking change - both PR and main fail
|
|
echo "::warning::Schema breaking change already exists in main branch"
|
|
|
|
cat >> $GITHUB_STEP_SUMMARY <<EOF
|
|
## ⚠️ Release Schema Compatibility Failed (Existing Issue)
|
|
|
|
**Schema validation against release \`$RELEASE_TAG\` FAILED**
|
|
|
|
- Tests **FAIL** on main branch ❌
|
|
- Tests **FAIL** on PR branch ❌
|
|
- This schema breaking change already exists in main (not introduced by this PR)
|
|
|
|
> **Note:** This is informational only.
|
|
EOF
|
|
|
|
else
|
|
# Success - tests pass
|
|
cat >> $GITHUB_STEP_SUMMARY <<EOF
|
|
## ✅ Release Schema Compatibility Passed
|
|
|
|
All config.yaml configs from release \`$RELEASE_TAG\` are compatible.
|
|
This PR maintains backward compatibility with the latest release.
|
|
EOF
|
|
fi
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|