Skip to content

Error before app config link prompts in non-TTY#7687

Open
gonzaloriestra wants to merge 1 commit into
cli-interactivity/theme-dev-reconciliationfrom
cli-interactivity/non-tty-link-error
Open

Error before app config link prompts in non-TTY#7687
gonzaloriestra wants to merge 1 commit into
cli-interactivity/theme-dev-reconciliationfrom
cli-interactivity/non-tty-link-error

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Related to https://github.com/shop/issues-develop/issues/22869

app config link can still reach prompt-only paths when a caller has not provided enough information to choose the remote app or local config file name. In non-interactive environments, that should fail with actionable guidance instead of attempting to render prompts.

This is especially important for commands that call linking indirectly: they should surface that the project needs to be linked first with explicit flags, rather than hanging or failing inside prompt rendering.

WHAT is this pull request doing?

  • Adds a shared non-TTY guard before app config link prompts for remote app selection.
  • Adds the same guard before app config link prompts for a new config file name.
  • Suggests rerunning shopify app config link with the missing required flags, such as --client-id or --file-name.
  • Covers both non-TTY failure paths in the link service tests.

How to test your changes?

  • CI=1 shopify app config link
  • CI=1 shopify app config link --client-id new-app

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 Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@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 Jun 1, 2026
@gonzaloriestra gonzaloriestra changed the base branch from cli-interactivity/app-config-validate to graphite-base/7687 June 1, 2026 12:39
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch from eebbb8e to 733fe27 Compare June 1, 2026 12:39
@gonzaloriestra gonzaloriestra changed the base branch from graphite-base/7687 to cli-interactivity/theme-dev-reconciliation June 1, 2026 12:39
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/theme-dev-reconciliation branch from e4069c5 to c5d2d3f Compare June 1, 2026 12:45
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch 2 times, most recently from 3487ec3 to a8e4e4a Compare June 1, 2026 13:43
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch from a8e4e4a to b24beaf Compare June 15, 2026 10:53
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/theme-dev-reconciliation branch from c5d2d3f to 2b45cf7 Compare June 15, 2026 10:53
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch from b24beaf to 8df1e6c Compare June 15, 2026 11:40
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/theme-dev-reconciliation branch 2 times, most recently from 3fcd3c1 to e4ccca0 Compare June 15, 2026 11:46
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch from 8df1e6c to 954ecef Compare June 15, 2026 11:46

Copy link
Copy Markdown
Contributor Author

/snapit

1 similar comment

Copy link
Copy Markdown
Contributor Author

/snapit

@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch from 19d3710 to fbfc2d3 Compare June 16, 2026 08:58
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/theme-dev-reconciliation branch from e4ccca0 to 469f7c2 Compare June 16, 2026 08:58

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260616085935

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch from fbfc2d3 to c2d923e Compare June 16, 2026 11:26
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/theme-dev-reconciliation branch from 469f7c2 to 1e5307e Compare June 16, 2026 11:26

Copy link
Copy Markdown
Contributor Author

/snapit

@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/theme-dev-reconciliation branch from 1e5307e to 5a86eaf Compare June 16, 2026 12:03
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch from c2d923e to 0fa5c90 Compare June 16, 2026 12:03
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch from c12f23e to e64d42b Compare July 7, 2026 11:19
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/theme-dev-reconciliation branch from 167ff71 to a878d9f Compare July 7, 2026 11:19
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch from e64d42b to 86de035 Compare July 7, 2026 11:42
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/theme-dev-reconciliation branch from a878d9f to 37116bd Compare July 7, 2026 11:42
Comment thread packages/app/src/cli/services/app/config/link.ts Outdated
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch from 86de035 to 21035e3 Compare July 9, 2026 09:54
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/theme-dev-reconciliation branch 2 times, most recently from 6c7775b to d840f99 Compare July 9, 2026 10:01
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch 2 times, most recently from 01818eb to da1b9b5 Compare July 9, 2026 10:12
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/theme-dev-reconciliation branch 2 times, most recently from 21264f3 to 0141b85 Compare July 9, 2026 11:30
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch 2 times, most recently from d69a6a6 to 98207d9 Compare July 13, 2026 11:09
@github-actions

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/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/public/common/object.d.ts
@@ -38,14 +38,6 @@ export declare function mapValues<T extends object, TResult>(source: T | null |
  * @returns True if the objects are equal, false otherwise.
  */
 export declare function deepCompare(one: object, two: object): boolean;
-/**
- * Deeply compares two values and treats arrays as order-insensitive.
- *
- * @param one - The first value to be compared.
- * @param two - The second value to be compared.
- * @returns True if the normalized values are equal, false otherwise.
- */
-export declare function deepCompareWithOrderInsensitiveArrays(one: unknown, two: unknown): boolean;
 /**
  * Return the difference between two nested objects.
  *
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.
  *

@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch from 98207d9 to 8bbb221 Compare July 13, 2026 11:15
@gonzaloriestra gonzaloriestra requested a review from a team as a code owner July 13, 2026 11:15
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch from 8bbb221 to 1a3ddeb Compare July 13, 2026 11:22
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/theme-dev-reconciliation branch from 0a8a2d3 to 42c3570 Compare July 13, 2026 11:22
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch from 1a3ddeb to adbdf99 Compare July 13, 2026 11:31
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/theme-dev-reconciliation branch from 42c3570 to 8d0d5a2 Compare July 13, 2026 11:31
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch from adbdf99 to 8cc0e88 Compare July 13, 2026 12:07
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/theme-dev-reconciliation branch from 8d0d5a2 to 4f7a225 Compare July 13, 2026 12:07

Copy link
Copy Markdown
Contributor Author

/snapit

1 similar comment
@gonzaloriestra

Copy link
Copy Markdown
Contributor Author

/snapit

@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/non-tty-link-error branch from 8cc0e88 to 874968a Compare July 14, 2026 08:02
@gonzaloriestra gonzaloriestra force-pushed the cli-interactivity/theme-dev-reconciliation branch from 4f7a225 to 6de9f11 Compare July 14, 2026 08:02

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260714080904

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

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

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants