fix(postgres): guard strict reads against replica revision gaps (#3243) #394
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
| # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
| --- | |
| name: "Main" | |
| on: # yamllint disable-line rule:truthy | |
| # NOTE! Do NOT add any other "on", because this workflow has permission to write to the repo! | |
| push: | |
| branches: | |
| - "main" | |
| permissions: | |
| # permission to update benchmark contents in gh-pages branch | |
| contents: "write" | |
| jobs: | |
| benchmarks: | |
| name: "Run Full Go benchmarks on Main" | |
| runs-on: "depot-ubuntu-24.04-arm-8" # same as build-test.yaml | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: "actions/checkout@v7" | |
| with: | |
| fetch-depth: 0 | |
| - uses: "authzed/actions/setup-go@main" | |
| with: | |
| go-version-file: "./go.mod" | |
| cache-dependency-path: "./go.sum" | |
| - name: "Get HEAD~1 SHA" | |
| id: "prev-sha" | |
| run: | | |
| echo "sha=$(git rev-parse HEAD~1)" >> "$GITHUB_OUTPUT" | |
| - name: "Restore benchmark from cache" | |
| uses: "actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9" # v6.1.0 | |
| with: | |
| path: "./cache/benchmark-data.json" | |
| key: "${{ steps.prev-sha.outputs.sha }}-${{ runner.os }}-go-benchmark" | |
| - name: "Run benchmark on Main" | |
| run: | | |
| set -o pipefail | |
| go run mage.go benchmark:all | tee bench_output.txt | |
| - name: "Compare benchmark against HEAD~1" | |
| uses: "benchmark-action/github-action-benchmark@52576c92bccf6ac60c8223ec7eb2565637cae9ba" # v1.22.1 | |
| with: | |
| # What benchmark tool the output.txt came from | |
| tool: "go" | |
| # Where the output from the benchmark tool is stored | |
| output-file-path: "bench_output.txt" | |
| # Where we store the results | |
| external-data-json-path: "./cache/benchmark-data.json" | |
| save-data-file: true | |
| # Alert when current run is >= 2x worse than HEAD~1 | |
| alert-threshold: "200%" | |
| # Workflow will fail when an alert happens | |
| fail-on-alert: true | |
| github-token: "${{ secrets.GITHUB_TOKEN }}" | |
| comment-on-alert: false | |
| - name: "Publish to gh-pages. See https://authzed.github.io/spicedb/dev/bench/" | |
| # Run even if the compare step failed on a regression, so the dashboard reflects reality. | |
| if: "${{ !cancelled() }}" | |
| uses: "benchmark-action/github-action-benchmark@52576c92bccf6ac60c8223ec7eb2565637cae9ba" # v1.22.1 | |
| with: | |
| # What benchmark tool the output.txt came from | |
| tool: "go" | |
| # Where the output from the benchmark tool is stored | |
| output-file-path: "bench_output.txt" | |
| gh-pages-branch: "gh-pages" | |
| auto-push: "true" | |
| # auto-push requires token | |
| github-token: "${{ secrets.GITHUB_TOKEN }}" | |
| - name: "Save benchmark JSON" | |
| # Run even if the compare step failed on a regression, so the next run has a baseline. | |
| if: "${{ !cancelled() || failure() }}" | |
| uses: "actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9" # v6.1.0 | |
| with: | |
| path: "./cache/benchmark-data.json" | |
| # Save with commit hash to avoid "cache already exists" | |
| key: "${{ github.sha }}-${{ runner.os }}-go-benchmark" | |
| - name: "Notify in Slack if benchmark job failed" | |
| if: "${{ failure() }}" | |
| uses: "slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c" # v3.0.3 | |
| with: | |
| webhook: "${{ secrets.SLACK_BUILDS_WEBHOOK_URL }}" | |
| webhook-type: "incoming-webhook" | |
| payload: | | |
| text: ":x: @eng-oss SpiceDB benchmark regressed (or something broke)" | |
| blocks: | |
| - type: "section" | |
| text: | |
| type: "mrkdwn" | |
| text: | | |
| :x: @eng-oss SpiceDB benchmark regressed (or something broke). Please take a look. | |
| *Repository:* <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}> | |
| *Commit:* <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}> | |
| *Job Run:* <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}> |