Add sc theme diff to preview local-vs-server theme changes#5
Closed
mikel wants to merge 1 commit into
Closed
Conversation
The read-only sibling of `sc theme push`: it reports which templates and asset binaries have been added, modified, or only exist on the server, without pushing anything. Reuses the same SHA-256 asset-hash contract as push, so an unchanged binary is never flagged. `--exit-code` exits 9 on any difference, so CI can gate on a committed theme being in sync with what is deployed. Exit 9 is distinct from the error codes so automation can tell drift from a genuine failure. ComputeDiff is a pure function with full table-test coverage.
This was referenced Jun 19, 2026
Author
|
Superseded by #6 — the CLI agent-platform work collapsed into one PR off develop. Reopen if anything was missed. |
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.
Dependencies & PR Stack
This is a chain of PRs on the CLI:
develop
└ feature/content-api-alignment (#3)
└ feature/theme-assets-and-changes (#4)
└ feature/theme-diff (#5) (this PR)
Server side (core-gem): consumes the Store Management REST API from the gem chain, https://github.com/GetStoreConnect/core-gem/pull/8062 through #8072.
Summary
Stacked on #4. Adds
sc theme diff THEME— the read-only sibling ofsc theme push. It shows how a local theme diverges from the server's copy (templates and asset binaries) without pushing anything.Two audiences:
sc theme pushactually change?" before pushing.--exit-codeexits 9 on any difference, so a pipeline can gate on a committed theme being in sync with what's deployed:How it works
ReadLocalAssets+ the hash the server returns onGET /themes/:id), so an unchanged binary is never flagged — the diff matches exactly what push would upload.+), both-differ = modified (~), server-only = removed (-).Output
+/~/-grouped by templates/assets, or "in sync" when clean.--json:{templates:{added,modified,removed}, assets:{...}, has_changes, pushable, server_only}.Tests
ComputeDiffis a pure function with table-test coverage (added/modified/removed × templates + assets, in-sync, empty-server, count roll-ups). Fullmake testgreen;gofmtandgo vetclean. (golangci-lint runs in CI.)