cli icon indicating copy to clipboard operation
cli copied to clipboard

[Feature]: Integration flag for `theme push`

Open knjshimi opened this issue 1 year ago • 8 comments

What area(s) will this request affect?

Theme

What type of change do you want to see?

New feature

Overview

Introduce a flag for integration mode for theme push.

Example: shopify theme push --ci

The output would consist only of a json string that includes the theme, errors and warnings.

Idea of the output:

{
  "theme": {},
  "errors": {
    "Failed to upload file templates/collection.json": [
      "Section type 'main-list-collections' does not refer to an existing section file",
      "Other error related to templates/collection.json"
    ]
  },
  "warnings": [
    "The pattern 'templates/*.json' does not include subdirectories. To maintain backwards compatibility, we have modified your pattern to 'templates/**/*.json' to explicitly include subdirectories."
  ]
}

Motivation

Be able to use Shopify CLI as part of a custom CLI wrapper. The Shopify team is constantly changing the output of its commands, like text formatting, usage of stderr and stdout, adding/removing graphics, etc.

I need a simple and consistent way of knowing the actual results, without having to manipulate strings to extract the information.

Previously, shopify theme push --json would suffice, but recent changes have made it very difficult to deal with.

Now stderr is returning "main errors", while stdout is returning "error detail items" along with the actual json string of the theme result, and a bunch of other graphical elements (that are irrelevant for my integration purposes).

It's becoming very hard to combine the stderr with stdout to get the actual error items per main error (which normally represents a file).

knjshimi avatar Apr 17 '24 05:04 knjshimi

Seconding this.

It feels as if this year there have been a number of breaking changes when it comes to using the CLI within a CI environment. Typically we'd just keep our CI pipelines pinned at a known good version of the CLI, however there does not seem to be one. More specially it seems as if SHOPIFY_CLI_TTY=0 isn't being fully respected in the latest versions of the CLI.

Some other thoughts here is that the --ci flag should have a bit more consideration around breaking changes, accompanied by a suite of tests reflective of the CLI being used within a CI environment.

notkurt avatar Apr 17 '24 19:04 notkurt

I would also like to see the above change and also see any info wrapped within the json entry also. Right now on version 3.59.2 running shopify theme list --environment='eu_development' --theme="name" --json will output

╭─ info ──────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                 │
│  Using applicable flags from dev_flg environment:                                                        │
│                                                                                                                 │
│    • store: store.myshopify.com                                                                              │
│                                                                                                                 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

╭─ error ─────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                 │
│  The store.myshopify.com store doesn't have a theme with the "name" ID or name                          │
│                                                                                                                 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

so a structure that always returns JSON would be ideal when passing in --json flag

Jay-Plumb avatar May 01 '24 04:05 Jay-Plumb

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 Jun 13 '24 03:06 github-actions[bot]

This is still relevant and important.

illarionvk avatar Jun 13 '24 09:06 illarionvk

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]

Still relevant

knjshimi avatar Jul 26 '24 12:07 knjshimi

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 Sep 07 '24 03:09 github-actions[bot]

still relevant

knjshimi avatar Sep 07 '24 04:09 knjshimi

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 Oct 20 '24 03:10 github-actions[bot]

Still relevant

notkurt avatar Oct 20 '24 06:10 notkurt

SHOPIFY_FLAG_FORCE & SHOPIFY_CLI_TTY still being ignored in the latest cli version 3.69.4

dev-mr avatar Nov 11 '24 04:11 dev-mr

Blocked by https://github.com/Shopify/cli/issues/3863

@knjshimi @notkurt Thanks for the feedback and suggestions :) - your input was relevant in discussions about how to approach this issue.

We're trying to do change some foundational work in our rendering library to improve this experience across the board and adhere to CLI guidelines for output / logging. As such, I want to hold off on adding this feature until that work has been done - I'm hoping that those change will resolve this issue.

Thanks for helping us improve the CLI!

jamesmengo avatar Nov 28 '24 23:11 jamesmengo

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 Jan 10 '25 03:01 github-actions[bot]

Still relevant

knjshimi avatar Jan 10 '25 10:01 knjshimi

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 Feb 23 '25 03:02 github-actions[bot]

still relevant

knjshimi avatar Feb 23 '25 04:02 knjshimi