Repository navigation
[stable/5.1] Check stable-line pull requests with Patch QA and Patch provenance - #9197
Open
craigmichaelmartin wants to merge 13 commits into
Open
craigmichaelmartin wants to merge 13 commits into
craigmichaelmartin wants to merge 13 commits into
Conversation
Patch QA builds the @shopify/cli tarball a release of the pull request's head would publish, installs it on Linux, Windows and macOS (x64 and arm64), runs the checks that need no Shopify account, and fails if its files differ from the line's last release. Patch provenance passes only for a backport whose changes main already has (pinned to the main commit that added its patch changesets) and for the line's Version Packages pull request when it only versions the packages on top of the line's head. It runs from the stable line's own copy of the workflow and reads commits without running the pull request's code. After a release publishes, release.yml installs it from npm on Linux, Windows and macOS and runs the same checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 70e5333)
A JSON comparison of package.json and oclif manifests misses changes that parsing normalizes away, such as a duplicated key. Require the same lines, with only version lines changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 74e567d)
A backport now has to build on the line's head, and each file it changes has to be, whole, what the main commit that added its changesets does to that file when applied to the line. That commit must have reached main after the line's cut. Before, a backport could reuse an old changeset to bring back old main code, or apply only part of a main commit's change. A Version Packages pull request's new changelog section may only hold the consumed changesets' entries and dependency updates, and no versioned file may change mode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 477ca19)
- Patch QA also runs when a pull request is edited, so a pull request retargeted to a stable line gets it. It runs in full on every edit: a skipped run would count as passing. - The file comparison runs in its own job, so a difference no longer stops the platform installs. A difference only in the number of hashed bundle chunks warns instead of failing. - Patch QA and Release QA package build the tarball through one composite action. - The smoke test pins the Skeleton theme release instead of following its latest tag, and no longer turns off auto-upgrade, which CI=1 already skips. - The release smoke job gets 60 minutes: the wait for npm alone can take 30. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tter Patch provenance now builds each package's new changelog section with the changelog formatter at the line's head, never the pull request's, and requires the section to match it, apart from the order of entries. A missing entry, an extra line, a wrong dependency version or an entry in the wrong package fails. A line whose changesets config doesn't use ./changelog.cjs isn't supported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pull_request_target always loads the workflow from main, whatever the pull request's base, and from December 2, 2026 public repositories block it unless an Actions event policy allows it. On pull_request each stable line runs its own copy. The check still only reads the pull request's commits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A backport passed when every file it changed matched main's commit, so one that left files out could ship a changeset without its fix, or one change of a batched commit without the changeset that makes it a minor. Its tree must now be exactly main's commit applied to the line's head, so a fix that reached main together with other changes goes to a maintainer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Release QA package ran the shared build action from the commit it builds, and stable/4.9 and stable/5.0 don't have it, so a run from main for those lines stopped there. It now checks out the action from the workflow's own commit, and still builds the requested commit with that commit's own dependency setup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A backport fails when the line has had one of its changesets since its cut, or when main's commit changes anything the line already has, so a fix backported before, by hand or under another changeset, isn't released twice. - A Version Packages pull request fails when it consumes a minor or major changeset, or releases a version outside the line's own X.Y. - Every workspace package's pins of a released package must move to the new version, whether or not its package.json changed, and pnpm-lock.yaml must link each workspace package at the version its dependents pin. - The header says that a pull request that changes .github/ runs its own version of these checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A changeset can reach main on its own, for example when it's added after the fix that landed without it. A backport of that commit alone passed as all of main's commit, and would release a changelog entry for code the line may not have. It now fails, and a maintainer backports the fix together with its changeset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Topic help comes from the oclif manifest, so `shopify hydrogen --help` passed without importing Hydrogen. The smoke test now also prints the JSON output schemas of `shopify hydrogen check` and `shopify app info`, which load those commands' code from the plugins that provide them and need no account, and checks that each is the command's own schema. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed versions - A backport's origin is the landing on main that added its changesets: the commit on main's first-parent chain since the line's cut, compared with its first parent. A merged pull request's own commits no longer count, since one of them can carry a changeset that the merge changed. - main must still have each of the backport's changesets as a patch for the fixed group, unless a release's catch-up consumed it, and a changeset main added more than once since the cut (a revert and a reland) fails. - A Version Packages bump must set version.ts and every oclif manifest to the new version, whether or not it changed them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s last bump - A changeset a release's catch-up consumed must have been a patch for the fixed group in main's last copy before that release. - main's head must still have all of the landing's change: applying it to main's head changes nothing outside its changesets, and every file it added is still there. A revert, or a later change to the same lines, fails, and a maintainer decides whether the line takes the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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/common/version.d.ts@@ -1 +1 @@
-export declare const CLI_KIT_VERSION = "5.2.0";
\ No newline at end of file
+export declare const CLI_KIT_VERSION = "5.1.0";
\ No newline at end of file
packages/cli-kit/dist/private/node/session.d.ts@@ -61,53 +61,21 @@ export interface OAuthSession {
appManagement?: string;
userId: string;
}
-/**
- * What a command analytics user ID identifies:
- *
- * - `account`: a Shopify account UUID.
- * - `store_admin_user`: the numeric ID of a user of a store's admin.
- * - `preview_store_shop`: the shop ID that a preview store created without an account reports.
- * - `credential`: a pseudonym derived from a token or a password.
- */
-export type UserIdKind = 'account' | 'store_admin_user' | 'preview_store_shop' | 'credential';
-/** A command analytics user ID and what it identifies. `kind` is `undefined` when that is not known. */
-interface AnalyticsUserId {
- id: string;
- kind: UserIdKind | undefined;
-}
type AuthMethod = 'partners_token' | 'service_account_token' | 'device_auth' | 'theme_access_token' | 'custom_app_token' | 'none';
/**
- * Retrieves a stable user identifier for analytics, and what it identifies, from one decision, so that the kind always
- * describes the ID that is returned.
+ * Retrieves a stable user identifier for analytics, or `'unknown'` if none applies.
*
* Evaluation order:
- * 1. If an automation token or theme token variable is set, returns a deterministic UUID derived from that secret, of
- * kind `credential`.
- * 2. Otherwise, if `setLastSeenUserIdAfterAuth` was called (e.g. after OAuth), returns that ID and the kind recorded
- * with it.
- * 3. Otherwise, if a persisted CLI session ID is available, returns it, of kind `account`.
- * 4. Otherwise returns `'unknown'`, of no kind.
- *
- * @returns A Promise that resolves to the user ID and its kind.
- */
-export declare function getLastSeenUserIdWithKindAfterAuth(): Promise<AnalyticsUserId>;
-/**
- * Retrieves a stable user identifier for analytics, or `'unknown'` if none applies. The ID is the one that
- * `getLastSeenUserIdWithKindAfterAuth` returns, in the same evaluation order.
+ * 1. If an app automation token or theme token is used, returns a deterministic UUID
+ * derived from that secret.
+ * 2. Otherwise, if `setLastSeenUserIdAfterAuth` was called (e.g. after OAuth), returns that value.
+ * 3. Otherwise, if a persisted CLI session id is available, returns it.
+ * 4. Otherwise returns `'unknown'`.
*
* @returns A Promise that resolves to the user ID as a string.
*/
export declare function getLastSeenUserIdAfterAuth(): Promise<string>;
-/**
- * Records the user ID of the command analytics event and what that ID identifies.
- *
- * `getLastSeenUserIdWithKindAfterAuth` returns the kind only together with this ID. A token variable takes precedence
- * over both, so that the kind never describes an ID that the event does not report.
- *
- * @param id - The user ID.
- * @param kind - What the user ID identifies. `undefined` records that it is not known.
- */
-export declare function setLastSeenUserIdAfterAuth(id: string, kind: UserIdKind | undefined): void;
+export declare function setLastSeenUserIdAfterAuth(id: string): void;
/**
* Retrieves the last seen authentication method used in the current session.
*
packages/cli-kit/dist/public/node/base-command.d.ts@@ -15,14 +15,6 @@ declare abstract class BaseCommand extends Command {
static descriptionWithMarkdown?: string;
static jsonOutputSchema?: JsonOutputSchema;
static get requiresSyncAnalytics(): boolean;
- /**
- * Whether the command's error messages are left out of the analytics event sent to the event collector, because they
- * can quote flag values that hold user data. The value is read before the flags are parsed, so it also covers an
- * error raised by flag parsing.
- *
- * @returns `true` to leave the command's error messages out.
- */
- static get withholdsErrorMessageFromAnalytics(): boolean;
static nonTTYFlagRequirements(_flags: FlagOutput): NonTTYFlagRequirement[];
static descriptionForHelp(): string | undefined;
/** @deprecated Use descriptionForHelp instead. */
packages/cli-kit/dist/public/node/metadata.d.ts@@ -43,13 +43,6 @@ declare const coreData: RuntimeMetadataManager<CmdFieldsFromMonorail, {
startTopic?: string;
startArgs: string[];
requiresSyncAnalytics?: boolean;
- withholdsErrorMessageFromAnalytics?: boolean;
- };
- graphqlExecute: {
- operation_type?: "query" | "mutation" | "unknown";
- query_source?: "inline" | "file";
- allow_mutations_flag_used?: boolean;
- variables_used?: boolean;
};
} & {
environmentFlags: string;
@@ -72,13 +65,6 @@ export declare const getAllPublicMetadata: () => Partial<CmdFieldsFromMonorail>,
startTopic?: string;
startArgs: string[];
requiresSyncAnalytics?: boolean;
- withholdsErrorMessageFromAnalytics?: boolean;
- };
- graphqlExecute: {
- operation_type?: "query" | "mutation" | "unknown";
- query_source?: "inline" | "file";
- allow_mutations_flag_used?: boolean;
- variables_used?: boolean;
};
} & {
environmentFlags: string;
@@ -100,13 +86,6 @@ export declare const getAllPublicMetadata: () => Partial<CmdFieldsFromMonorail>,
startTopic?: string;
startArgs: string[];
requiresSyncAnalytics?: boolean;
- withholdsErrorMessageFromAnalytics?: boolean;
- };
- graphqlExecute: {
- operation_type?: "query" | "mutation" | "unknown";
- query_source?: "inline" | "file";
- allow_mutations_flag_used?: boolean;
- variables_used?: boolean;
};
} & {
environmentFlags: string;
packages/cli-kit/dist/public/node/session-prompt.d.ts@@ -1,5 +1,3 @@
-import { NEW_LOGIN_LABEL } from '../../private/node/session/constants.js';
-export { NEW_LOGIN_LABEL };
/**
* Prompts the user to select from existing sessions or log in with a different account.
*
packages/cli-kit/dist/public/node/session.d.ts@@ -20,11 +20,8 @@ export type AccountInfo = UserAccountInfo | ServiceAccountInfo | UnknownAccountI
* Records the user ID that should be attached to command analytics for this process.
*
* @param userId - User identifier to report on the command analytics event.
- * @param kind - What the user ID identifies: a Shopify account UUID (`account`), the numeric ID of a user of a store's
- * admin (`store_admin_user`), the shop ID that a preview store created without an account reports
- * (`preview_store_shop`), or a pseudonym derived from a token or a password (`credential`). Omit it when it is not known.
*/
-export declare function setLastSeenUserId(userId: string, kind?: 'account' | 'store_admin_user' | 'preview_store_shop' | 'credential'): void;
+export declare function setLastSeenUserId(userId: string): void;
/**
* Finds a stored Shopify account session by alias without changing the current session.
*
@@ -174,7 +171,7 @@ export declare function isServiceAccountTokenSet(): boolean;
*/
export declare function ensureNoServiceAccountToken(): void;
/**
- * Logout from Shopify. Revokes the stored tokens at Identity, best effort, then removes local session data.
+ * Logout from Shopify.
*
* @returns A promise that resolves when the logout is complete.
*/
packages/cli-kit/dist/public/node/store-auth-session.d.ts@@ -103,17 +103,6 @@ export declare function clearStoredStoreAppSession(store: string, userIdOrStorag
* @returns An Admin session, or undefined when no usable session is cached.
*/
export declare function getStoreAuthAdminSession(store: string, storage?: LocalStorage<StoreAuthSessionSchema>): AdminSession | undefined;
-/**
- * What the user ID of a stored store auth session identifies, for command analytics.
- *
- * - A standard session's user ID is the numeric ID of a user of the store's admin.
- * - A preview store created without an account reports its shop ID as the user ID.
- * - A preview store created with a placeholder account reports that account's UUID.
- *
- * @param session - The stored store auth session.
- * @returns The kind of the session's user ID.
- */
-export declare function storedSessionUserIdKind(session: StoredStoreAppSession): 'account' | 'store_admin_user' | 'preview_store_shop';
/**
* Check whether a stored store auth session is expired, including the refresh margin.
*
packages/cli-kit/dist/private/node/api/graphql.d.ts@@ -11,16 +11,6 @@ export declare function sanitizeVariables(variables: Variables): string;
* the full JSON representation if no messages can be extracted.
*/
export declare function extractGraphQLErrorMessages(errors: any[] | undefined): string | undefined;
-/**
- * Whether a request was refused because the session didn't use multi-factor authentication.
- *
- * Business Platform and the Admin API answer such a request with HTTP 401 and a `[TFA]` marker in the body.
- * A refreshed token keeps the session's authentication methods, so refreshing it can't satisfy the requirement.
- *
- * @param error - The error thrown by graphql-request.
- * @returns True when the response is a 401 that carries the `[TFA]` marker.
- */
-export declare function isMfaRequiredError(error: unknown): boolean;
export declare function errorHandler(api: string): (error: unknown, requestId?: string) => unknown;
/**
* Reads the `x-request-id` header of a failed GraphQL response.
packages/cli-kit/dist/private/node/session/exchange.d.ts@@ -65,12 +65,4 @@ type IdentityDeviceError = (typeof identityDeviceErrors)[number];
*/
export declare function exchangeDeviceCodeForAccessToken(deviceCode: string): Promise<Result<IdentityToken, IdentityDeviceError>>;
export declare function requestAppToken(api: API, token: string, scopes?: string[], store?: string): Promise<Record<string, ApplicationToken>>;
-/**
- * Revokes a refresh token at Identity, which also revokes every access token minted from it.
- * Best effort: never throws.
- *
- * @param refreshToken - The refresh token to revoke.
- * @returns Whether Identity confirmed the revocation.
- */
-export declare function revokeRefreshToken(refreshToken: string): Promise<boolean>;
export {};
\ No newline at end of file
packages/cli-kit/dist/public/node/error/index.d.ts@@ -43,10 +43,6 @@ export declare abstract class FatalError extends Error {
export declare class AbortError extends FatalError {
constructor(message: TokenItem | OutputMessage, tryMessage?: TokenItem | OutputMessage | null, nextSteps?: TokenItem<InlineToken>[], customSections?: AlertCustomSection[]);
}
-/** An API refused a session that didn't use multi-factor authentication. */
-export declare class MfaRequiredError extends AbortError {
- constructor(requestId?: string);
-}
/**
* An external error is similar to Abort but has extra command and args attributes.
* This is useful to represent errors coming from external commands, usually executed by execa.
|
This branch has not been deployed
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?
Backports #9196 to
stable/5.1. Each stable branch runs its own copy of these workflows, so they check pull requests into the line only once they are on it.WHAT is this pull request doing?
The same change as #9196: Patch QA and Patch provenance on pull requests into the line, the shared tarball build for Patch QA and Release QA package, and the published-release smoke test in
release.yml.How to manually test your changes?
This pull request runs both checks on its own head. Patch QA should build the tarball, install it and pass the checks on all five platforms, and find the same files as
@shopify/cli@5.1.0. Patch provenance should fail, as it does for any pull request that isn't a backport ofmainor the line's Version Packages: this one changes.github/.🤖 Generated with Claude Code