From 794604f53b3f5e2a00b4914ec4f9dc4730c59e87 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Tue, 10 Nov 2026 08:32:54 -0800 Subject: [PATCH] chore(bots): name the agent workflows agent-*, and start tasks by hand only The agent-task label no longer starts the bot: a task starts by hand, with the Agent: task workflow. The agents file has what the playwright-triage skill said about this repo, where the repo had one, and the skill goes away. --- .claude/skills/playwright-triage/SKILL.md | 87 ------------------- .../{review.yml => agent-review.yml} | 0 .../workflows/{task.yml => agent-task.yml} | 0 .../{triage.yml => agent-triage.yml} | 8 +- CLAUDE.md | 4 +- 5 files changed, 6 insertions(+), 93 deletions(-) delete mode 100644 .claude/skills/playwright-triage/SKILL.md rename .github/workflows/{review.yml => agent-review.yml} (100%) rename .github/workflows/{task.yml => agent-task.yml} (100%) rename .github/workflows/{triage.yml => agent-triage.yml} (81%) diff --git a/.claude/skills/playwright-triage/SKILL.md b/.claude/skills/playwright-triage/SKILL.md deleted file mode 100644 index 237463c63..000000000 --- a/.claude/skills/playwright-triage/SKILL.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -name: playwright-triage -description: Triage and fix an issue in microsoft/playwright-dotnet. Where the JavaScript client and the driver are upstream, how to run a published version, how to tell a bug of the port from an upstream one, the generated code, the upstream bug report, and what not to run from a PR of a third party. ---- - -# Playwright .NET Issue Triage - -## Upstream - -The .NET client is a port of the JavaScript client of `microsoft/playwright`, in -`packages/playwright-core/src/client/`. The API docs are in `docs/src/api/`, the API generator is -`utils/doclint/generateDotnetApi.js`, and the upstream tests are in `tests/page/` and -`tests/library/`. - -`.upstream/` is the clone of `microsoft/playwright` at the commit of the driver, which -`` in `src/Common/Version.props` names, as [CLAUDE.md](../../../CLAUDE.md) says. -Read the code of the driver there, and use its history and tags. Do not commit, branch or edit in -it. - -Write and run upstream tests in a checkout of `microsoft/playwright` at `main`, next to this repo, -in `../playwright`. `main` is close to the commit of the driver. Before you run an upstream test -there, run `npm ci`, `npm run build` and `npx playwright install` in it. Then -`npm run ctest `, `npm run ftest ` and `npm run wtest ` run one spec file on -Chromium, Firefox and WebKit. - -## Published versions - -To run a published version, for example to bisect, create an empty directory outside the repo for -each version, and make a console project there: - -```bash -dotnet new console -n repro -f net8.0 -o . && dotnet add package Microsoft.Playwright --version -dotnet build && pwsh bin/Debug/net8.0/playwright.ps1 install chromium -dotnet run -``` - -Put the repro in `Program.cs` as top-level statements, as `src/Playwright.Examples/Program.cs` -does. `playwright.ps1 install` fetches the browsers of that version. Match the change to commits in -this repo with `git log v..v -- src/Playwright/`, and to the JavaScript client in -`.upstream/` with the same tags. - -## Upstream bugs - -The .NET client talks to the Node driver that `microsoft/playwright` publishes, and many bugs that -are reported here are in the driver. That fix lands in `microsoft/playwright`. The family is one -team, so this is routing, not a request to the reporter. Find the owner with the same calls in both -clients: write the repro as a .NET test here first, then write the same calls as an upstream test -in `../playwright` and run it there. When the Node test fails the same way, the root cause is -upstream. When only the .NET test fails, the bug is in the port: compare the method in -`src/Playwright/Core/` with the same method in the JavaScript client, and fix it here. - -The interfaces in `src/Playwright/API/Generated/` and the types in -`src/Playwright/Transport/Protocol/Generated/` are generated by `utils/doclint/generateDotnetApi.js` -and `utils/generate_dotnet_channels.js` from the upstream docs and protocol. Never edit them by -hand. A missing method, option or type is an upstream change, in `docs/src/api/` (the `langs` -annotations decide what .NET gets) or in the generator. .NET-only overloads are hand-written in -`src/Playwright/API/Supplements/`, and the implementations are in `src/Playwright/Core/`. - -For an upstream root cause, write a report for a maintainer to file in `microsoft/playwright`, for -an engineer who did not read this issue: what fails, expected versus actual, the driver version and -the browsers, and the condensed Node test from `../playwright` as the repro. Say that .NET shows -the same. The title has at most 256 characters. 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 a `.csproj`, `.props` or `.sln` file, `nuget.config`, `build.sh`, -`src/tools/Playwright.Tooling/` (the driver build), `src/Playwright/build/` (MSBuild targets that -run on every build), `.github/`, `.azure-pipelines/`, `utils/`, `package.json`, `package-lock.json`, -or the generated files under `src/Playwright/API/Generated/` and -`src/Playwright/Transport/Protocol/Generated/`. 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/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/CLAUDE.md b/CLAUDE.md index b2e2b32e6..87b3b0c85 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -9,6 +9,8 @@ dotnet build ./src # build the entire solution `DriverVersion` in `src/Common/Version.props` is the `microsoft/playwright` commit that the driver, the generated API and the port come from. `.upstream/` (gitignored) is a clone of `microsoft/playwright` at that commit: `./build.sh --build-driver` clones it, checks out the commit and builds the driver from it. Run it again when `DriverVersion` changes, for example after a pull. Read upstream code in `.upstream/`; do not commit, branch or edit in it. +The .NET client talks to the Node.js driver that is built from that commit. When the same calls fail in a Node.js test upstream too, the cause is in the driver or a browser, and the fix lands in `microsoft/playwright`. When Node.js passes, the bug is in the port: compare the method in `src/Playwright/Core/` with the same method in the JavaScript client, `packages/playwright-core/src/client/`, and fix it here. Write and run upstream tests in a separate checkout of `microsoft/playwright` at `main`, `~/code/playwright`. Paths such as `~/code/playwright` in this file assume that you check the repos out in `~/code`. + ## Running tests Follow `.github/workflows/tests.yml` for the canonical sequence. @@ -48,7 +50,7 @@ The tests are NUnit tests in `src/Playwright.Tests/`, one class per upstream spe ### Generated vs hand-written code - Public API interfaces (e.g. `src/Playwright/API/Generated/IPage.cs`) are **generated** by `.upstream/utils/doclint/generateDotnetApi.js` from the upstream API docs. Do not hand-edit these — update the generator instead. -- `./build.sh --generate` generates them again from `.upstream/`, and CI fails when the committed files differ. The generator change lands upstream first, and a roll brings it here. To try it before that, `PW_SRC_DIR=../playwright ./build.sh --generate` runs the generators of another checkout. +- `./build.sh --generate` generates them again from `.upstream/`, and CI fails when the committed files differ. The generator change lands upstream first, and a roll brings it here. To try it before that, `PW_SRC_DIR=~/code/playwright ./build.sh --generate` runs the generators of another checkout. - The generator uses `classNameMap` for type mappings (e.g. `Disposable` → `IAsyncDisposable`, `boolean` → `bool`). Add entries there when a Playwright type should map to a different .NET type. - The generator skips generating interface files for types like `TimeoutException` and `IAsyncDisposable` that map to built-in .NET types. - Supplement interfaces (`src/Playwright/API/Supplements/`) are hand-written and extend the generated interfaces with .NET-specific overloads.