Skip to content

[Website] Track blueprint resource type if the resource doesn't have a theme/plugin slug - #3862

Merged
bgrgicak merged 2 commits into
trunkfrom
bgrgicak/slugless-resource-type
Jul 6, 2026
Merged

[Website] Track blueprint resource type if the resource doesn't have a theme/plugin slug#3862
bgrgicak merged 2 commits into
trunkfrom
bgrgicak/slugless-resource-type

Conversation

@bgrgicak

@bgrgicak bgrgicak commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Motivation for the change, related issues

Blueprint analytics previously omitted the plugin/theme value when installPlugin/installTheme used a resource without a slug.

Implementation details

This records the resource type as the plugin/theme value when no slug is present, while preserving slug reporting for WordPress.org resources.

Testing Instructions (or ideally a Blueprint)

  • CI

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.

Updates blueprint analytics so installPlugin/installTheme events always include a meaningful plugin/theme identifier by falling back to the resource type when no slug is available.

Changes:

  • Log plugin/theme as slug || resource for installPlugin/installTheme steps.
  • Update inline documentation to describe the fallback behavior.
  • Add unit tests covering slug-present and slug-missing cases.

Reviewed changes

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

File Description
packages/playground/website/src/lib/tracking.ts Adds fallback logging of plugin/theme identifier when slug is missing.
packages/playground/website/src/lib/tracking.spec.ts Adds vitest coverage for slug and slugless resource tracking behavior.

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

Comment thread packages/playground/website/src/lib/tracking.spec.ts
Comment on lines 66 to 72
if (step.step === 'installPlugin') {
const data = {
resource: (step as any).pluginData.resource,
plugin:
(step as any).pluginData.slug ||
(step as any).pluginData.resource,
};
@bgrgicak bgrgicak changed the title [Website] Track slugless blueprint resources Jul 2, 2026

@ashfame ashfame left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left a suggestion, rest looks good to go.

resource: (step as any).pluginData.resource,
plugin:
(step as any).pluginData.slug ||
(step as any).pluginData.resource,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Adding a prefix before logging resource type might be useful. resource:url and resource:git:directory. Otherwise, url just shows up as is, without any clue that it's not a plugin slug.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good point! I added it in 1ff63b3

@bgrgicak
bgrgicak merged commit d3a209e into trunk Jul 6, 2026
53 checks passed
@bgrgicak
bgrgicak deleted the bgrgicak/slugless-resource-type branch July 6, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment