diff --git a/.claude/skills/playwright-triage/SKILL.md b/.claude/skills/playwright-triage/SKILL.md deleted file mode 100644 index f86826c6a..000000000 --- a/.claude/skills/playwright-triage/SKILL.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -name: playwright-triage -description: Triage and fix an issue in microsoft/playwright-python. How to use the upstream checkout, how to run a published version, how to tell a bug of the Python client from an upstream one, the upstream bug report, and what not to run from a PR of a third party. ---- - -# Playwright Python Issue Triage - -## Upstream - -`.upstream/` is the clone of `microsoft/playwright` at the commit in `DRIVER_VERSION`, as -[AGENTS.md](../../../AGENTS.md) says. The driver is built from it. Read upstream code there. Do not -edit, commit or switch branches in it: the wheel build and `./scripts/lint.sh` stop when it is not -at that commit or has local changes. Before you run upstream tests in it, it needs `npm ci`, -`npm run build` and `npx playwright install`. The wheel build (`scripts/build_driver.py`) runs the -first two there; run them again when `node_modules/` is missing. - -## Published versions - -To run a published version, for example to bisect, create an empty directory outside the repo for -each version, and run there: - -```bash -python -m venv env && source env/bin/activate # env\Scripts\activate on Windows -pip install playwright== -python -m playwright install -``` - -The fixtures of the repo are not available there. Write the condensed repro as a plain script with -`sync_playwright()` or `async_playwright()` in that directory, with `page.set_content()` in place of -the test server, and run it from there. In this repo, the source tree shadows the installed -package. - -The driver of a release is in `DRIVER_VERSION` at its tag: `git show v:DRIVER_VERSION` -prints the upstream commit it was built from, or, for releases up to 1.64, the `playwright-core` -version of the driver; `npm view playwright-core@ gitHead` prints its commit. Match a -regression in the driver to commits with `git -C .upstream log .. -- `. - -## Upstream bugs - -The client talks to the Node driver that is built from `.upstream/`, and `microsoft/playwright` -and this repo are one team. Reproduce the bug in Python first. Then write the same calls as an -upstream test and run it in `.upstream/`. The triage skill of `microsoft/playwright`, in -`.upstream/.claude/skills/playwright-triage/`, says where such a test goes, which fixtures it uses -and how to run it. Use only those parts of it. Put the test in a new spec file, and delete the file -when you are done, so that the checkout is clean. - -- The Node test passes: the bug is in the Python client. Fix it here. -- The Node test fails too: the root cause is upstream, and the fix lands in `microsoft/playwright`. - Do not work around it in `playwright/_impl/`. Run `git -C .upstream fetch origin main`. When - `git -C .upstream log HEAD..origin/main -- ` shows a fix that already landed, it reaches - this repo with the next roll: say so. Otherwise write the report. -- The Python API lacks a member or an option: the generated API has everything that the upstream - docs in `.upstream/docs/src/api` give Python (`* langs:` decides; no `langs` means every - language). The gap is in the docs, so it is an upstream change too. Do not edit a generated file, - and do not add to `scripts/codegen/python_rules.js` to go around the docs. - -The report is for an engineer of `microsoft/playwright` who did not read the Python issue: what -fails, expected versus actual, the versions (the Python package, the commit in `DRIVER_VERSION`, the -browser, the platform), the root cause when you found it, and the condensed Node test as the repro. -The title has at most 256 characters, for example `route.fulfill() drops the charset of -Content-Type`. A maintainer files it in `microsoft/playwright`. Give it in this form: - -`````markdown -Upstream bug report, for a maintainer to file in microsoft/playwright: - -**Title:** - -<details> -<summary>Body</summary> - -````markdown -<the report> -```` - -</details> -````` - -With it, give the verdict, the evidence, and that the bug is upstream. - -## PRs from third parties - -Do not run a PR that changes `setup.py`, `pyproject.toml`, `setup.cfg`, `local-requirements.txt`, -`requirements.txt`, `DRIVER_VERSION`, `NODE_VERSION`, `.pre-commit-config.yaml`, `test.sh`, -`scripts/`, `utils/`, `.github/`, `.azure-pipelines/`, `.claude/`, or a generated file. A PR that -changes a ported test under `tests/{async,sync}/{page,library}`, or adds a mark to one, has faults: -the ports have zero deviations. diff --git a/.github/workflows/review.yml b/.github/workflows/agent-review.yml similarity index 100% rename from .github/workflows/review.yml rename to .github/workflows/agent-review.yml diff --git a/.github/workflows/roll.yml b/.github/workflows/agent-roll.yml similarity index 100% rename from .github/workflows/roll.yml rename to .github/workflows/agent-roll.yml diff --git a/.github/workflows/task.yml b/.github/workflows/agent-task.yml similarity index 100% rename from .github/workflows/task.yml rename to .github/workflows/agent-task.yml diff --git a/.github/workflows/triage.yml b/.github/workflows/agent-triage.yml similarity index 81% rename from .github/workflows/triage.yml rename to .github/workflows/agent-triage.yml index aa39150dd..fb555215b 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/agent-triage.yml @@ -1,6 +1,5 @@ -# Hands the issue to the Playwright bot when a maintainer applies agent-triage, agent-implement or -# agent-task. Nothing else of the bot lives in this repo. Apply the label again to start another -# run. +# Hands the issue to the Playwright bot when a maintainer applies agent-triage or agent-implement. +# Nothing else of the bot lives in this repo. Apply the label again to start another run. name: "Agent: triage" on: @@ -15,8 +14,7 @@ jobs: if: >- github.repository_owner == 'microsoft' && ( github.event.label.name == 'agent-triage' || - github.event.label.name == 'agent-implement' || - github.event.label.name == 'agent-task') + github.event.label.name == 'agent-implement') runs-on: ubuntu-latest timeout-minutes: 5 steps: diff --git a/AGENTS.md b/AGENTS.md index 5938520ac..6f0bf296e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,6 +16,12 @@ python scripts/upstream.py checkout # clone .upstream/, or move it to DRIVER_V python scripts/upstream.py changes # what changed upstream since DRIVER_VERSION at HEAD ``` +The client talks to the Node.js driver that is built from `.upstream/`. When the same calls fail in +a Node.js test upstream too, the cause is upstream, and the fix lands in `microsoft/playwright`: do +not work around it in `playwright/_impl/`. When Node.js passes, the bug is in the Python client. +`git show v<version>:DRIVER_VERSION` prints the upstream commit of a release, or, for releases up to +1.64, the `playwright-core` version of its driver. + ## Build and test You need Python 3.10+, git, Node.js and npm. @@ -138,7 +144,7 @@ left). ## Rolls -Use the `playwright-roll` skill. On CI, `.github/workflows/roll.yml` runs it and opens the +Use the `playwright-roll` skill. On CI, `.github/workflows/agent-roll.yml` runs it and opens the PR, on Mon, Wed and Fri at night unless a roll PR is open. To roll at another time, start the workflow by hand with a branch, a tag or a commit.