Repository navigation
fix(app): skip app prompt when config is already linked - #6662
gonzaloriestra merged 8 commits into
Conversation
|
I have signed the CLA ✅ |
gonzaloriestra
left a comment
There was a problem hiding this comment.
It's looking good, thanks a lot! I added a refactor suggestion to simplify.
You don't have to worry about some of the CI failures, because some don't work on forks. But there are a few of things to fix:
- Run
pnpm test:regenerate-snapshotsto add the new command for some tests - Run
pnpm refresh-manifeststo update some auto-generated stuff - Run
pnpm knipto find some unused exports (and manually fix)
|
Hey @gonzaloriestra I’ve completed the refactor based on your suggestion:
Everything should now be ready for another review, thanks again for the guidance :) |
There was a problem hiding this comment.
Nice work! I've tested it and works great.
Almost there, you just need to run one more command to generate the documentation for the new command (sorry, I forgot to mention it before):
pnpm build-dev-docs
Other than that, I added a couple of suggestions to improve the messaging and simplify the code a bit.
|
@gonzaloriestra |
gonzaloriestra
left a comment
There was a problem hiding this comment.
Thanks a lot for applying the suggestions! Everything looks great now.
The only pending step is to fix the linter: there's an unused import. You can check it with pnpm lint.
Once that's fixed, I'll merge it. Thanks again! 👏
|
@gonzaloriestra |
WHY are these changes introduced?
The original issue (#6293) was about reducing unnecessary prompts when working with existing app configuration files.
After clarifications, it became clear that the behavior of:
shopify app config link --config <file>should not be changed — even when a valid
client_idexists, the command must still prompt for org/app selection.The correct solution is to introduce a new command that pulls the remote app information for an already-linked configuration file, without any prompts.
WHAT is this pull request doing?
This PR introduces a new command:
shopify app config pullThis new command:
--config)client_idapp config linkbehavior unchangedThis approach aligns with the expected behavior discussed in issue #6293.
How to test your changes
1. Prepare a config file with a valid
client_idExample:
shopify.app.staging.toml2. Run the new command
pnpm shopify app config pull --config shopify.app.staging.tomlExpected result
client_id3. Run without providing
--configpnpm shopify app config pull4. Ensure
app config linkbehavior is unchangedpnpm shopify app config link --config shopify.app.staging.tomlPost-release steps
No additional steps required — the new command is self-contained.