Add --country flag to store create dev#7947
Open
amcaplan wants to merge 62 commits into
Open
Conversation
Replaces the single catch-all Bugsnag bucket (~1,170 unrelated GraphQL/API errors across app/theme/store/hydrogen) with grouping derived from the original typed error's HTTP status and GraphQL extensions.code, rather than regex- reparsing a stringified message. - New error-grouping.ts: structured-first decision table (THROTTLED/429->rate_limit, 401->authentication, 403/ACCESS_DENIED->permission, 5xx->server), shared keyword categorizer as fallback, and undefined for unknown errors so Bugsnag stack-trace grouping is preserved. - error-handler.ts: sets event.groupingHash only when a real category resolves, and emits error_grouping metadata (slice_name, http_status, error_code, error_class) so backend routing works regardless of CLI version. - error.ts: raw graphql-request ClientError 401/429/THROTTLED is now treated as expected and kept out of crash reporting. Shared error-categorizer.ts / storage.ts (Monorail taxonomy) are untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Knip flagged the interface as an unused export — it is only used internally as the return type of errorGroupingSignals; callers destructure inline. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Assisted-By: devx/35aa2b43-cb40-4048-859c-af48d6d3ca28
Assisted-By: devx/3c9d2be5-81a1-4ad5-90ba-4155c6ff125d
…r, suppression naming Responds to Mbarak's review on #7901: - Scan every GraphQL error (not just errors[0]) for routing codes, recognizing THROTTLED/429 and ACCESS_DENIED incl. nested App Management app_errors access_denied. Extracted into a dependency-free graphql-error-codes module shared by grouping and crash-report suppression (avoids the error.ts -> headers.ts -> error.ts import cycle). - Add the string GraphQL code "429" as a rate-limit signal, matching errorsIncludeStatus429 in private/node/api.ts. - Merge object signals over message-derived signals field-by-field with `??` so an absent object code/status can no longer erase a recovered value. - Single resolveErrorGrouping() returns {hash, category, signals}; the reporter drives both event.groupingHash and the error_grouping metadata from it, so the metadata now carries category and message-derived signals. - Rename isTransientApiError -> isExpectedApiError and document why 401 (expired/invalid credentials) is expected, distinct from rate limiting. - Document the deliberate 401-over-ACCESS_DENIED precedence and pin it + the new shapes with tests. Remove the issue-specific DESIGN.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wrap the two resolveErrorGrouping return objects across lines (prettier/prettier) and flatten the isExpectedApiError jsdoc to remove indented continuation lines (jsdoc/check-indentation, enforced on public API files). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…TH_CONDITION_TYPES Incidental codegen drift cleanup, not part of the error-grouping logic. The admin schema gained this OnlineStoreThemeFilesUserErrorsCode enum value upstream; the committed generated types were stale. The codegen check only runs when a PR touches graphql-pathed files, so this PR's new graphql-error-codes.ts un-skipped it and surfaced the pre-existing drift. Reproduces codegen output byte-for-byte (no local schema fetch available). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Assisted-By: devx/655cd991-b9e0-480d-ba60-50e176a7ce76
Assisted-By: devx/655cd991-b9e0-480d-ba60-50e176a7ce76
…_deterministic Make metadata timer tests deterministic
…g_guidance Clarify filesystem testing guidance
Route theme creation through the theme Admin request wrapper so ACCESS_DENIED responses use the existing friendly missing access error. Normalize requiredAccess prose that starts with "The user needs" before embedding it in the user-facing message. Co-authored-by: Pi AI <noreply@pi.dev> Assisted-By: devx/a1027ad2-ceec-4016-b728-d7c842f1fe88
Handle missing theme write access during theme creation
Group CLI crash reports on structured error signals
Use preview identity for store open analytics
Remove preview store user ID prefix
Assisted-By: devx/a2560e25-a597-4af7-92ea-24c6fa943415
Assisted-By: devx/782ef931-ac0a-4cc4-bff1-a2511c379664
Stop tracking generated docs interfaces
Assisted-By: devx/782ef931-ac0a-4cc4-bff1-a2511c379664
Assisted-By: devx/782ef931-ac0a-4cc4-bff1-a2511c379664
Assisted-By: devx/782ef931-ac0a-4cc4-bff1-a2511c379664
Assisted-By: devx/df67c0ff-0bc3-434a-b5d7-091c8efbac1e
Assisted-By: devx/df67c0ff-0bc3-434a-b5d7-091c8efbac1e
Assisted-By: devx/a2560e25-a597-4af7-92ea-24c6fa943415
Assisted-By: devx/782ef931-ac0a-4cc4-bff1-a2511c379664
Assisted-By: devx/782ef931-ac0a-4cc4-bff1-a2511c379664
360670c to
2337ab2
Compare
…surface Remove unused extension creation surface
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/private/node/constants.d.ts@@ -6,6 +6,7 @@ export declare const environmentVariables: {
doctor: string;
enableCliRedirect: string;
env: string;
+ firstPartyDev: string;
noAnalytics: string;
optOutInstrumentation: string;
appAutomationToken: string;
packages/cli-kit/dist/private/node/session.d.ts@@ -90,7 +90,6 @@ export declare function setLastSeenUserIdAfterAuth(id: string): void;
*/
export declare function getLastSeenAuthMethod(): Promise<AuthMethod>;
export declare function setLastSeenAuthMethod(method: AuthMethod): void;
-export declare function setCommandSessionId(sessionId: string | undefined): void;
export interface EnsureAuthenticatedAdditionalOptions {
noPrompt?: boolean;
forceRefresh?: boolean;
packages/cli-kit/dist/public/node/base-command.d.ts@@ -16,7 +16,6 @@ declare abstract class BaseCommand extends Command {
protected parse<TFlags extends FlagOutput & {
path?: string;
verbose?: boolean;
- 'auth-alias'?: string;
}, TGlobalFlags extends FlagOutput, TArgs extends ArgOutput>(options?: Input<TFlags, TGlobalFlags, TArgs>, argv?: string[]): Promise<ParserOutput<TFlags, TGlobalFlags, TArgs> & {
argv: string[];
}>;
packages/cli-kit/dist/public/node/cli.d.ts@@ -39,9 +39,6 @@ export declare const globalFlags: {
export declare const jsonFlag: {
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
};
-export declare const authAliasFlag: {
- 'auth-alias': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
-};
/**
* Builds a flag that only accepts a valid port number. The flag parses its
* value as an integer and rejects anything that isn't a whole number between 1 and
packages/cli-kit/dist/public/node/session.d.ts@@ -22,19 +22,6 @@ export type AccountInfo = UserAccountInfo | ServiceAccountInfo | UnknownAccountI
* @param userId - User identifier to report on the command analytics event.
*/
export declare function setLastSeenUserId(userId: string): void;
-/**
- * Finds a stored Shopify account session by alias without changing the current session.
- *
- * @param alias - The account alias to find.
- * @returns The matching session ID, or undefined if no session matches.
- */
-export declare function findSessionIdByAlias(alias: string): Promise<string | undefined>;
-/**
- * Selects a stored Shopify account session by alias for the current command process.
- *
- * @param alias - The account alias to select. Passing undefined clears the command selection.
- */
-export declare function setCurrentSessionAlias(alias?: string): Promise<void>;
interface UserAccountInfo {
type: 'UserAccount';
email: string;
packages/cli-kit/dist/public/node/context/local.d.ts@@ -63,6 +63,13 @@ export declare function alwaysLogAnalytics(env?: NodeJS.ProcessEnv): boolean;
* @returns True if SHOPIFY_CLI_ALWAYS_LOG_METRICS is truthy.
*/
export declare function alwaysLogMetrics(env?: NodeJS.ProcessEnv): boolean;
+/**
+ * Returns true if the CLI User is 1P.
+ *
+ * @param env - The environment variables from the environment of the current process.
+ * @returns True if SHOPIFY_CLI_1P is truthy.
+ */
+export declare function firstPartyDev(env?: NodeJS.ProcessEnv): boolean;
/**
* Returns true if the CLI can run the "doctor-release" command.
*
|
c6cddfa to
e69c6a6
Compare
2337ab2 to
6017086
Compare
Remove bundled UI extensions dev console
…ion-support Remove dashboard managed extension support flag
Unhide `shopify store auth list`, `shopify store open`, `shopify store list`, and `shopify store create preview` ahead of their public release. `shopify store create dev` remains hidden. Regenerated the oclif manifest and README, updated tests, and added a changeset per newly-public command. Assisted-By: devx/64aec273-1f35-4e4f-be5f-883631f97c64
Assisted-By: devx/64aec273-1f35-4e4f-be5f-883631f97c64
6017086 to
79a9328
Compare
e69c6a6 to
5e141f3
Compare
Assisted-By: devx/7f40dd7e-8ac5-44cb-8a46-99677b33f144
Extracts and shares the country-code validation already used by store create preview: countryFlag, isCountryCode, and a shared invalidCountryCodeMessage in flags.ts, plus devStoreFlags.country. The flag is validated, plumbed into createDevStore options, and shown in JSON/success output, but is NOT yet sent to the BP createAppDevelopmentStore mutation -- the published schema does not expose a country argument until shop/world#671185 (part of shop/world#22968) merges. GraphQL wiring is a trivial follow-up. Command is hidden; no changeset (not functional end-to-end yet). Assisted-By: devx/bf777827-dc69-4993-9b11-c401dc19c4be
The --country flag was collected and shown in output but never sent to the createAppDevelopmentStore mutation. Wire it through as the 'country' argument now that the backend supports it. Assisted-By: devx/de0d96e7-211c-4a8b-991d-240b9f675823
Assisted-By: devx/7f40dd7e-8ac5-44cb-8a46-99677b33f144
Assisted-By: devx/7f40dd7e-8ac5-44cb-8a46-99677b33f144
Assisted-By: devx/7f40dd7e-8ac5-44cb-8a46-99677b33f144
Assisted-By: devx/7f40dd7e-8ac5-44cb-8a46-99677b33f144
79a9328 to
cca2e79
Compare
fa7747b to
b2ebd9e
Compare
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.
What
Adds a
--countryflag toshopify store create dev, implementing the country piece of shop/world#22968, and shares the flag — definition, validation, and error message — withshopify store create preview.flags.tsexports a single sharedcountryFlagconstant (envSHOPIFY_FLAG_STORE_COUNTRY). Itsparsenormalizes the value to trimmed uppercase and validates the two-letter shape, throwing a consistentAbortErrorbefore a command'srunbody executes.isCountryCodeand the error message are internal implementation details of the flag.store create devandstore create previewreference this onecountryFlag, so validation and error output are identical and defined in exactly one place — no per-commandif-checks.store create devthreads--countryintocreateDevStore, which sends it to the BPcreateAppDevelopmentStoremutation and surfaces it in JSON and success output.Notes
parse(oclif enforces it), rather than being duplicated in each command.SHOPIFY_FLAG_PREVIEW_STORE_COUNTRYto the sharedSHOPIFY_FLAG_STORE_COUNTRY. The--countryflag is new/unreleased and the command ishidden, so there's no external impact.hidden; no changeset.