refactor: rename kernel Requests to Command #1008
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Schema Breaking Changes Check | |
| on: | |
| pull_request: | |
| paths: | |
| - "marimo/_schemas/**/*.yaml" | |
| - "packages/openapi/api.yaml" | |
| - ".github/workflows/test_schemas.yaml" | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| openapi: ${{ steps.filter.outputs.openapi }} | |
| session: ${{ steps.filter.outputs.session }} | |
| notebook: ${{ steps.filter.outputs.notebook }} | |
| notifications: ${{ steps.filter.outputs.notifications }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| openapi: | |
| - 'packages/openapi/api.yaml' | |
| - '.github/workflows/test_schemas.yaml' | |
| session: | |
| - 'marimo/_schemas/generated/session.yaml' | |
| - '.github/workflows/test_schemas.yaml' | |
| notebook: | |
| - 'marimo/_schemas/generated/notebook.yaml' | |
| - '.github/workflows/test_schemas.yaml' | |
| notifications: | |
| - 'marimo/_schemas/generated/notifications.yaml' | |
| - '.github/workflows/test_schemas.yaml' | |
| check-schemas: | |
| needs: changes | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| schema: | |
| - name: openapi | |
| path: packages/openapi/api.yaml | |
| display_name: OpenAPI specification | |
| condition: ${{ needs.changes.outputs.openapi == 'true' }} | |
| - name: session | |
| path: marimo/_schemas/generated/session.yaml | |
| display_name: Session Schema | |
| condition: ${{ needs.changes.outputs.session == 'true' }} | |
| - name: notebook | |
| path: marimo/_schemas/generated/notebook.yaml | |
| display_name: Notebook Schema | |
| condition: ${{ needs.changes.outputs.notebook == 'true' }} | |
| - name: notifications | |
| path: marimo/_schemas/generated/notifications.yaml | |
| display_name: Notifications Schema | |
| condition: ${{ needs.changes.outputs.notifications == 'true' }} | |
| steps: | |
| - name: Checkout current branch | |
| if: ${{ matrix.schema.condition }} | |
| uses: actions/checkout@v4 | |
| with: | |
| path: current | |
| - name: Checkout main branch | |
| if: ${{ matrix.schema.condition }} | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| path: main | |
| - name: Set up Java | |
| if: ${{ matrix.schema.condition }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "temurin" | |
| java-version: "17" | |
| - name: Install openapi-diff | |
| if: ${{ matrix.schema.condition }} | |
| run: | | |
| # Download openapi-diff CLI (all.jar includes all dependencies and manifest) | |
| curl -fsSL https://repo1.maven.org/maven2/org/openapitools/openapidiff/openapi-diff-cli/2.1.6/openapi-diff-cli-2.1.6-all.jar -o openapi-diff.jar | |
| - name: Compare ${{ matrix.schema.display_name }} | |
| if: ${{ matrix.schema.condition }} | |
| id: compare | |
| run: | | |
| set +e | |
| OUTPUT=$(java -jar openapi-diff.jar main/${{ matrix.schema.path }} current/${{ matrix.schema.path }} --fail-on-incompatible 2>&1) | |
| EXIT_CODE=$? | |
| set -e | |
| if [ $EXIT_CODE -ne 0 ]; then | |
| echo "breaking_changes<<EOF" >> $GITHUB_OUTPUT | |
| echo "$OUTPUT" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| echo "Breaking changes detected:" | |
| echo "$OUTPUT" | |
| exit 1 | |
| else | |
| echo "No breaking changes detected" | |
| echo "$OUTPUT" | |
| fi | |
| - name: Comment on PR | |
| if: ${{ failure() && matrix.schema.condition }} | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const output = `Breaking changes detected in the ${{ matrix.schema.display_name }}! | |
| ${{ steps.compare.outputs.breaking_changes }}` | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: output | |
| }) |