|
| 1 | +# WebKit Open PR Drawer Triage Handoff |
| 2 | + |
| 3 | +Date: 2026-03-29 |
| 4 | +Repository: develop |
| 5 | +Branch: bananas |
| 6 | + |
| 7 | +## Scope |
| 8 | + |
| 9 | +This document captures investigation and fixes for WebKit failures in Playwright tests in playwright/github-pr-drawer.spec.ts. |
| 10 | + |
| 11 | +Original failing subset: |
| 12 | + |
| 13 | +- Open PR drawer confirms and submits component/styles filepaths |
| 14 | +- Open PR drawer validates unsafe filepaths |
| 15 | +- Open PR drawer allows dotted file segments that are not traversal |
| 16 | + |
| 17 | +## Original symptoms |
| 18 | + |
| 19 | +- Test flow appeared to continue behind a confirmation dialog in WebKit. |
| 20 | +- Assertions expecting browser dialog events failed (browserDialogSeen false). |
| 21 | +- In some runs, Open PR status remained at the default neutral text: |
| 22 | + Configure repository, file paths, and branch details. |
| 23 | + |
| 24 | +## Root cause summary |
| 25 | + |
| 26 | +- The app uses a shared in-page dialog opened by showModal for Open PR confirmation when confirmBeforeSubmit is wired. |
| 27 | +- In WebKit, top-layer dialog timing and interaction can be flaky for test automation. |
| 28 | +- The old test logic and app behavior supported two confirmation paths (HTML dialog and native confirm), which increased test complexity and flake risk. |
| 29 | + |
| 30 | +## Relevant app wiring (for context) |
| 31 | + |
| 32 | +- PR drawer submit uses confirmBeforeSubmit when available in src/modules/github-pr-drawer.js. |
| 33 | +- App passes confirmBeforeSubmit to confirmAction in src/app.js. |
| 34 | +- confirmAction opens the shared dialog element with id clear-confirm-dialog via showModal. |
| 35 | +- Native window.confirm fallback has been removed. |
| 36 | + |
| 37 | +## Changes made |
| 38 | + |
| 39 | +Files: |
| 40 | + |
| 41 | +- playwright/github-pr-drawer.spec.ts |
| 42 | +- src/app.js |
| 43 | +- src/modules/github-pr-drawer.js |
| 44 | + |
| 45 | +1. Simplified tests to one confirmation path: HTML dialog only. |
| 46 | +2. Removed dual-path test handling (native browser dialog vs in-page dialog). |
| 47 | +3. Removed manual loop-based visibility fallback logic in tests. |
| 48 | +4. Kept stable submit/confirm interactions and path-input stabilization in PR drawer tests. |
| 49 | +5. Removed fallbackConfirmText usage from app call sites and PR drawer payload. |
| 50 | +6. Removed native window.confirm fallback logic from confirmAction. |
| 51 | +7. Unsupported dialog environments now no-op silently instead of showing a fallback prompt. |
| 52 | + |
| 53 | +## Current status |
| 54 | + |
| 55 | +Latest runs are green: |
| 56 | + |
| 57 | +Command: |
| 58 | +CI=true npx playwright test playwright/github-pr-drawer.spec.ts --project=webkit --headed --grep "Open PR drawer confirms and submits component/styles filepaths" |
| 59 | +Result: |
| 60 | +1 passed |
| 61 | + |
| 62 | +Command: |
| 63 | +CI=true npx playwright test playwright/github-pr-drawer.spec.ts --project=webkit --headed --grep "Open PR drawer confirms and submits component/styles filepaths|Open PR drawer allows dotted file segments that are not traversal|Open PR drawer validates unsafe filepaths" |
| 64 | +Result: |
| 65 | +3 passed |
| 66 | + |
| 67 | +Command: |
| 68 | +npx playwright test playwright/github-pr-drawer.spec.ts --project=chromium |
| 69 | +Result: |
| 70 | +15 passed |
| 71 | + |
| 72 | +Command: |
| 73 | +CI=true npx playwright test playwright/github-pr-drawer.spec.ts --project=webkit |
| 74 | +Result: |
| 75 | +15 passed |
| 76 | + |
| 77 | +## Local changes currently present |
| 78 | + |
| 79 | +- playwright/github-pr-drawer.spec.ts (modal-only confirmation helper refactor) |
| 80 | +- src/app.js (removed native confirm fallback and fallbackConfirmText usage) |
| 81 | +- src/modules/github-pr-drawer.js (removed fallbackConfirmText in submit confirmation payload) |
| 82 | +- playwright.config.ts (workers changed from CI 2 to CI 1) |
| 83 | +- package.json (added test:e2e:webkit using CI=true) |
| 84 | + |
| 85 | +Note: playwright.config.ts worker change may be unrelated to this issue. Treat it as separate unless intentionally part of CI stabilization. |
| 86 | + |
| 87 | +## Evergreen policy alignment |
| 88 | + |
| 89 | +- Project policy is evergreen browsers only. |
| 90 | +- HTML dialog support is assumed. |
| 91 | +- No compatibility fallback is maintained for non-supporting/legacy environments. |
| 92 | + |
| 93 | +## If this flakes again |
| 94 | + |
| 95 | +1. Re-run only failing test first with headed mode and trace. |
| 96 | +2. Confirm clear-confirm-dialog opens and confirm button click is delivered. |
| 97 | +3. Confirm request flow occurs by adding temporary request counters for: |
| 98 | + |
| 99 | +- git refs create |
| 100 | +- contents upsert |
| 101 | +- pulls create |
| 102 | + |
| 103 | +4. If status remains default, verify submit click dispatch with a temporary event probe in test page context. |
| 104 | +5. Keep assertions outcome-based (status/request side effects), not browser-event-path assumptions. |
| 105 | + |
| 106 | +## Suggested next validation |
| 107 | + |
| 108 | +1. Run full github-pr-drawer.spec.ts on WebKit. |
| 109 | +2. Run same spec on Chromium and Firefox to ensure no regressions from helper changes. |
| 110 | +3. If stable, keep helper approach and remove any temporary probes. |
| 111 | + |
| 112 | +## Minimal rollback plan |
| 113 | + |
| 114 | +Use this only if WebKit flakiness returns and you need to quickly de-risk test helper changes. |
| 115 | + |
| 116 | +1. In playwright/github-pr-drawer.spec.ts, rollback only interaction mechanics first: |
| 117 | + |
| 118 | +- replace DOM evaluate click calls with standard Playwright click calls. |
| 119 | + |
| 120 | +2. Keep path validation stabilizers unless proven harmful: |
| 121 | + |
| 122 | +- keep explicit toHaveValue checks. |
| 123 | +- keep blur before submit in validation tests. |
| 124 | + |
| 125 | +3. If still flaky, narrow rollback to failing tests only: |
| 126 | + |
| 127 | +- inline confirmation flow in the failing tests and temporarily bypass shared helper usage. |
| 128 | + |
| 129 | +4. Do not reintroduce native confirm fallback as a flake workaround. |
| 130 | +5. Do not mix rollback with config churn: |
| 131 | + |
| 132 | +- avoid changing playwright.config.ts in the same rollback commit unless worker count is confirmed root cause. |
| 133 | + |
| 134 | +Quick validation after each rollback step: |
| 135 | + |
| 136 | +Command: |
| 137 | +CI=true npx playwright test playwright/github-pr-drawer.spec.ts --project=webkit --headed --grep "Open PR drawer confirms and submits component/styles filepaths" |
| 138 | + |
| 139 | +Then: |
| 140 | + |
| 141 | +Command: |
| 142 | +CI=true npx playwright test playwright/github-pr-drawer.spec.ts --project=webkit --headed --grep "Open PR drawer confirms and submits component/styles filepaths|Open PR drawer allows dotted file segments that are not traversal|Open PR drawer validates unsafe filepaths" |
| 143 | + |
| 144 | +Stop rollback at first stable step and keep the smallest diff that remains green. |
0 commit comments