Expose structured app validation issues in JSON output#7070
Closed
dmerand wants to merge 1 commit intodlm-app-validate-errorsfrom
Closed
Expose structured app validation issues in JSON output#7070dmerand wants to merge 1 commit intodlm-app-validate-errorsfrom
dmerand wants to merge 1 commit intodlm-app-validate-errorsfrom
Conversation
This was referenced Mar 20, 2026
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
Coverage report
Test suite run success4005 tests passing in 1529 suites. Report generated by 🧪jest coverage report action from fceb5d6 |
9b0ba08 to
b34f147
Compare
3c313f8 to
9d58583
Compare
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@@ -8,7 +8,6 @@ export declare const environmentVariables: {
env: string;
firstPartyDev: string;
noAnalytics: string;
- cliToken: string;
partnersToken: string;
runAsUser: string;
serviceEnv: string;
packages/cli-kit/dist/public/node/environment.d.ts@@ -10,12 +10,17 @@
*/
export declare function getEnvironmentVariables(): NodeJS.ProcessEnv;
/**
- * Returns the value of the SHOPIFY_CLI_TOKEN environment variable,
- * falling back to the deprecated SHOPIFY_CLI_PARTNERS_TOKEN.
+ * Returns the value of the SHOPIFY_CLI_PARTNERS_TOKEN environment variable.
*
- * @returns The CLI token value, or undefined if neither env var is set.
+ * @returns Current process environment variables.
+ */
+export declare function getPartnersToken(): string | undefined;
+/**
+ * Check if the current proccess is running using the partners token.
+ *
+ * @returns True if the current proccess is running using the partners token.
*/
-export declare function getCliToken(): string | undefined;
+export declare function usePartnersToken(): boolean;
/**
* Returns the value of the organization id from the environment variables.
*
packages/cli-kit/dist/private/node/session/exchange.d.ts@@ -25,7 +25,7 @@ export declare function exchangeAccessForApplicationTokens(identityToken: Identi
*/
export declare function refreshAccessToken(currentToken: IdentityToken): Promise<IdentityToken>;
/**
- * Given a custom CLI token passed as ENV variable, request a valid Partners API token.
+ * Given a custom CLI token passed as ENV variable, request a valid Partners API token
* This token does not accept extra scopes, just the cli one.
* @param token - The CLI token passed as ENV variable
* @returns An instance with the application access tokens.
@@ -35,7 +35,7 @@ export declare function exchangeCustomPartnerToken(token: string): Promise<{
userId: string;
}>;
/**
- * Given a custom CLI token passed as ENV variable, request a valid App Management API token.
+ * Given a custom CLI token passed as ENV variable, request a valid App Management API token
* @param token - The CLI token passed as ENV variable
* @returns An instance with the application access tokens.
*/
@@ -44,7 +44,7 @@ export declare function exchangeCliTokenForAppManagementAccessToken(token: strin
userId: string;
}>;
/**
- * Given a custom CLI token passed as ENV variable, request a valid Business Platform API token.
+ * Given a custom CLI token passed as ENV variable, request a valid Business Platform API token
* @param token - The CLI token passed as ENV variable
* @returns An instance with the application access tokens.
*/
|
9d58583 to
46515e4
Compare
b34f147 to
4cbff46
Compare
46515e4 to
365b143
Compare
4cbff46 to
28f8829
Compare
This was referenced Mar 25, 2026
28f8829 to
0456af0
Compare
365b143 to
15b52cf
Compare
0456af0 to
fceb5d6
Compare
15b52cf to
964455a
Compare
Contributor
Author
5 tasks
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
Expose structured validation issues in
shopify app config validate --json.This changes the public JSON response from a flat list of rendered error strings to a file-oriented
{valid, issues}shape, and keeps that shape consistent when validation fails before the normal service path runs.Why
Agentic validation work needs a stable machine-readable validation contract.
The human-readable output is fine for interactive use, but it is not a reliable interface for automation or repair loops. The command also needs to return JSON even when app loading aborts before
validateApp()can render the result.How
Use the structured issues preserved in the lower stack PR to emit a public
issuesarray.When only rendered text is available, synthesize a
rootissue so file-level context is not lost. For early aborts, parse the abort message into the same JSON shape and strip ANSI so colored terminal output does not leak into JSON strings.Testing
Run
shopify app config validate --jsonagainst invalid app configs and confirm failures return{valid: false, issues: [...]}for both normal validation errors and early loader-style aborts.