Remove theme directory confirmation during tests and make confirmation dialogue respect SHOPIFY_CLI_TTY#1369
Conversation
This comment has been minimized.
This comment has been minimized.
Contributor
Coverage report
Test suite run success1052 tests passing in 536 suites. Report generated by 🧪jest coverage report action from 567c9f8 |
2 tasks
SHOPIFY_CLI_TTY
mgmanzella
approved these changes
Feb 16, 2023
Contributor
mgmanzella
left a comment
There was a problem hiding this comment.
noice 🔥 thank you @Poitrin!
…nds/common/root_helper.rb Co-authored-by: Morisa Manzella <manzella.morisa@gmail.com>
Contributor
Benchmark reportThe following table contains a summary of the startup time for all commands.
|
Contributor
Author
|
@karreiro suggested to replace the |
karreiro
approved these changes
Feb 17, 2023
mgmanzella
approved these changes
Feb 17, 2023
Poitrin
pushed a commit
to Shopify/shopify-cli
that referenced
this pull request
Mar 3, 2023
### WHY are these changes introduced? Backports changes from CLI 3 to CLI 2, until CLI 2 is sunset. ### WHAT is this pull request doing? Back-port from * Shopify/cli#1369 * Shopify/cli#1410
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.
WHY are these changes introduced?
Fixes #1136
Issue 1:
@ctx.testing?istrueeven outside a testing environmentCLI was hanging when
theme pullwas executed in a directory with already existing files.CLI should have shown question
but was never shown, due to
Discussion why
raise … if @ctx.testing?was introduced can be found here. Because@ctx.testing?returnstruebased onENV["CI"], we can’t differentiate between CLI running in partner’s pipeline or in CLI tests.Issue 2: Confirmation dialogue ignores environment variable
SHOPIFY_CLI_TTYMoreover, even after having removed
raise … if @ctx.testing?andSHOPIFY_CLI_TTYbeing set to0, CLI would still hang at the “It doesn’t seem like …” question.WHAT is this pull request doing?
raise … if @ctx.testing?.It doesn’t seem like you’re running this command in a theme directory.whenSHOPIFY_CLI_TTYis set to0, but continues topull.--forceflag as a way to confirm the command will not be included in the error message yet.shopify theme share/pull/push/serveif users are running the command in a theme/empty directory shopify-cli#2680 (comment)-f/--forceflag as a pattern for confirmation dialogues in the whole CLI #760How to test your changes?
mkdir ./test-foldercd ./test-foldertouch randomfile1.txt randomfile2.logcd ..shopify theme listCI=true pnpm shopify:run theme pull --theme <Your Theme ID> --path="./test-folder".It doesn’t seem like you’re running this command in a theme directory.and confirmation dialogueAre you sure you want to proceed?are shown.Ctrl+C.SHOPIFY_CLI_TTY=0 CI=true pnpm shopify:run theme pull --theme <Your Theme ID> --path="./test-folder".It doesn’t seem like you’re running this command in a theme directory.but continues topull.Ctrl+Cthe pull and make sure that your test-folder is a non-theme directory (again).CI=true pnpm shopify:run theme pull --theme <Your Theme ID> --path="./test-folder" --force.Measuring impact
How do we know this change was effective? Please choose one:
Checklist
devordeployhave been reflected in the internal flowchart.