Skip to content

MAINT: Make PlaywrightCopilotTarget's private helpers keyword-only - #4680

Open
Aditya Malkar (adimalkar) wants to merge 1 commit into
microsoft:mainfrom
adimalkar:maint/4216-playwright-copilot-kwonly
Open

Aditya Malkar (adimalkar) wants to merge 1 commit into
microsoft:mainfrom
adimalkar:maint/4216-playwright-copilot-kwonly

Conversation

@adimalkar

Copy link
Copy Markdown
Contributor

Description

Make the five private helpers of PlaywrightCopilotTarget keyword-only, and clear them from the keyword-only baseline.

  • _extract_content_if_ready_async, _extract_images_from_message_groups_async, _extract_multimodal_content_async, _extract_text_from_message_groups_async and _wait_for_images_to_stabilize_async take their parameters after *.
  • Their call sites inside the class pass the arguments by name, as do the direct calls (and one assert_awaited_once_with) in tests/unit/prompt_target/target/test_playwright_copilot_target.py.
  • Remove the five entries from build_scripts/keyword_only_baseline.txt.
  • No behavior change. None of the helpers is passed as a callback, and nothing outside the class and its test file calls them.

python -m build_scripts.check_keyword_only_params passes, the target's 68 unit tests pass, and ty is clean on the file.

Relates to #4216

This change was developed with AI assistance (Claude Code).

The five private extraction and wait helpers now take their parameters
after `*`; their callers and the tests that call them directly pass
arguments by name. Remove their entries from the keyword-only baseline.

Relates to microsoft#4216
Copilot AI balanced review requested due to automatic review settings November 26, 2026 20:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the five-helper keyword-only migration.

No open issues 🎉

What changed in this PR

This PR advances #4216’s keyword-only migration by updating five private PlaywrightCopilotTarget helpers and their callers, without changing their implementation logic.

Changes:

  • Make the five helpers keyword-only and update internal calls to use named arguments.
  • Update direct unit-test calls and one mock assertion.
  • Remove the five migrated signatures from the keyword-only baseline.
File Description
tests/​unit/​prompt_target/​target/​test_playwright_copilot_target.py Align test calls and the mock assertion with keyword-only signatures.
pyrit/​prompt_target/​playwright_copilot_target.py Make five private helpers keyword-only and update internal callers.
build_scripts/​keyword_only_baseline.txt Remove the five migrated helper entries.

Review effort: Balanced

This branch has not been deployed

No deployments
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.

2 participants