Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Integration flag for theme push #3734

Open
knjshimi opened this issue Apr 17, 2024 · 12 comments
Open

[Feature]: Integration flag for theme push #3734

knjshimi opened this issue Apr 17, 2024 · 12 comments
Labels
Area: @shopify/theme @shopify/theme package issues Type: Enhancement New feature or request

Comments

@knjshimi
Copy link

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 knjshimi added the Type: Enhancement New feature or request label Apr 17, 2024
@notkurt
Copy link

notkurt commented Apr 17, 2024

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.

@Jay-Plumb
Copy link

Jay-Plumb commented May 1, 2024

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

Copy link
Contributor

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.

@illarionvk
Copy link

This is still relevant and important.

Copy link
Contributor

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.

@knjshimi
Copy link
Author

Still relevant

Copy link
Contributor

github-actions bot commented Sep 7, 2024

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.

@knjshimi
Copy link
Author

knjshimi commented Sep 7, 2024

still relevant

Copy link
Contributor

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.

@notkurt
Copy link

notkurt commented Oct 20, 2024

Still relevant

@dev-mr
Copy link

dev-mr commented Nov 11, 2024

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

@jamesmengo
Copy link
Contributor

Blocked by #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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: @shopify/theme @shopify/theme package issues Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants