feat(slack): Add metrics for slack reinstall nudge outcomes #33231
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: 'frontend-snapshots' | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| types: [opened, synchronize, reopened, edited] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| env: | |
| NODE_OPTIONS: '--max-old-space-size=4096' | |
| SNAPSHOT_OUTPUT_DIR: .artifacts/snapshots | |
| jobs: | |
| snapshots: | |
| name: snapshot tests | |
| # Skip 'edited' events that aren't a base branch change (e.g. title/body edits). | |
| # When the base branch changes, the diff target changes so we need a fresh run. | |
| if: github.event.action != 'edited' || github.event.changes.base != '' | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
| with: | |
| # Checkout the HEAD of the PR (or the commit if not a PR) | |
| # Explicitly need to do this to avoid cases where the merge commit is used instead of the PR head, | |
| # which can introduce diffs that aren't explicitly caused by the PR changes. | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4 | |
| with: | |
| node-version-file: '.node-version' | |
| - uses: pnpm/action-setup@36de12bed180fa130ed56a35e7344f2fa7a820ab # v4 | |
| - name: node_modules cache | |
| uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
| id: nodemodulescache | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('pnpm-lock.yaml', 'api-docs/pnpm-lock.yaml', '.node-version') }} | |
| - name: Install Javascript Dependencies | |
| if: steps.nodemodulescache.outputs.cache-hit != 'true' | |
| run: pnpm install --frozen-lockfile | |
| - name: Install Playwright browsers | |
| run: pnpm exec playwright install chromium --with-deps | |
| - name: Run snapshot tests | |
| env: | |
| SENTRY_DSN: ${{ secrets.SENTRY_SNAPSHOTS_DSN }} | |
| GITHUB_PR_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| GITHUB_PR_REF: ${{ github.event.pull_request.head.ref || github.ref }} | |
| run: pnpm run snapshots | |
| - name: Compute merge base SHA | |
| if: github.event_name == 'pull_request' && !cancelled() | |
| id: merge-base | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| MERGE_BASE=$(gh api repos/${{ github.repository }}/compare/${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} --jq '.merge_base_commit.sha') | |
| echo "sha=$MERGE_BASE" >> "$GITHUB_OUTPUT" | |
| - name: Install sentry-cli | |
| if: ${{ !cancelled() }} | |
| run: curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=3.5.0 sh | |
| - name: Upload snapshots | |
| id: upload | |
| if: ${{ !cancelled() }} | |
| env: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_SNAPSHOTS_AUTH_TOKEN }} | |
| BASE_SHA: ${{ steps.merge-base.outputs.sha }} | |
| run: | | |
| sentry-cli \ | |
| --log-level=debug \ | |
| snapshots upload "$SNAPSHOT_OUTPUT_DIR" \ | |
| --app-id sentry-frontend \ | |
| --project sentry-frontend \ | |
| ${BASE_SHA:+--base-sha "$BASE_SHA"} | |
| - name: Report upload failure to Sentry | |
| if: ${{ failure() && steps.upload.outcome == 'failure' }} | |
| env: | |
| SENTRY_DSN: ${{ secrets.SENTRY_SNAPSHOTS_DSN }} | |
| run: | | |
| sentry-cli send-event \ | |
| --message "Frontend snapshot upload failed" \ | |
| --tag workflow:frontend-snapshots \ | |
| --tag commit:"${{ github.sha }}" |