Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
244 changes: 124 additions & 120 deletions .claude/skills/playwright-roll/SKILL.md

Large diffs are not rendered by default.

74 changes: 74 additions & 0 deletions .github/workflows/agent-roll.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Rolls a branch of Playwright Java to a new microsoft/playwright commit: the tip of the branch
# with the same name, unless told otherwise. So main rolls to main, and release-1.xx rolls to
# release-1.xx. Starts the Playwright bot with the task below. The bot starts from the branch,
# does the roll with the playwright-roll skill of that branch, and opens the pull request to the
# branch as the app.
name: "Agent: roll Playwright"

on:
# Mon, Wed and Fri at 9:37 UTC: 2:37 at night Pacific time, 1:37 in winter. Not on the hour, when
# GitHub delays scheduled runs. A scheduled roll is a roll of main. It skips while a roll pull
# request to main is open.
schedule:
- cron: "37 9 * * 1,3,5"
workflow_dispatch:
inputs:
branch:
description: "Branch to roll, in microsoft/playwright-java and in microsoft/playwright: main or release-1.xx"
default: "main"
ref:
description: "microsoft/playwright branch, tag or commit to roll to; empty for the tip of the branch above"
default: ""

permissions: {}

jobs:
start:
name: Hand the task to the bot
if: github.repository == 'microsoft/playwright-java'
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
pull-requests: read
env:
BRANCH: ${{ inputs.branch || 'main' }}
steps:
# A manual run rolls anyway: a maintainer asked for it. The skill gives the title of a roll.
- name: Look for an open roll pull request
id: open
if: github.event_name == 'schedule'
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
pr=$(gh pr list --state open --base "$BRANCH" --author app/microsoft-playwright-automation --json number,title \
--jq '[.[] | select(.title | startswith("chore(driver): roll to")) | .number] | first // empty')
if [[ -n "$pr" ]]; then
echo "pr=$pr" >> "$GITHUB_OUTPUT"
echo "Skipped: roll pull request #$pr to $BRANCH is open." >> "$GITHUB_STEP_SUMMARY"
fi
- uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
if: steps.open.outputs.pr == ''
id: app-token
with:
client-id: ${{ vars.PLAYWRIGHT_APP_CLIENT_ID }}
private-key: ${{ secrets.PLAYWRIGHT_PRIVATE_KEY }}
owner: microsoft
repositories: devops.playwright.dev
permission-actions: write
- name: Start the bot
if: steps.open.outputs.pr == ''
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
REF: ${{ inputs.ref || inputs.branch || 'main' }}
run: |
# The bot checks the name again. This check gives the error here, in the run that a
# maintainer started.
if [[ ! "$BRANCH" =~ ^(main|release-[0-9]+\.[0-9]+)$ ]]; then
echo "::error::branch must be main or release-1.xx, got '$BRANCH'"
exit 1
fi
task="Roll the $BRANCH branch of Playwright Java to $REF of microsoft/playwright, as the playwright-roll skill, .claude/skills/playwright-roll/SKILL.md, says. Your checkout is the $BRANCH branch, not main: the old pin is its scripts/DRIVER_VERSION. The pull request goes to the $BRANCH branch. In the pull-request call, base is $BRANCH, commit is the output of git rev-parse origin/$BRANCH, and the patch is against that commit. When the roll is not complete, open the pull request anyway: the pin and the generated files are a start for a maintainer. Say in it what is left."
gh workflow run task.yml --repo microsoft/devops.playwright.dev --ref main \
-f repo="$GITHUB_REPOSITORY" -f branch="$BRANCH" -f task="$task"
echo "Started the roll of $BRANCH to $REF of microsoft/playwright." >> "$GITHUB_STEP_SUMMARY"
2 changes: 0 additions & 2 deletions .github/workflows/verify_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ jobs:
run: scripts/generate_api.sh
- name: Build & Install
run: mvn -B install -D skipTests --no-transfer-progress
- name: Install browsers
run: mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install --with-deps" -f playwright/pom.xml --no-transfer-progress
- name: Update browser versions in README
run: scripts/update_readme.sh
- name: Verify API is up to date
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Playwright Java

The Java client is a port of the JavaScript client in `~/code/playwright/packages/playwright-core/src/client/`. When implementing or changing a method, read the corresponding JS file first and mirror its logic.
The Java client is a port of the JavaScript client in `~/code/playwright/packages/playwright-core/src/client/`. It is a line-by-line translation: when implementing or changing a method, read the corresponding JS file first and translate it statement by statement. `playwright/src/main/AGENTS.md` has the rules. `ARCHITECTURE.md` describes the driver, the wire protocol, the object model, the threading model and the test harness.

Paths such as `~/code/playwright` in this file assume that you check the repos out in `~/code`. Use the `gh` cli to interact with GitHub.

Expand Down
Loading
Loading