Shopify / cli

Build apps, themes, and hydrogen storefronts for Shopify
https://shopify.dev
MIT License
376 stars 112 forks source link

[Feature]:Base shopify.app.toml as template #3544

Open stephen-christie-ss opened 4 months ago

stephen-christie-ss commented 4 months ago

What area(s) will this request affect?

App

What type of change do you want to see?

Substantial change to existing feature

Overview

It is possible to create a new app from scratch, or to link to an existing app and pull its configuration into an app config TOML. However, there seems to be no way to create a new app according to a template.

The current support for deployment-specific configuration files provide the capabilities needed for Continuous Deployment with a powerful GitOps-style infrastructure-as-code. However, there is currently no build-in way to prepare a new app for deployment according to specifications committed to the repository as a template configuration file.

When starting to use the Shopify CLI for app configuration management, my assumption was that an shopify.app.toml without a app's client_id would be used as a template for creating new apps, or as a base for configurations to be inherited by the other app configuration files.

Proposal: Provide a tool, alongside 'shopify app link', which lets you create a new app according to the existing configuration in shopify.app.toml (including oauth scopes, etc.). This tool should not require that the template configuration is fully specified with client_id, etc. Note: this would still be compatible with the use of the shopify.app.toml as the default deployment, but I believe that the development workflow would be more obvious if this approach was to deprecated in favor of using it only as the template. If necessary, a separate template file could be introduced instead.

Motivation

We use GitLab CI for testing and deployment, and follow their recommendation to automatically deploy each feature development branch for review. This means setting up a new app for each development. Currently, this will also require managing a template of the shopify.app.toml with our own code during CI, to interface with the Shopify CLI's app configuration capabilites.

stephen-christie-ss commented 3 months ago

My attempt to accomplish this functionality with external templating tools was met with a hard blocker, since creating an app through these tools requires a CLI:

╭─ error ──────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  Flag not specified:                                                         │
│                                                                              │
│  client-id                                                                   │
│                                                                              │
│  This flag is required in non-interactive terminal environments, such as 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.                     │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
knjshimi commented 1 month ago

+1

github-actions[bot] commented 3 days ago

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 commented 1 hour ago

This is still relevant