Store execute restructure#7188
Conversation
|
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. |
4edaf22 to
b8cace6
Compare
ec9fc5b to
176cf3b
Compare
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
176cf3b to
81f77d7
Compare
b8cace6 to
2259cc1
Compare
ryancbahan
left a comment
There was a problem hiding this comment.
Changes make sense to me. i'm ready to ✅ but realize that I left non-approving comments on the dependent pr below. LMK if you want to ship this stack just to get the initial refactor in, or if you want to investigate any of my comments in below stack.

What
Restructure
shopify store executeunderpackages/cli/src/cli/services/store/execute/and keep the full stored auth session alive through execute context.This keeps the CLI contract the same while making execute ownership and re-auth behavior more honest.
Why
The lower auth PR gives
store autha cleaner boundary, butstore executewas still flattening auth state too early.In practice that meant execute kept only
sessionUserIdin its context and fell back to placeholder scopes in its 401 re-auth path. That is the wrong shape for:The goal here is to make execute depend on the auth domain using the real stored auth identity rather than lossy fragments.
How
This PR moves execute code under
services/store/execute/and separates:execute/index.ts— execute orchestrationexecute/request.ts— request preparationexecute/result.ts— result writing/outputexecute/targets.ts— target selectionexecute/admin-context.ts— admin context loadingexecute/admin-transport.ts— admin GraphQL executionIt also changes execute context to carry the full stored auth session instead of only
sessionUserId, so execute invalidation can clear the right stored user session and prompt re-auth with the real stored scopes.High-level comparison:
This PR stays internal to execute ownership and auth-context shape. Broader command-contract work stays in the top stacked PR.
Testing
Manual checks:
Then invalidate the stored app auth for that store and re-run
shopify store execute ....Verify that:
Considered
shopify store *contract cleanup: out of scope for this PR.sessionUserIdand patch the 401 path in place: rejected because it preserves the same lossy seam.Measuring impact
Checklist