Validate Playwright mode expressions - #56933
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Existing schema validation preempts the intended field-specific error in real compiler paths.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds static validation for Playwright mode expressions.
Changes:
- Rejects expression-valued Playwright modes.
- Adds regression coverage for the validator.
File summaries
| File | Description |
|---|---|
pkg/workflow/playwright_validation.go |
Adds mode expression validation. |
pkg/workflow/playwright_validation_test.go |
Tests expression rejection. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Balanced
| if config, ok := playwrightTool.(map[string]any); ok { | ||
| if mode, ok := config["mode"].(string); ok && hasExpressionMarker(mode) { | ||
| return NewValidationError( |
| "tools.playwright.mode", | ||
| mode, | ||
| "mode must be a literal value; expressions are not allowed", | ||
| "Set mode to either mcp or cli", |
…an reject it Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Updated |
|
🎉 This pull request is included in a new release. Release: |
tools.playwright.modecontrols compiler-generated runtime setup and must be static. GitHub Actions expressions are now rejected for this field.Validation
${{ ... }}values intools.playwright.modemcporcliCoverage