Browse Source

fix(ci): improve merge conditions and add failure check for Playwright shards

Yuki Takei 1 day ago
parent
commit
6d59ee3720
2 changed files with 12 additions and 8 deletions
  1. 5 8
      .github/mergify.yml
  2. 7 0
      .github/workflows/reusable-app-prod.yml

+ 5 - 8
.github/mergify.yml

@@ -7,11 +7,6 @@ queue_rules:
       - -check-failure ~= ci-app-
       - -check-failure ~= ci-app-
       - -check-failure ~= ci-slackbot-
       - -check-failure ~= ci-slackbot-
       - -check-failure ~= test-prod-node24 /
       - -check-failure ~= test-prod-node24 /
-      # Explicitly enumerate sub-checks of test-prod-node24 so that matrix-
-      # job level failures (e.g. `run-playwright (chromium, 2/2, 6.0)`)
-      # reliably block merges. The broader `-check-failure ~= test-prod-node24 /`
-      # has historically let such failures through (observed on run
-      # 24828684287 for PR #11032).
       - -check-failure ~= test-prod-node24 / build-prod
       - -check-failure ~= test-prod-node24 / build-prod
       - -check-failure ~= test-prod-node24 / launch-prod
       - -check-failure ~= test-prod-node24 / launch-prod
       - -check-failure ~= test-prod-node24 / run-playwright
       - -check-failure ~= test-prod-node24 / run-playwright
@@ -22,12 +17,14 @@ queue_rules:
       - check-success ~= ci-app-launch-dev
       - check-success ~= ci-app-launch-dev
       - check-success = test-prod-node24 / build-prod
       - check-success = test-prod-node24 / build-prod
       - check-success ~= test-prod-node24 / launch-prod
       - check-success ~= test-prod-node24 / launch-prod
-      - check-success ~= test-prod-node24 / run-playwright
+      # Gate on report-playwright (not individual run-playwright shards).
+      # report-playwright runs after ALL shards complete (needs: [run-playwright])
+      # and fails if any shard did not succeed (including cancelled), so a single
+      # SUCCESS here guarantees every playwright matrix job passed — no race condition.
+      - check-success = test-prod-node24 / report-playwright
       - -check-failure ~= ci-app-
       - -check-failure ~= ci-app-
       - -check-failure ~= ci-slackbot-
       - -check-failure ~= ci-slackbot-
       - -check-failure ~= test-prod-node24 /
       - -check-failure ~= test-prod-node24 /
-      # Defensive: same explicit enumeration as queue_conditions so the
-      # merge-time gate cannot be bypassed by a matrix-job level failure.
       - -check-failure ~= test-prod-node24 / build-prod
       - -check-failure ~= test-prod-node24 / build-prod
       - -check-failure ~= test-prod-node24 / launch-prod
       - -check-failure ~= test-prod-node24 / launch-prod
       - -check-failure ~= test-prod-node24 / run-playwright
       - -check-failure ~= test-prod-node24 / run-playwright

+ 7 - 0
.github/workflows/reusable-app-prod.yml

@@ -356,3 +356,10 @@ jobs:
         name: html-report
         name: html-report
         path: playwright-report
         path: playwright-report
         retention-days: 30
         retention-days: 30
+
+    - name: Fail if any playwright shard did not succeed
+      if: needs.run-playwright.result != 'success'
+      run: |
+        echo "run-playwright aggregate result: ${{ needs.run-playwright.result }}"
+        echo "One or more Playwright shards failed or were cancelled. See html-report artifact for details."
+        exit 1