[P0][0.2.x] Fix red main CI: Playwright wait_for_function violates strict CSP
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start in tests/test_browser.py at the failing wait near line 175, then search nearby Playwright tests for other string predicates that conflict with the strict CSP. Replace the wait with a locator based assertion and run the failing test on Linux Chromium through both response branches. Done means the exact new HEAD passes that test and full pytest, with error responses restoring controls and preserving edited Markdown.
Written by the indexing model from the issue text.
Description
P0 blocker: red CI on merged main (2026-10-21)
Exact tested SHA: c30d213bf9fa2c889d00f1feabf637a689e5b9fd
Failing run: https://github.com/drevendev/PatchPitch/actions/runs/39588939745
Observed outcome: 245 passed, 1 failed, 15 dependency warnings.
Failure:
tests/test_browser.py::test_delayed_regeneration_locks_editor_and_restores_it[True]
At tests/test_browser.py:175, page.wait_for_function("!document.getElementById('generate').disabled") evaluates a JavaScript string through eval; the local application's strict Content-Security-Policy: script-src 'self' forbids unsafe-eval. The failing exception is Page.wait_for_function: EvalError: Evaluating a string as JavaScript violates ... script-src 'self'.
Smallest safe fix
- Replace this wait with a Playwright locator-based assertion / wait, e.g.
expect(page.locator("#generate")).to_be_enabled()with the appropriate timeout. If a JS predicate is necessary, use a proper non-string function expression supported by the Playwright API and strict CSP. - Search only nearby affected Playwright tests for other CSP-incompatible string predicates. Do not disable CSP, add
unsafe-eval, weaken local-only protections or alter actual generation/editor code merely to make the test green. - Repeat exact failing test on a Linux Chromium runner with failure and success response branches, then full
pyteston the new exact HEAD. - Verify a generation error still restores input/editor controls and preserves previous edited Markdown. Differentiate a flaky test harness from any actual UI bug; file a separate behavioral bug only if reproduced.
Acceptance
P0 before any release/tag/0.3 implementation: exact-HEAD CI green, zero new bypasses and clear linked PR/commit. Earlier local report of 246 passed is not evidence of green CI for c30d213.
Relates to #45 release gate and the full release-kit roadmap.
- Dominant language
- Python
- Stars
- 1
- Forks
- 0
- Avg merge
- 1h 56m
- Merged PRs (30d)
- 7
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from drevendev/PatchPitch
-
[Distribution] Surface released v0.3.0 install path before unreleased 0.4; measure asset downloadsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
drevendev/PatchPitch#93 ·
-
[RFC] Ten optional no-card integrations for the Full Release Kit: pilots, roadmap and exit plansOpendocumentation enhancement
Difficulty 5/5 Over a week Newbie friendliness 20/100
drevendev/PatchPitch#89 ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 30/100
drevendev/PatchPitch#88 ·
-
[P1][v0.3.x] Private GitHub URL intake through explicit local read-only auth (no secrets in drafts)Openenhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
drevendev/PatchPitch#87 ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
drevendev/PatchPitch#86 ·
All issues in drevendev/PatchPitch
Similar issues
-
URLValidator ignores an explicit empty scheme allowlistPossibly taken @IlyaKhalafi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
tortoise/tortoise-orm#2393 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
frappe/frappe_docker#2046 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
complete_box_iou_loss / complete_box_iou: NaN gradients for zero-height boxes, NaN for point boxesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
AXI SMU SPEC
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
tenstorrent/tt-oca-harness#3556 ·
Maintainers usually reply within 1 day