Enable filter pushdown in spicepod defined UDTFs (#11004) #723
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: Generate Spiceschema OpenAPI | |
| on: | |
| push: | |
| branches: [trunk] | |
| paths: | |
| - 'tools/spiceschema/**' | |
| - 'crates/**' | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| CARGO_INCREMENTAL: 0 | |
| CARGO_NET_GIT_FETCH_WITH_CLI: true | |
| jobs: | |
| generate_openapi: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| persist-credentials: false | |
| - name: Check for existing PR | |
| id: check_pr | |
| run: | | |
| existing_pr=$(gh pr list \ | |
| --base trunk \ | |
| --json title,headRefName \ | |
| --jq '.[] | select(.title=="Update openapi.json")') | |
| if [ ! -z "$existing_pr" ]; then | |
| echo "An existing PR for updating openapi.json was found. Skipping updates." | |
| echo "skip=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "skip=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install Rust 1.94.1 | |
| if: steps.check_pr.outputs.skip != 'true' | |
| run: rustup toolchain install 1.94.1 --profile minimal | |
| - name: Set up make | |
| if: runner.os != 'macOS' && steps.check_pr.outputs.skip != 'true' | |
| uses: ./.github/actions/setup-make | |
| - name: Set up cc | |
| if: runner.os != 'macOS' && steps.check_pr.outputs.skip != 'true' | |
| uses: ./.github/actions/setup-cc | |
| - name: Build Cargo project | |
| if: steps.check_pr.outputs.skip != 'true' | |
| run: cargo build --manifest-path tools/spiceschema/Cargo.toml | |
| - name: Run Cargo project to generate OpenAPI | |
| if: steps.check_pr.outputs.skip != 'true' | |
| run: cargo run --manifest-path tools/spiceschema/Cargo.toml -- http --json > .schema/openapi.json | |
| - name: Verify OpenAPI file | |
| if: steps.check_pr.outputs.skip != 'true' | |
| run: | | |
| if [ -f ".schema/openapi.json" ]; then | |
| echo ".schema/openapi.json file was successfully created." | |
| cat .schema/openapi.json | |
| else | |
| echo ".schema/openapi.json file was not created." | |
| exit 1 | |
| fi | |
| - name: Upload OpenAPI artifact | |
| if: steps.check_pr.outputs.skip != 'true' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: openapi.json | |
| path: .schema/openapi.json | |
| - name: Create PR if needed | |
| if: steps.check_pr.outputs.skip != 'true' | |
| run: | | |
| git config --global user.name 'Spice Schema Bot' | |
| git config --global user.email 'schema-bot@spice.ai' | |
| git checkout -b openapi/${GITHUB_RUN_ID} | |
| if git diff --exit-code -- .schema/openapi.json; then | |
| echo "No changes detected" | |
| else | |
| git add .schema/openapi.json | |
| git commit -m "Update openapi.json" | |
| git push "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}" HEAD:openapi/${GITHUB_RUN_ID} | |
| gh pr create \ | |
| --title "Update openapi.json" \ | |
| --body $'Updated OpenAPI specification\n\n**Remember**\n- [ ] Updated in [spiceai/docs](https://github.com/spiceai/docs).' \ | |
| --label 'kind/documentation' \ | |
| --base trunk \ | |
| --head openapi/${GITHUB_RUN_ID} | |
| fi | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |