Record fetched URL path in doc fetch analytics - #8554
Closed
brandonreid wants to merge 2 commits into
Closed
brandonreid wants to merge 2 commits into
brandonreid wants to merge 2 commits into
Conversation
Adds cmd_doc_fetch_url_path to the app_cli3_command public payload (schema 1.29) and populates it from doc fetch with the pathname only, so fetches of specific documents (e.g. the App Store self-review requirements page) can be attributed alongside the app context the global metadata hook already provides. Assisted-By: devx/56e14e24-e249-4bda-810f-42156f6e7afb
Addresses review on Shopify/monorail#24489: the field can now only hold the path of a shopify.dev document that actually resolved, never a typo'd or made-up path from a failed request. Assisted-By: devx/56e14e24-e249-4bda-810f-42156f6e7afb
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@@ -34,7 +34,7 @@ export type SensitiveSchema<T> = T extends RuntimeMetadataManager<infer _TPublic
* @returns A container for the metadata.
*/
export declare function createRuntimeMetadataContainer<TPublic extends AnyJson, TSensitive extends AnyJson = Record<string, never>>(defaultPublicMetadata?: Partial<TPublic>): RuntimeMetadataManager<TPublic, TSensitive>;
-type CmdFieldsFromMonorail = PickByPrefix<MonorailEventPublic, 'cmd_all_'> & PickByPrefix<MonorailEventPublic, 'cmd_app_'> & PickByPrefix<MonorailEventPublic, 'cmd_create_app_'> & PickByPrefix<MonorailEventPublic, 'cmd_theme_'> & PickByPrefix<MonorailEventPublic, 'store_'> & PickByPrefix<MonorailEventPublic, 'env_auto_upgrade_'>;
+type CmdFieldsFromMonorail = PickByPrefix<MonorailEventPublic, 'cmd_all_'> & PickByPrefix<MonorailEventPublic, 'cmd_app_'> & PickByPrefix<MonorailEventPublic, 'cmd_create_app_'> & PickByPrefix<MonorailEventPublic, 'cmd_theme_'> & PickByPrefix<MonorailEventPublic, 'cmd_doc_'> & PickByPrefix<MonorailEventPublic, 'store_'> & PickByPrefix<MonorailEventPublic, 'env_auto_upgrade_'>;
declare const coreData: RuntimeMetadataManager<CmdFieldsFromMonorail, {
commandStartOptions: {
startTime: number;
packages/cli-kit/dist/public/node/monorail.d.ts@@ -2,7 +2,7 @@ import { JsonMap } from '../../private/common/json.js';
import { DeepRequired } from '../common/ts/deep-required.js';
export { DeepRequired };
type Optional<T> = T | null;
-export declare const MONORAIL_COMMAND_TOPIC = "app_cli3_command/1.28";
+export declare const MONORAIL_COMMAND_TOPIC = "app_cli3_command/1.29";
export interface Schemas {
[MONORAIL_COMMAND_TOPIC]: {
sensitive: {
@@ -49,6 +49,7 @@ export interface Schemas {
cmd_all_timing_network_ms?: Optional<number>;
cmd_all_timing_prompts_ms?: Optional<number>;
cmd_all_timing_active_ms?: Optional<number>;
+ cmd_doc_fetch_url_path?: Optional<string>;
env_auto_upgrade_enabled?: Optional<boolean>;
env_auto_upgrade_accepted?: Optional<boolean>;
env_auto_upgrade_skipped_reason?: Optional<string>;
|
Contributor
Author
|
Opting to close. Will rely on the private |
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?
shopify doc fetchis what theshopify-app-store-reviewskill uses to pull the App Store AI self-review requirements page. Since #7771 the command event already carriesapi_key/project_typewhen run inside an app, but nothing in the public payload says which document was fetched — the URL only exists inargs, which isprivacy: TEXTand redacted in the warehouse. So today we can see "this app randoc fetch" but not "this app ran a self-review", which blocks correlating skill usage with review outcomes.WHAT is this pull request doing?
cmd_doc_fetch_url_pathto theapp_cli3_commandpublic schema and bumpsMONORAIL_COMMAND_TOPICto1.29.docFetchServicerecordsURL.pathnameonly — no query string or fragment — after the host allowlist check passes, so the value is always a public shopify.dev docs path.CmdFieldsFromMonorailwith thecmd_doc_prefix so the field type-checks throughaddPublicMetadata.Depends on the schema landing first: Shopify/monorail#24489.
How to test your changes?
Or with
SHOPIFY_CLI_ANALYTICS_DEBUG-style verbose output, runshopify doc fetch --url https://shopify.dev/docs/apps/launch/app-store-review/app-store-ai-self-review-requirements --verboseand confirm the analytics payload containscmd_doc_fetch_url_path.Measuring impact
shopify-dw.base.base__monorail_app_cli3_commandpicks up new public fields on the 1.x topic.Checklist