Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 0 additions & 133 deletions .github/workflows/frontend-optional.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ jobs:
typecheckable_rules_changed: ${{ steps.changes.outputs.typecheckable_rules_changed }}
mdx_typecheckable: ${{ steps.changes.outputs.mdx_typecheckable }}
frontend_all: ${{ steps.changes.outputs.frontend_all }}
merge_base: ${{ steps.merge_base.outputs.merge_base }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 100

- name: Check for frontend file changes
uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
Expand All @@ -40,6 +43,28 @@ jobs:
filters: .github/file-filters.yml
list-files: shell

# On PRs, HEAD is the merge commit; its parents (HEAD^1, HEAD^2) are base and head.
# Merge base of those two is what Jest --changedSince needs.
# If merge base can't be computed or non-frontend files changed, output is empty
# and the Jest job will run the full test suite instead.
- name: Get merge base for changedSince
id: merge_base
if: github.event_name == 'pull_request'
run: |
MERGE_BASE=$(git merge-base HEAD^1 HEAD^2 2>/dev/null) || true
if [ -n "$MERGE_BASE" ]; then
CHANGED=$(git diff --name-only "$MERGE_BASE" HEAD^2)
if echo "$CHANGED" | grep -qvE '^static/'; then
echo "Non-frontend file changed — running full Jest suite"
MERGE_BASE=""
else
echo "Merge base: $MERGE_BASE (Jest will use --changedSince)"
fi
else
echo "Could not compute merge base — running full Jest suite"
fi
echo "merge_base=${MERGE_BASE:-}" >> "$GITHUB_OUTPUT"
Comment thread
cursor[bot] marked this conversation as resolved.

typescript:
if: needs.files-changed.outputs.frontend_all == 'true'
needs: files-changed
Expand Down Expand Up @@ -144,6 +169,9 @@ jobs:
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
name: Checkout sentry
with:
# PRs need history so Jest can resolve --changedSince <merge_base> from local Git history.
fetch-depth: ${{ github.event_name == 'pull_request' && '100' || '1' }}
Comment thread
sentry[bot] marked this conversation as resolved.

- uses: ./.github/actions/setup-node-pnpm

Expand Down Expand Up @@ -189,6 +217,9 @@ jobs:
# When the "Frontend: Rerun Flaky Tests" label is on the PR,
# tests wrapped with it.isKnownFlake() run 50x to validate fixes.
RERUN_KNOWN_FLAKY_TESTS: "${{ contains(github.event.pull_request.labels.*.name, 'Frontend: Rerun Flaky Tests') }}"
# When set, Jest uses --changedSince to run only tests affected by this PR.
# Empty on master or when non-frontend files changed (falls back to full suite).
MERGE_BASE: ${{ needs.files-changed.outputs.merge_base }}
run: pnpm run test-ci --forceExit

form-field-registry:
Expand Down
Loading