Skip to content

feat(create-plugin): make Playwright config extendable - #2807

Open
alectimison-maker wants to merge 1 commit into
grafana:mainfrom
alectimison-maker:feat/extend-playwright-config
Open

feat(create-plugin): make Playwright config extendable#2807
alectimison-maker wants to merge 1 commit into
grafana:mainfrom
alectimison-maker:feat/extend-playwright-config

Conversation

@alectimison-maker

Copy link
Copy Markdown

What this PR does / why we need it:

  • Moves the Playwright defaults generated by create-plugin into the managed .config/playwright.config.ts.
  • Keeps the root playwright.config.ts as a small, user-owned override using defineConfig(baseConfig, overrides).
  • Documents how to retain the default projects when adding projects because Playwright replaces arrays during config merging.
  • Adds a regression test that verifies both Playwright templates are included and connected.

This keeps Grafana-owned defaults updateable without overwriting plugin-specific Playwright customizations. It applies to newly scaffolded plugins; it intentionally does not rewrite existing root configs because those files may contain user changes.

This is a clean reimplementation of the stale-closed #1495 and incorporates its maintainer review feedback, including the requested projects override documentation.

Which issue(s) this PR fixes:

Fixes #1366

Tests:

  • npm exec nx run @grafana/create-plugin:test -- --run --no-cache (272 passed)
  • npm exec nx run @grafana/create-plugin:lint -- --no-cache
  • NX_SKIP_NX_CACHE=true npm exec nx run @grafana/create-plugin:typecheck
  • NX_SKIP_NX_CACHE=true npm exec nx run @grafana/create-plugin:build
  • npm run docs:test:ci (12 passed)
  • npm run docs:build
  • Generated a panel plugin with the built CLI, installed its dependencies, ran npm run typecheck, and ran npm exec playwright test -- --list (4 tests listed across the default auth and chromium projects)

Special notes for your reviewer:

The generated root config retains the commented dotenv hook so users can customize environment loading without editing .config/.

@alectimison-maker
alectimison-maker requested review from a team as code owners July 30, 2026 04:17
@alectimison-maker
alectimison-maker requested review from hugohaggmark and joshhunt and removed request for a team July 30, 2026 04:17
@github-actions

Copy link
Copy Markdown
Contributor

Signed commits report

1 of 1 commit between main and feat/extend-playwright-config could not be fully verified:

Commit Author Reason Message
4154f6ec alectimison-maker unsigned feat(create-plugin): make Playwright config extendable

This repository requires all commits to be signed. See GitHub docs on commit signature verification.

@cla-assistant

cla-assistant Bot commented Jul 30, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cla-assistant

cla-assistant Bot commented Jul 30, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@cla-assistant

cla-assistant Bot commented Jul 30, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Labels

None yet

Projects

Status: 🔬 In review
Status: 🔍 In review

Development

Successfully merging this pull request may close these issues.

Feat: Extend the playwright config file

2 participants