Skip to content

Align strict-mode compatibility: allow Playwright MCP warnings and honor workflow-level strict opt-out for pull_request_target#31914

Merged
pelikhan merged 3 commits into
mainfrom
copilot/update-daily-compat-report
May 13, 2026
Merged

Align strict-mode compatibility: allow Playwright MCP warnings and honor workflow-level strict opt-out for pull_request_target#31914
pelikhan merged 3 commits into
mainfrom
copilot/update-daily-compat-report

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

Bug Fix

What was the bug?

Daily compat runs exposed a strict-mode mismatch: workflows using tools.playwright in MCP mode failed hard in strict mode, and pull_request_target validation ignored per-workflow strict: false, causing post-codemod compile failures in real consumer repos.

How did you fix it?

  • Playwright strict behavior

    • Changed validatePlaywrightMode to always emit a deprecation warning for MCP mode (including strict mode), instead of returning a strict-mode error.
    • This matches the requested behavior: MCP is deprecated, but still allowed in strict mode.
  • pull_request_target strict consistency

    • Updated validatePullRequestTargetTrigger to compute effective strictness from compiler strict mode + workflow frontmatter override.
    • If frontmatter sets strict: false, strict-only hard error behavior is disabled for this validator, and insecure checkout remains a warning.
  • Targeted regression coverage

    • Updated Playwright validation tests to expect warning-only behavior in strict mode.
    • Added a pull_request_target test case for --strict + frontmatter strict: false to assert warning-only behavior.
effectiveStrictMode := c.strictMode
if workflowData.RawFrontmatter != nil {
	if strictBool, ok := workflowData.RawFrontmatter["strict"].(bool); ok && !strictBool {
		effectiveStrictMode = false
	}
}

Testing

Behavior is covered by updated unit tests in:

  • pkg/workflow/playwright_validation_test.go
  • pkg/workflow/pull_request_target_validation_test.go

Copilot AI and others added 2 commits May 13, 2026 10:33
…arn for playwright MCP

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
… for pull_request_target

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update daily compat report for 2026-05-13 Align strict-mode compatibility: allow Playwright MCP warnings and honor workflow-level strict opt-out for pull_request_target May 13, 2026
Copilot AI requested a review from pelikhan May 13, 2026 10:37
@pelikhan pelikhan marked this pull request as ready for review May 13, 2026 10:53
Copilot AI review requested due to automatic review settings May 13, 2026 10:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts strict-mode compatibility for two validators so consumer workflows don’t fail compilation unexpectedly while still surfacing security/deprecation guidance via warnings.

Changes:

  • Playwright: allow deprecated MCP mode in strict mode by emitting a warning instead of returning an error.
  • pull_request_target: honor workflow frontmatter strict: false as an opt-out for strict-only behavior even when strict mode is enabled via CLI, downgrading the insecure-checkout diagnostic from error to warning.
  • Update/add unit tests for the new warning-only behaviors.
Show a summary per file
File Description
pkg/workflow/pull_request_target_validation.go Computes an effective strictness for this validator that honors frontmatter strict: false, and uses it to gate strict-only warnings/errors.
pkg/workflow/pull_request_target_validation_test.go Adds a regression test for --strict + frontmatter strict: false expecting warning-only behavior.
pkg/workflow/playwright_validation.go Changes MCP-mode handling to always warn (including strict mode) instead of erroring in strict mode.
pkg/workflow/playwright_validation_test.go Updates strict-mode test cases to reflect warn-only behavior (but currently doesn’t assert warnings).

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 4/4 changed files
  • Comments generated: 1

Comment on lines +58 to 62
name: "playwright mcp mode in strict mode warns only",
tools: map[string]any{"playwright": map[string]any{"mode": "mcp"}},
strictMode: true,
expectWarn: true,
},
@pelikhan pelikhan merged commit f3f30ff into main May 13, 2026
4 checks passed
@pelikhan pelikhan deleted the copilot/update-daily-compat-report branch May 13, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants