Skip to content

Expose structured app validation issues in JSON output#7070

Draft
dmerand wants to merge 3 commits intodlm-app-validate-errorsfrom
dlm-app-validate-error-shape
Draft

Expose structured app validation issues in JSON output#7070
dmerand wants to merge 3 commits intodlm-app-validate-errorsfrom
dlm-app-validate-error-shape

Conversation

@dmerand
Copy link
Contributor

@dmerand dmerand commented Mar 20, 2026

What

Expose structured validation issues in shopify app 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

Goal 3 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 issues array.

When only rendered text is available, synthesize a root issue 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 validate --json against invalid app configs and confirm failures return {valid: false, issues: [...]} for both normal validation errors and early loader-style aborts.

Copy link
Contributor Author

dmerand commented Mar 20, 2026

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
Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 82.25% 15019/18261
🟡 Branches 74.7% 7445/9967
🟢 Functions 81.36% 3793/4662
🟢 Lines 82.65% 14197/17178

Test suite run success

3936 tests passing in 1506 suites.

Report generated by 🧪jest coverage report action from 9b0ba08

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant