Skip to content

Allow app config validate to target config by client ID#7631

Open
gonzaloriestra wants to merge 1 commit into
mainfrom
cli-interactivity/app-config-validate
Open

Allow app config validate to target config by client ID#7631
gonzaloriestra wants to merge 1 commit into
mainfrom
cli-interactivity/app-config-validate

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented May 25, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

The interactivity audit found that shopify app config validate --client-id <id> can still prompt while resolving the active local config, especially when the cached config points at a file that no longer exists.

WHAT is this pull request doing?

  • Skips active-config recovery prompts during the validation preflight when --client-id is provided.
  • Preserves the existing interactive config recovery behavior when --client-id is not provided.

How to test your changes?

Remove the current config and pass a client from another one. It should validate without asking for the config.

shopify app config validate --client-id

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, so I've added a changelog entry with pnpm changeset add

gonzaloriestra commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

@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 May 25, 2026
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-validate branch from 51b7815 to 63fab66 Compare June 1, 2026 11:43
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-link branch 2 times, most recently from 22f6bf8 to 1dcfefd Compare June 1, 2026 11:58
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-validate branch 2 times, most recently from 4bd2cf5 to 986b2a7 Compare June 1, 2026 12:20
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-validate branch from 986b2a7 to 872015f Compare June 1, 2026 12:45
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-link branch from 1dcfefd to 7bc268b Compare June 1, 2026 12:45
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-validate branch from 872015f to 81fed1d Compare June 15, 2026 10:53
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-link branch from 7bc268b to 2247c50 Compare June 15, 2026 10:53
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-validate branch from 81fed1d to 950e211 Compare June 16, 2026 08:58
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-link branch from 2247c50 to 87644b5 Compare June 16, 2026 08:58
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-validate branch 3 times, most recently from 8cfe2a7 to e2500b0 Compare June 16, 2026 13:14
@gonzaloriestra gonzaloriestra marked this pull request as ready for review June 16, 2026 13:22
@gonzaloriestra gonzaloriestra requested a review from a team as a code owner June 16, 2026 13:22
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-link branch from 87644b5 to 772ca83 Compare July 1, 2026 14:10
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-validate branch from e2500b0 to 3913769 Compare July 1, 2026 14:10
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-link branch from 772ca83 to 4fc790f Compare July 2, 2026 11:33
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-validate branch 2 times, most recently from 2f2fa6d to d3c61c4 Compare July 2, 2026 12:07
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-link branch 2 times, most recently from 7032f1f to fed0194 Compare July 2, 2026 12:43
@gonzaloriestra gonzaloriestra requested a review from a team as a code owner July 2, 2026 12:43
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-validate branch from d3c61c4 to 2dd690e Compare July 2, 2026 12:43
@github-actions github-actions Bot added Area: @shopify/app @shopify/app package issues and removed no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. labels Jul 2, 2026
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-validate branch from 2dd690e to 847afd2 Compare July 2, 2026 13:41
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-link branch from fed0194 to 7cb3d48 Compare July 2, 2026 13:41
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-validate branch from 847afd2 to f25a459 Compare July 7, 2026 11:02
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-link branch from 7cb3d48 to 72d1300 Compare July 7, 2026 11:02

Copy link
Copy Markdown
Contributor

When using --client-id, if the cached config still exists, it ignores the client-id value, it shouldn't no?

@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-link branch from 72d1300 to fd60151 Compare July 9, 2026 08:57
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-validate branch from f25a459 to 1ad8032 Compare July 9, 2026 09:54
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Differences in type declarations

We 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:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

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;

@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-link branch from fd60151 to 9bafc2f Compare July 9, 2026 10:12
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-validate branch from 1ad8032 to 6d26b55 Compare July 9, 2026 10:12
Base automatically changed from cli-interactivity/app-config-link to main July 9, 2026 11:34
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-validate branch from 6d26b55 to 86468f6 Compare July 13, 2026 11:22
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/app-config-validate branch from 86468f6 to fdb6f29 Compare July 14, 2026 08:02

gonzaloriestra commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

@isaacroldan it works for me, how did you try? I'm trying with @shopify/cli@0.0.0-snapshot-20260714080904

❯ shopify app config validate
╭─ success ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                           │
│  App configuration is valid.                                                                                                                              │
│                                                                                                                                                           │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

❯ shopify app config validate --client-id 9daae8812f3f04701f4959d481d05786
╭─ error ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                           │
│  Validation errors in /Users/gonzalo/tests/0706/shopify.app.0706b.toml:                                                                                   │
│                                                                                                                                                           │
│  [embedded]: Value must be Boolean                                                                                                                        │
│                                                                                                                                                           │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

@isaacroldan

Copy link
Copy Markdown
Contributor

um, the issue is that I was making changes in the toml that I think prevented parsing it and then it defaulted to the cached one 🤔 Which I think is... correct? or not? is confusing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/app @shopify/app package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants