Skip to content

[Website] Report Blueprint v2 analytics events - #4006

Merged
adamziel merged 2 commits into
trunkfrom
blueprint-v2-analytics-events
Jul 11, 2026
Merged

[Website] Report Blueprint v2 analytics events#4006
adamziel merged 2 commits into
trunkfrom
blueprint-v2-analytics-events

Conversation

@adamziel

@adamziel adamziel commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

What

Report analytics for validated Blueprint v2 declarations instead of dropping them at the website boundary.

The tracker walks the same v2 execution plan used by the TypeScript runner, so declarative fields and additionalStepsAfterExecution produce the operation names that will actually run. Plugin and theme events retain the existing resource dimensions: WordPress.org slugs are reported, while URLs, execution-context paths, inline data, and Git details collapse to non-sensitive resource labels.

V1 reporting is unchanged.

Why

The website deliberately skipped v2 declarations when the native web flow first landed. That made v2 usage invisible and guaranteed the reporting model would drift from the runner as support expanded.

Using the execution plan as the source of truth removes that parallel list while preserving the existing rule that code, passwords, URLs, paths, filenames, and repository details never enter analytics.

@adamziel
adamziel force-pushed the blueprint-v2-analytics-events branch from f44cb52 to b30be8c Compare July 11, 2026 00:51
Copilot AI review requested due to automatic review settings July 11, 2026 00:58

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds analytics reporting for Blueprint v2 declarations on the website by deriving events from the same v2 execution plan used by the TypeScript runner, while preserving the “no sensitive data” constraint.

Changes:

  • Update website tracking to accept Blueprint inputs, reflect declarations, and report v2 execution-plan operations.
  • Add v2-specific resource anonymization for plugin/theme installs (only wp.org slugs are reported verbatim).
  • Wire the website boot flow to log validated v2 Blueprints and add Vitest coverage for v2 tracking behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/playground/website/src/lib/tracking.ts Implements v2 event reporting from the v2 execution plan and anonymizes asset sources.
packages/playground/website/src/lib/tracking.spec.ts Adds tests ensuring v2 events are logged without leaking private source details; covers bundle inputs.
packages/playground/website/src/lib/state/redux/boot-site-client.ts Removes v2 skip-logic and logs validated Blueprints via the updated tracker.
packages/playground/website/src/lib/state/redux/boot-site-client.spec.ts Updates expectation to match the new onBlueprintValidated handler.
packages/playground/blueprints/src/index.ts Exposes createBlueprintV2ExecutionPlan for website tracking to consume.

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

Comment thread packages/playground/website/src/lib/tracking.ts
Comment thread packages/playground/website/src/lib/tracking.ts
Comment thread packages/playground/website/src/lib/tracking.spec.ts
Comment thread packages/playground/website/src/lib/tracking.ts
@adamziel
adamziel merged commit eb62e62 into trunk Jul 11, 2026
102 of 103 checks passed
@adamziel
adamziel deleted the blueprint-v2-analytics-events branch July 11, 2026 09:48
adamziel added a commit that referenced this pull request Jul 11, 2026
## What

Remove the retired Blueprint v2 opt-in aliases now that v2 declarations
select the native TypeScript path automatically.

- The hidden CLI `--experimental-blueprints-v2-runner` flag and its
v1-option translations are gone.
- `WorkerBootOptions.experimentalBlueprintsV2Runner`, which was already
a no-op, is gone.
- Personal WP no longer gives the retired query parameter special
cleanup behavior.
- Auto-mounted themes always emit the normal v1-shaped activation step;
the v2 handler already owns the one required shape conversion.

## Breaking change

Callers still passing `--experimental-blueprints-v2-runner` must remove
it. Use a v2 declaration for automatic selection, or use `--mode` to
choose `create-new-site`, `apply-to-existing-site`, or `mount-only`. Use
`--allow=follow-symlinks` and `--allow=read-local-fs` for the
capabilities the alias used to infer from old flags.

Code passing `experimentalBlueprintsV2Runner` in worker boot options
must remove that property. It has had no effect since handler selection
moved before worker boot.

## Testing

- `npm exec -- nx run-many -t typecheck -p playground-cli
playground-personal-wp playground-remote --parallel=3`
- `npm exec -- nx run-many -t lint -p playground-cli
playground-personal-wp playground-remote --parallel=3`
- `npm exec -- nx run playground-cli:test-playground-cli
--testFiles=mounts.spec.ts`
- `npx vitest run --config packages/playground/cli/vite.config.ts
packages/playground/cli/tests/run-cli.spec.ts -t "should reject the
retired experimental v2 flag"`
- `npm exec -- nx test playground-personal-wp
--testFile=landing-page.spec.ts`

## Stack

1. #4005
2. #4006
3. This PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment