Skip to content

Narrow fragment spreads to their type condition in MCP tool schemas #9492

Narrow fragment spreads to their type condition in MCP tool schemas

Narrow fragment spreads to their type condition in MCP tool schemas #9492

Workflow file for this run

name: CI
on:
pull_request:
branches:
- main
- main-version-*
concurrency:
group: ci-new-2-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
jobs:
check-changes:
name: Check for Changes
runs-on: ubuntu-latest
outputs:
website_changes: ${{ steps.check-website.outputs.website_changes }}
library_changes: ${{ steps.check-library.outputs.library_changes }}
src_changes: ${{ steps.check-src.outputs.src_changes }}
nitro_client_changes: ${{ steps.check-nitro-client.outputs.nitro_client_changes }}
aspire_nitro_client_changes: ${{ steps.check-aspire-nitro-client.outputs.aspire_nitro_client_changes }}
steps:
- name: Checkout Repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 2
show-progress: false
- name: Check for changes in website directory
id: check-website
run: |
changes=$(git diff --name-only HEAD~1 HEAD -- ./website)
if [[ -n "$changes" ]]; then
echo "website_changes=true" >> $GITHUB_OUTPUT
else
echo "website_changes=false" >> $GITHUB_OUTPUT
fi
- name: Check for changes outside website directory
id: check-library
run: |
changes=$(git diff --name-only HEAD~1 HEAD -- ':!./website')
if [[ -n "$changes" ]]; then
echo "library_changes=true" >> $GITHUB_OUTPUT
else
echo "library_changes=false" >> $GITHUB_OUTPUT
fi
- name: Check for changes in src directory or CI workflow
id: check-src
run: |
src_changes=$(git diff --name-only HEAD~1 HEAD -- ./src)
ci_changes=$(git diff --name-only HEAD~1 HEAD -- .github/workflows/ci.yml)
if [[ -n "$src_changes" ]] || [[ -n "$ci_changes" ]]; then
echo "src_changes=true" >> $GITHUB_OUTPUT
else
echo "src_changes=false" >> $GITHUB_OUTPUT
fi
- name: Check for changes in ChilliCream.Nitro.Client package
id: check-nitro-client
run: |
changes=$(git diff --name-only HEAD~1 HEAD -- ./src/Nitro/Common/src/ChilliCream.Nitro.Client)
if [[ -n "$changes" ]]; then
echo "nitro_client_changes=true" >> $GITHUB_OUTPUT
else
echo "nitro_client_changes=false" >> $GITHUB_OUTPUT
fi
- name: Check for changes in Fusion Aspire Nitro client
id: check-aspire-nitro-client
run: |
changes=$(git diff --name-only HEAD~1 HEAD -- \
./src/HotChocolate/Fusion/src/Fusion.Aspire \
./.github/scripts/nitro-aspire-operations.cs \
./.github/scripts/nitro-aspire-operations.sh \
./.github/workflows/ci.yml)
if [[ -n "$changes" ]]; then
echo "aspire_nitro_client_changes=true" >> $GITHUB_OUTPUT
else
echo "aspire_nitro_client_changes=false" >> $GITHUB_OUTPUT
fi
spellcheck:
name: "Spellcheck Documentation"
runs-on: ubuntu-latest
needs: check-changes
if: needs.check-changes.outputs.website_changes == 'true'
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
name: Check out the code
with:
show-progress: false
- name: Install Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 24
- name: Install cspell
run: npm install -g cspell@10.0.1
- name: run cspell (website)
run: cspell --config ./cspell.json "website/content/**/*.md" --no-progress --no-cache
linting:
name: "Markdown linting"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
name: Check out the code
with:
show-progress: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
name: Setup node
with:
node-version: 24
- run: npm install -g markdownlint-cli2@0.22.1
name: Install markdownlint-cli2
- run: markdownlint-cli2 "*.md" "website/content/**/*.md"
name: run Markdownlint
website-tests:
name: "Website Tests"
needs: check-changes
if: needs.check-changes.outputs.website_changes == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
show-progress: false
- name: Install Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 24
cache: "yarn"
cache-dependency-path: "website/yarn.lock"
- name: Cache Yarn Packages
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: |
website/.yarn/cache
website/.next/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('website/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Packages
run: yarn --immutable --network-timeout 100000
working-directory: website
env:
CHILLICREAM_FRONTEND_ENV: ci
- name: Install Playwright Chromium
run: yarn playwright install --with-deps chromium
working-directory: website
- name: Format Check
run: yarn format:check
working-directory: website
- name: Lint
run: yarn lint
working-directory: website
- name: Generate Agent Skills
run: yarn generate-agent-skills
working-directory: website
- name: Build
run: yarn build
working-directory: website
- name: Visual Regression Tests
run: yarn test:visual
working-directory: website
- name: Upload Playwright Report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: playwright-report
path: website/playwright-report/
retention-days: 7
configure:
name: Generate Test Matrix
runs-on: ubuntu-latest
needs: check-changes
if: needs.check-changes.outputs.library_changes == 'true'
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout to repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
show-progress: false
- name: Generate Test Matrix
id: set-matrix
uses: ./.github/actions/generate-test-matrix
library-tests:
name: Run ${{ matrix.name }}
runs-on: ubuntu-latest
needs: [configure, check-changes]
if: needs.check-changes.outputs.library_changes == 'true'
env:
DOCKER_CONFIG: ${{ github.workspace }}/.docker
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.configure.outputs.matrix) }}
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
show-progress: false
- name: Install .NET
uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
with:
dotnet-version: |
8.x
9.x
10.x
11.0.100-preview.6.26359.118
- name: Run Build
id: run-build
run: dotnet build ${{ matrix.path }} --framework net11.0 --verbosity q
timeout-minutes: 5
- name: Log in to Docker Hub
# Run step only if branch is local (not from a fork).
if: >
github.event_name != 'pull_request' ||
(github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository)
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Run tests
id: run-tests
timeout-minutes: 15
continue-on-error: false
run: >
dotnet test
--project ${{ matrix.path }}
--framework net11.0
--no-build
--coverage
--coverage-output-format cobertura
--report-trx
--results-directory ${{ matrix.directoryPath }}/TestResults
env:
CI_BUILD: true
- name: Upload Test Results as Artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: test-results-${{ matrix.name }}
path: ${{ matrix.directoryPath }}/TestResults/*.trx
- name: Upload Coverage File as Artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: coverage-${{ matrix.name }}
path: ${{ matrix.directoryPath }}/TestResults/*.cobertura.xml
- name: Upload mismatch files as Artifact
if: steps.run-tests.outcome == 'failure'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: mismatch-files-${{ matrix.name }}
path: ${{ matrix.directoryPath }}/**/__mismatch__/*
patch-coverage:
name: Patch Coverage
runs-on: ubuntu-latest
needs: [check-changes, library-tests]
if: needs.check-changes.outputs.library_changes == 'true'
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
show-progress: false
fetch-depth: 0
# PR-authored patch-coverage.cs runs in this job; keep the job token out of the workspace.
persist-credentials: false
- name: Install .NET
uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
with:
dotnet-version: 11.0.100-preview.6.26359.118
- name: Download all coverage artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
path: ./output/download
pattern: coverage-*
- name: Install dotnet-coverage
run: |
dotnet tool install --global dotnet-coverage --version 18.8.0
echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH"
- name: Merge coverage reports
run: >
dotnet-coverage merge
--output ./output/merged.cobertura.xml
--output-format cobertura
"./output/download/**/*.cobertura.xml"
- name: Compute changed lines
# HEAD is the PR merge commit. The three-dot "^1...^2" diffs merge-base(base, head)..head,
# i.e. only the PR's own changes, matching GitHub's "Files changed" even when behind main.
run: >
git diff --unified=0 --diff-filter=d
"HEAD^1...HEAD^2"
-- '*.cs' > ./output/pr.diff
- name: Generate patch coverage report
id: report
env:
GITHUB_SHA: ${{ github.event.pull_request.head.sha }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
dotnet .github/scripts/patch-coverage.cs -- ./output/merged.cobertura.xml ./output/pr.diff > ./output/report.md
if [ -s ./output/report.md ]; then
echo "has_content=true" >> "$GITHUB_OUTPUT"
else
echo "has_content=false" >> "$GITHUB_OUTPUT"
fi
- name: Write job summary
if: steps.report.outputs.has_content == 'true'
run: cat ./output/report.md >> "$GITHUB_STEP_SUMMARY"
- name: Post sticky comment
# Fork PRs get a read-only token and cannot post comments; coverage still
# appears in the job summary above for those PRs.
if: >
steps.report.outputs.has_content == 'true' &&
github.event.pull_request.head.repo.full_name == github.repository
uses: marocchino/sticky-pull-request-comment@0ea0beb66eb9baf113663a64ec522f60e49231c0 # v3.0.4
with:
header: patch-coverage
path: ./output/report.md
verify-aspire-nitro-operations:
name: Verify Fusion Aspire Nitro Operations
runs-on: ubuntu-latest
needs: check-changes
if: needs.check-changes.outputs.aspire_nitro_client_changes == 'true'
steps:
- name: Checkout Repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
show-progress: false
- name: Install .NET
uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
with:
dotnet-version: |
10.x
11.0.100-preview.6.26359.118
- name: Verify persisted operation hashes
run: >
.github/scripts/nitro-aspire-operations.sh verify
--output "${{ runner.temp }}/nitro-aspire-operations.json"
validate-aspire-nitro-client:
name: Validate Fusion Aspire Nitro Client
runs-on: ubuntu-latest
needs: [check-changes, verify-aspire-nitro-operations]
if: >-
needs.check-changes.outputs.aspire_nitro_client_changes == 'true' &&
!github.event.pull_request.head.repo.fork
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout Repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
show-progress: false
- name: Install .NET
uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
with:
dotnet-version: |
10.x
11.0.100-preview.6.26359.118
- name: Create operations manifest
run: >
.github/scripts/nitro-aspire-operations.sh verify
--output "${{ runner.temp }}/nitro-aspire-operations.json"
- name: Validate Client
uses: ChilliCream/nitro-client-validate@4b817b3f65b7fcc09eeea7b8fa901e7abf69945c # v16.1.3
with:
client-id: ${{ secrets.NITRO_ASPIRE_CLIENT_ID }}
operations-file: ${{ runner.temp }}/nitro-aspire-operations.json
stage: Dev
api-key: ${{ secrets.NITRO_API_KEY }}
comment-mode: "review"
validate-nitro-client:
name: Validate Nitro Client
runs-on: ubuntu-latest
needs: check-changes
if: >-
needs.check-changes.outputs.nitro_client_changes == 'true' &&
!github.event.pull_request.head.repo.fork
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout Repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
show-progress: false
- name: Validate Client
uses: ChilliCream/nitro-client-validate@4b817b3f65b7fcc09eeea7b8fa901e7abf69945c # v16.1.3
with:
client-id: ${{ secrets.NITRO_API_CLIENT_ID }}
operations-file: src/Nitro/Common/src/ChilliCream.Nitro.Client/persisted/operations.json
stage: Dev
api-key: ${{ secrets.NITRO_API_KEY }}
comment-mode: "review"
verify-nitro-npm-package:
name: Verify Nitro npm package
runs-on: ubuntu-latest
needs: check-changes
if: needs.check-changes.outputs.src_changes == 'true'
steps:
- name: Checkout Repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
show-progress: false
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 24
- name: Enable corepack
run: corepack enable
- name: Install dependencies
working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro
run: yarn install --immutable
- name: Build
working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro
run: yarn build
- name: Inject optionalDependencies
working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro
shell: bash
run: |
set -euo pipefail
jq --arg v "0.0.0-ci" '
.optionalDependencies = {
"@chillicream/nitro-linux-arm64": $v,
"@chillicream/nitro-linux-musl-x64": $v,
"@chillicream/nitro-linux-x64": $v,
"@chillicream/nitro-osx-arm64": $v,
"@chillicream/nitro-osx-x64": $v,
"@chillicream/nitro-win-x64": $v,
"@chillicream/nitro-win-x86": $v
}
' package.json > package.json.tmp
mv package.json.tmp package.json
- name: Pack
working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro
run: npm pack --dry-run
ci-status-check:
name: "CI Status Check"
needs:
[
library-tests,
website-tests,
verify-aspire-nitro-operations,
validate-aspire-nitro-client,
validate-nitro-client,
verify-nitro-npm-package,
]
if: always()
runs-on: ubuntu-latest
steps:
- name: Check if Library Tests or Website Tests failed
run: exit 1
if: |
always() &&
(needs.library-tests.result == 'failure' ||
needs.website-tests.result == 'failure' ||
needs.verify-aspire-nitro-operations.result == 'failure' ||
needs.validate-aspire-nitro-client.result == 'failure' ||
needs.validate-nitro-client.result == 'failure' ||
needs.verify-nitro-npm-package.result == 'failure')