From 7a088e00c6dce7741897fbca14824bce4c775bce Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 29 Nov 2026 18:13:41 +0300 Subject: [PATCH] devops(ci): close superseded playwright-cli tracking PRs The weekly watcher cut a new track-playwright-cli_* branch from the upstream HEAD every week but left the previous PRs open, so three stacked up (#24, #25, #26). Close the older ones once the new PR is open, as upstream-roll.yml already does for roll_* PRs. Document the macos-15 'job was not acquired' cancellations that made the reports say failure. --- .claude/skills/dev/roll.md | 3 ++- .github/workflows/upstream-playwright-cli.yml | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.claude/skills/dev/roll.md b/.claude/skills/dev/roll.md index 6e4ce4d9..08c0e341 100644 --- a/.claude/skills/dev/roll.md +++ b/.claude/skills/dev/roll.md @@ -42,7 +42,8 @@ Nothing is written when blocked: the merges with conflict markers go to `.roll/c ## Automation - `.github/workflows/upstream-roll.yml` runs daily: detects a newer, old-enough `patchright-core`, rolls it on `roll_`, runs `ci.yml` on that branch and waits for it (`.github/actions/ci-on-branch`), and opens the PR with the report, closing any older `roll_*` PR it supersedes. `safe` + green CI is merged automatically; `review` waits for a human (label `needs-review`); `blocked` opens an issue (label `upstream-blocked`) with the report and the conflicted merges and writes nothing; scheduled runs skip that version while the issue is open. Manual runs take a version, `dry_run` (report only) and `force`. -- `.github/workflows/upstream-playwright-cli.yml` runs weekly with the same verdicts for `microsoft/playwright-cli` (`npm run watch:playwright-cli`, `--apply` to take a clean merge). +- `.github/workflows/upstream-playwright-cli.yml` runs weekly with the same verdicts for `microsoft/playwright-cli` (`npm run watch:playwright-cli`, `--apply` to take a clean merge). Its branch is cut from the upstream HEAD, so it closes every other open `track-playwright-cli_*` PR as superseded. +- A `macos-15` job that GitHub cancels with "The job was not acquired by Runner" (arm64 capacity) is not a test failure, but the report then says `failure` and the PR gets `tests-failed`. Check the run's annotations before reading anything into it; re-running the job is enough. - Both workflows need Issues enabled on the repository (a fork has them off by default) for the `blocked` verdict to land anywhere; without them the lookup only warns, but a blocked roll fails the job with the report in the summary and the artifact. - The automatic merge uses the workflow token: keep the repository setting "Allow GitHub Actions to create and approve pull requests" on, and do not require reviews in the `main` ruleset, or the merge step only leaves a comment and the PR waits. - The `main` ruleset requires the CI job names (` / node `) on the PR head. A PR opened with the workflow token starts no CI, and a reusable `ci.yml` call would put its checks on the caller's commit under `test / ...`, so the workflows dispatch `ci.yml` on the branch instead: `workflow_dispatch` is the one event the workflow token may start, and its checks land on the branch head under the plain names. Change the ruleset's required checks together with the matrix in `ci.yml`, or every PR stays blocked. diff --git a/.github/workflows/upstream-playwright-cli.yml b/.github/workflows/upstream-playwright-cli.yml index b280d7a6..f78eb2b9 100644 --- a/.github/workflows/upstream-playwright-cli.yml +++ b/.github/workflows/upstream-playwright-cli.yml @@ -149,6 +149,19 @@ jobs: gh pr edit "$number" --body-file body.md --add-label "$labels" fi echo "number=$number" >> "$GITHUB_OUTPUT" + # The tracking branch is always cut from the upstream HEAD, so it carries every commit an + # older tracking PR does; runs never overlap (the concurrency group), so any other open + # track-playwright-cli_* PR is older and only adds review noise. + - name: Close older tracking pull requests + env: + NUMBER: ${{ steps.pr.outputs.number }} + HEAD: ${{ needs.track.outputs.head }} + run: | + for old in $(gh pr list --state open --json headRefName --jq '.[].headRefName | select(startswith("track-playwright-cli_"))'); do + [ "$old" = "$BRANCH" ] && continue + gh pr close "$old" --delete-branch --comment "Superseded by #$NUMBER (microsoft/playwright-cli ${HEAD:0:7})." \ + || echo "::warning::Could not close $old, superseded by #$NUMBER." + done - name: Merge automatically (nothing we use changed, green CI) if: env.CLASSIFICATION == 'safe' && steps.ci.outputs.result == 'success' run: |