Skip to content

Keep automatic upgrade output in JSON diagnostics - #8845

Closed
isaacroldan wants to merge 1 commit into
mainfrom
codex/json-upgrade-output
Closed

isaacroldan wants to merge 1 commit into
mainfrom
codex/json-upgrade-output

Conversation

@isaacroldan

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Automatic global upgrades can append package-manager output to a command's final JSON document, which makes stdout invalid JSON.

WHAT is this pull request doing?

Route the upgrade subprocess through the shared JSON diagnostic streams and report upgrade completion as a diagnostic. Preserve inherited terminal streams and the success banner in text mode. Keep installed-version checks and subprocess failures.

This is a prerequisite for #8816, stacked on #8801.

How to manually test your changes?

Use an outdated global CLI installation with a newer release available in the same major version and automatic upgrades enabled.

  1. Run SHOPIFY_CLI_FORCE_AUTO_UPGRADE=1 shopify version --json --no-input > version.json 2> events.jsonl. This updates the global installation. Check that stdout contains one version object and upgrade output appears as JSON events on stderr.
  2. In another outdated global installation, repeat without --json. Check the existing package-manager output and upgrade success banner.

Validation

45 focused upgrade and postrun tests passed, with scoped lint, CLI Kit build, and CLI Kit type check. The new stdout/stderr tests fail when inherited subprocess output is restored. Subprocess installation was stubbed; no global packages were installed.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered documentation changes
  • I've considered analytics changes
  • Added the required patch changeset

@isaacroldan
isaacroldan requested a review from a team as a code owner October 9, 2026 08:14
@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Oct 9, 2026
@isaacroldan isaacroldan mentioned this pull request Oct 9, 2026
1 of 4 tasks
@isaacroldan
isaacroldan added this pull request to stack #8846 October 9, 2026 08:17
@isaacroldan
isaacroldan removed this pull request from stack #8846 October 9, 2026 08:19
@isaacroldan
isaacroldan added this pull request to stack #8847 October 9, 2026 08:20
Base automatically changed from qlaw/json-i23668-app-build to main October 9, 2026 08:50
@isaacroldan
isaacroldan force-pushed the codex/json-upgrade-output branch from 3114d0a to 0f577d0 Compare October 9, 2026 08:50
@isaacroldan isaacroldan closed this Oct 9, 2026
@isaacroldan
isaacroldan removed this pull request from stack #8847 October 9, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/cli @shopify/cli package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant