Repository navigation
ref(investigations): Rebuild the source an investigation starts from #249111
Workflow file for this run
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: openapi-diff | |
| on: | |
| pull_request: | |
| # Cancel in progress workflows on pull_requests. | |
| # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| # hack for https://github.com/actions/cache/issues/810#issuecomment-1222550359 | |
| env: | |
| SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3 | |
| jobs: | |
| check-diff: | |
| name: (Optional) Shows the difference between the prod and dev schema | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 90 | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| steps: | |
| - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
| - name: Check for python file changes | |
| uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2 | |
| id: changes | |
| with: | |
| token: ${{ github.token }} | |
| filters: .github/file-filters.yml | |
| - name: Setup sentry env | |
| uses: ./.github/actions/setup-sentry | |
| with: | |
| mode: migrations | |
| if: steps.changes.outputs.api_docs == 'true' | |
| - name: Checkout getsentry/sentry-api-schema | |
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
| if: steps.changes.outputs.api_docs == 'true' | |
| with: | |
| ref: 'main' | |
| repository: getsentry/sentry-api-schema | |
| path: sentry-api-schema | |
| - uses: ./.github/actions/setup-node-pnpm | |
| - name: Build OpenAPI Derefed JSON | |
| if: steps.changes.outputs.api_docs == 'true' | |
| run: | | |
| make build-api-docs | |
| - name: Compare OpenAPI Derefed JSON | |
| if: steps.changes.outputs.api_docs == 'true' | |
| run: | | |
| npx json-diff@0.5.4 --color sentry-api-schema/openapi-derefed.json tests/apidocs/openapi-derefed.json | |
| - name: Dump RPC schema for new version | |
| id: newschema | |
| if: steps.changes.outputs.api_docs == 'true' | |
| run: | | |
| mkdir schemas | |
| sentry rpcschema --loglevel=WARNING > rpc_method_schema.json | |
| # Runs oasdiff directly from the getsentry/image-mirror copy instead of | |
| # oasdiff/oasdiff-action, which builds FROM tufin/oasdiff:main on Docker Hub. | |
| - name: Output RPC schema comparison | |
| if: steps.changes.outputs.api_docs == 'true' | |
| run: | | |
| docker run --rm -v "$PWD:$PWD" -w "$PWD" \ | |
| ghcr.io/getsentry/image-mirror-tufin-oasdiff:v1.33.0 \ | |
| breaking sentry-api-schema/rpc_method_schema.json ./rpc_method_schema.json \ | |
| --fail-on WARN --format githubactions |