cli icon indicating copy to clipboard operation
cli copied to clipboard

[Bug]: SHOPIFY_CLI_TTY behavior inverted when CLI crashes (same issue as #3391)

Open seanwbarry opened this issue 2 years ago • 2 comments

Please confirm that you have:

  • [X] Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
  • [X] Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

Theme

Expected behavior

CLI does not prompt for user input. This is the same issue as #3391

Actual behavior

prompts for user input. tty issue

Verbose output

shopify theme push --path ./ --theme $DEV_THEME_ID --store $SHOPIFY_STORE
3s
+ shopify theme push --path ./ --theme $DEV_THEME_ID --store $SHOPIFY_STORE
╭─ error ──────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  Failed to prompt:                                                           │
│                                                                              │
│  Push theme files to the published theme on                                  │
│  <store-url>?                                                                │
│                                                                              │
│  This usually happens when running a command non-interactively, for example  │
│   in a CI environment, or when piping input from another process.            │
│                                                                              │
│  To resolve this, specify the option in the command, or run the command in   │
│  an interactive environment such as your local terminal.

Reproduction steps

  1. create bitbucket account
  2. create repo for theme in bitbucket
  3. create this pipeline in repo:
pipelines:
  default:
    - step:
        name: Deploy
        image: ruby:3.1
        services:
          - docker
        caches:
          - node
        script:
          - echo "Hello World!"
          - apt-get update
          - apt-get install -y nodejs npm
          - npm install -g @shopify/cli @shopify/theme
          - echo $(ls)
          - export SHOPIFY_FLAG_STORE=$SHOPIFY_STORE
          - export SHOPIFY_CLI_THEME_TOKEN=$SHOPIFY_CLI_THEME_TOKEN
          - export SHOPIFY_CLI_TTY=$SHOPIFY_CLI_TTY
          - shopify theme push --path ./ --theme $DEV_THEME_ID --store $SHOPIFY_STORE
  1. set the environment variables as appropriate
  2. run the pipeline

Operating System

windows 11 (my system), however the build is running using docker

Shopify CLI version (check your project's package.json if you're not sure)

latest

Shell

No response

Node version (run node -v if you're not sure)

No response

What language and version are you using in your application?

No response

seanwbarry avatar Mar 29 '24 18:03 seanwbarry

hi @seanwbarry ! thanks for reporting this issue, i misspoke in my first comment (now deleted). we're moving away from using SHOPIFY_CLI_TTY for theme commands, instead use --force for CI to skip prompts. let us know if that fixes your issue 🙏

mgmanzella avatar Apr 01 '24 16:04 mgmanzella

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.

P.S. You can learn more about why we stale issues here.

github-actions[bot] avatar May 14 '24 03:05 github-actions[bot]

Hi @seanwbarry! Thanks for reporting this issue, can you try again with the latest CLI version and see if the issue still persists? Changes were shipped for https://github.com/Shopify/cli/issues/1573 that resolved a bug where SHOPIFY_CLI_TTY was not being respected. Thanks in advance

lukeh-shopify avatar Jun 14 '24 00:06 lukeh-shopify

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.

P.S. You can learn more about why we stale issues here.

github-actions[bot] avatar Jul 26 '24 03:07 github-actions[bot]