From c537aab4b5ed949edeb5b914c7ec2fb57e3b3b7a Mon Sep 17 00:00:00 2001 From: Amp Date: Wed, 2 Sep 2026 22:33:18 +0000 Subject: [PATCH 1/2] ci: surface git diff failure in e2e new-spec detection instead of swallowing it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to #15660. In `playwright-video-new-tests`, the detect step piped `git diff ... | grep '\.spec\.ts$' || true` — the `|| true` swallows the whole pipeline's exit code, so a `git diff` failure (e.g. the fallback `base.sha` isn't in the local object store) reads identically to "no new specs" and silently no-ops the video job. Split into two statements so `git diff`'s own exit code trips the runner's `-e` and aborts the step instead of masking a build error as an empty result. --- .github/workflows/ci-tests-e2e.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-tests-e2e.yaml b/.github/workflows/ci-tests-e2e.yaml index b9d3ae5548e..897e3b47bf2 100644 --- a/.github/workflows/ci-tests-e2e.yaml +++ b/.github/workflows/ci-tests-e2e.yaml @@ -292,7 +292,11 @@ jobs: else DIFF_RANGE="${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }}" fi - NEW_FILES=$(git diff --name-only --diff-filter=A "$DIFF_RANGE" -- browser_tests/tests | grep '\.spec\.ts$' || true) + # git diff and grep are separate statements (not piped) so a git diff failure + # (e.g. the fallback sha isn't in the local object store) surfaces as a build + # error instead of silently reading as "no new specs" and no-oping the video job. + ADDED_FILES=$(git diff --name-only --diff-filter=A "$DIFF_RANGE" -- browser_tests/tests) + NEW_FILES=$(grep '\.spec\.ts$' <<< "$ADDED_FILES" || true) if [ -z "$NEW_FILES" ]; then echo "has-new-tests=false" >> "$GITHUB_OUTPUT" From ef21d7b55a9cf73544a839ab876dc9b0fe0fbeea Mon Sep 17 00:00:00 2001 From: bymyself Date: Thu, 3 Sep 2026 18:15:37 +0000 Subject: [PATCH 2/2] fix(ci): make new-spec detection POSIX-compatible --- .github/workflows/ci-tests-e2e.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-tests-e2e.yaml b/.github/workflows/ci-tests-e2e.yaml index 897e3b47bf2..a0d7ea07b99 100644 --- a/.github/workflows/ci-tests-e2e.yaml +++ b/.github/workflows/ci-tests-e2e.yaml @@ -287,7 +287,7 @@ jobs: # onto. pull_request.base.sha is recorded when the PR opens and does not follow the # base branch, so diffing against it attributes every spec the base gained since # then to this PR. - if [[ "$(git rev-parse --verify --quiet HEAD^2)" == "${{ github.event.pull_request.head.sha }}" ]]; then + if [ "$(git rev-parse --verify --quiet HEAD^2)" = "${{ github.event.pull_request.head.sha }}" ]; then DIFF_RANGE="$(git rev-parse HEAD^1)..HEAD" else DIFF_RANGE="${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }}" @@ -296,7 +296,7 @@ jobs: # (e.g. the fallback sha isn't in the local object store) surfaces as a build # error instead of silently reading as "no new specs" and no-oping the video job. ADDED_FILES=$(git diff --name-only --diff-filter=A "$DIFF_RANGE" -- browser_tests/tests) - NEW_FILES=$(grep '\.spec\.ts$' <<< "$ADDED_FILES" || true) + NEW_FILES=$(printf '%s\n' "$ADDED_FILES" | grep '\.spec\.ts$' || true) if [ -z "$NEW_FILES" ]; then echo "has-new-tests=false" >> "$GITHUB_OUTPUT"