Skip to content

Fix analytics metadata for app/theme#7765

Open
gonzaloriestra wants to merge 1 commit into
mainfrom
fix-app-analytics
Open

Fix analytics metadata for app/theme#7765
gonzaloriestra wants to merge 1 commit into
mainfrom
fix-app-analytics

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Related thread: https://shopify.slack.com/archives/C05E3BDFDRB/p1780923031432789

In #7010 we changed the way to load files, and the analytics metadata we add for app or theme commands is not being included.

The bundled CLI was loading app/theme code through two different module graphs: command entrypoints were bundled from source files, while package imports and hooks resolved through built dist files. That meant in-memory metadata could be recorded in one module instance and read from another, so app command analytics could miss app-specific fields.

WHAT is this pull request doing?

  • Bundles app/theme command entrypoints from ../app/dist and ../theme/dist instead of source files, so command imports and package imports share the same module graph.
  • Disables analytics in E2E subprocess environments to prevent tests from sending real analytics events.
  • Adds coverage to the existing app deploy E2E by checking verbose analytics output includes the deploy command, success state, and app name.

How to test your changes?

shopify app deploy --verbose

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset with pnpm changeset add

@gonzaloriestra

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260609114645

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@gonzaloriestra gonzaloriestra marked this pull request as ready for review June 9, 2026 12:09
@gonzaloriestra gonzaloriestra requested a review from a team as a code owner June 9, 2026 12:09
@gonzaloriestra gonzaloriestra changed the title Fix app and theme specific analytics Fix analytics metadata for app/theme Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant