Use preview identity for store open analytics#8005
Open
alfonso-noriega wants to merge 1 commit into
Open
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
6243ecd to
d36622e
Compare
Contributor
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/metadata.d.ts@@ -45,6 +45,7 @@ declare const coreData: RuntimeMetadataManager<CmdFieldsFromMonorail, {
};
} & {
environmentFlags: string;
+ commandUserId?: string;
} & PickByPrefix<{
args: string;
error_message?: string | null;
@@ -66,6 +67,7 @@ export declare const getAllPublicMetadata: () => Partial<CmdFieldsFromMonorail>,
};
} & {
environmentFlags: string;
+ commandUserId?: string;
} & PickByPrefix<{
args: string;
error_message?: string | null;
@@ -86,6 +88,7 @@ export declare const getAllPublicMetadata: () => Partial<CmdFieldsFromMonorail>,
};
} & {
environmentFlags: string;
+ commandUserId?: string;
} & PickByPrefix<{
args: string;
error_message?: string | null;
@@ -97,6 +100,7 @@ export declare const getAllPublicMetadata: () => Partial<CmdFieldsFromMonorail>,
env_plugin_installed_all?: string | null;
env_shopify_variables?: string | null;
}, "store_", never>>, onError?: MetadataErrorHandling) => Promise<void>, runWithTimer: (field: NumericKeyOf<CmdFieldsFromMonorail>) => <T>(fn: () => Promise<T>) => Promise<T>;
+export declare function addCommandUserIdMetadata(userId: string): Promise<void>;
export type Public = PublicSchema<typeof coreData>;
export type Sensitive = SensitiveSchema<typeof coreData>;
export {};
\ No newline at end of file
|
Assisted-By: devx/655cd991-b9e0-480d-ba60-50e176a7ce76
d36622e to
fadcffa
Compare
4 tasks
amcaplan
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

WHY are these changes introduced?
Preview-store commands should attribute command analytics to the store-auth identity selected by
--storewhen the command reads that preview store from the local store-auth cache.shopify store open --store <preview-store>goes throughgetStoreInfo, which already records preview store metadata (store_id, domain/hash) from the cached preview-store session. However, it did not set the analyticsuser_idfrom that same cached session, so the Monorail event could fall back to the current CLI user/session instead.WHAT is this pull request doing?
When
getStoreInfodetects a locally stored preview-store session, it now also calls:This aligns preview-store
store openwithstore info: both commands share the samegetStoreInfopath and now emit analytics using:store_idfromstoredSession.preview.shopIduser_idfromstoredSession.userIdThis only applies to the preview-store cache path. Business Platform-backed store info/open flows continue to use the normal CLI authentication identity.
How to test your changes?
pnpm test packages/store/src/cli/services/store/info/index.test.tsChecklist