Skip to content

refactor(playwright): simplify the install-python-deps hook and its fixture wheel builder - #14785

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14699-42645363049-1
Nov 9, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14699-42645363049-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14699

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Simplified the two playwright hook files with no change in behavior. fixture_wheel.py now adds the RECORD entry to the same files dict it builds and writes that dict once, which drops the second dict merge. install-python-deps.sh's to_native flattens a case statement with a nested early-return brace group into one if/else; it prints the same output and returns the same status for every OSTYPE, path and cygpath outcome. I chose these two edits because the rest of both files already reads simply, and the issue rules out moving code between files.

Not verified

  • Tidy did not run every pass. Passes 1-3 (simplify, comment deletion, generated-code residue) ran on the code lines and found nothing to change. Pass 5 (/ai-slop:audit fix) was skipped because its detector script and git commands are not runnable under this lane's shell rules. Pass 4…
  • Did not re-run the checks after tidy because tidy changed no file, so the tree is the one the checks already passed on.
  • Did not run install-python-deps.test.sh or the playwright test suites directly, because this lane runs no interpreter or test runner; they are left to the PR's CI (ci-status).
  • check-affected's CI-only checks (shell/python lint scanners, typos, etc.) are left to the PR's CI.

Fix

  • plugins/playwright/hooks/fixture_wheel.py: make_wheel stores RECORD in files and iterates files once when writing the zip; entry order, RECORD lines and the printed sha256 are unchanged
  • plugins/playwright/hooks/install-python-deps.sh: to_native rewritten from a case with a nested brace-group early return to a single if/else; same output and return status on every path
  • .changes/playwright/work-resolve-issue-issue-14699-42645363049-1-829f9a97.md: new patch fragment, '### Changed' with 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 9acc495:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: all 1 fragment valid
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 14 passed, 5 skipped (typos not installed; validate-plugins sub-checks and changed-skills skipped by the check) over 3 changed files
  • fresh-context review subagent over the whole diff: no findings; confirmed identical zip entry order and RECORD contents, identical to_native output and status for msys/cygwin with POSIX path (cygpath success, failure, empty output), msys/cygwin with non-POSIX path, and other OSTYPE;…
  • tidy-diff passes 1-3 over the code lines: no further edit or proposal
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42645363049

Left out: the items under Not verified.

Related

#14699

Merge-Risk: max=LOW demote=false head=9acc4955dcf3d0c85bfe32ffae7d953ecc39290e rubric=8.1.6 rater=claude-opus-5-5 checker=claude-opus-5-5

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 9acc4955dcf3d0c85bfe32ffae7d953ecc39290e: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #14785, no security issues found

I read the whole change in all 3 changed files. None of them matches a trusted path.

  • plugins/playwright/hooks/install-python-deps.sh, to_native: the old case statement is now a single if/else. I checked each branch and the behaviour has not changed:
    • On msys or cygwin with a POSIX path, it calls cygpath -m. The function's status still comes from the && chain, so a failed conversion or empty output still makes it return non-zero and the caller still stops (fail closed).
    • On msys or cygwin with a non-POSIX path, it prints the path unchanged and returns 0.
    • On any other OSTYPE, it prints the path unchanged.
    • Quoting is unchanged and no new input reaches a command.
  • plugins/playwright/hooks/fixture_wheel.py, make_wheel: this builds a test wheel. The right-hand side ''.join(...) is fully evaluated before files[record] is assigned, so the RECORD contents still list only the earlier entries plus RECORD,,. The zip entries are written in the same order. It handles no untrusted input.
  • .changes/playwright/...md: a new changelog fragment containing only text.

No trust control, token scope, kill switch, merge hold, plugin manifest or standing instruction is touched. The PR context contains no embedded instructions aimed at this lane. There are no prior findings, and this is not a blocking-only review.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed 9acc4955dcf3d0c85bfe32ffae7d953ecc39290e: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Code review: #14785 at 9acc495

No findings. I read every hunk of all 3 changed files. None of them is on a trusted path.

Behavior equivalence (checked by reading the code)

  • plugins/playwright/hooks/fixture_wheel.py: Python evaluates the right-hand ''.join(...) in full before the files[record] assignment, so the generator never sees the dict change while it iterates. RECORD lists the same entries as before, plus its own ,, line. Dicts keep insertion order, so RECORD is still the last zip entry. The zip bytes and the printed sha256 match the base version.

  • plugins/playwright/hooks/install-python-deps.sh to_native: The if/else gives the same result as the old case statement in every situation:

    • msys/cygwin with a non-/ path: prints the path and returns 0.
    • msys/cygwin with a / path: returns the status of the cygpath && -n && printf chain. A failing cygpath or an empty answer still returns non-zero with no output.
    • Any other OSTYPE: prints the path and returns 0.

    The caller at line 58 is in an if ! context, so errexit handling is also the same.

Closing issue #14699 acceptance criteria

  • Behavior unchanged: met, as described above. Tests that could catch a regression already exist:
    • install-python-deps.test.sh runs the hook with a stub cygpath that succeeds or fails (lines 169-198).
    • The same test builds its fixture wheel with fixture_wheel.py and uses the digest it prints (line 53).
  • Only listed files plus fragments edited: met.
  • Within 400 lines and 15 files: met.
  • Fragment: met. bump: patch, body ### Changed with "Internal simplification, no behavior change."
  • ci-status green: not checked by this lane, which has no access to CI. The PR's checks and test runs are the author's claim and were not verified here.

The diff touches no plugin manifest, so there are no manifest lines. The PR context contains no embedded directives aimed at the lane.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 9acc4955dcf3d0c85bfe32ffae7d953ecc39290e, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 9acc495

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-14785-9acc4955dcf3d0c85bfe32ffae7d953ecc39290e, expires on 2026-12-09.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit bbff5a1 Nov 9, 2026
65 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14699-42645363049-1 branch November 9, 2026 19:57
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 5, survived 1, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 83%; mutation score 83%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/playwright/hooks/fixture_wheel.py 3 1 0 0 0 0
plugins/playwright/hooks/install-python-deps.sh 2 0 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/playwright/hooks/fixture_wheel.py:26 SBR unclassified none

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit bbff5a128782f0fef40a0e3de41ce01c9a9ace3c; later checks count it verified from this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simplify the hooks playwright plugin code

0 participants