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]: deploy vs config push can delete WIP extensions not in main branch #3343

Closed
hsdonkin opened this issue Jan 31, 2024 · 14 comments
Closed
Labels
Type: Enhancement New feature or request

Comments

@hsdonkin
Copy link

What area(s) will this request affect?

App, Extension

What type of change do you want to see?

Substantial change to existing feature

Overview

We have a project with a WIP theme extension in a feature branch. I need to update our access scopes, but can't use config push anymore, due to CLI changes.

When I run deploy, I get the message:

?  Release a new version of APP NAME?

   ┃  Removes:
   ┃  - wip-theme-extension
   ┃
   ┃  This can permanently delete app user data.

   Type APP NAME to confirm, or press Escape to cancel.

Motivation

I don't want to run a full deployment and delete our WIP extension, but I do need to update the access scopes...

@hsdonkin hsdonkin added the Type: Enhancement New feature or request label Jan 31, 2024
@isaacroldan
Copy link
Contributor

Hi @hsdonkin,

Shopify apps now feature unified deployment of extensions and app configuration. This ensures that any dependencies between app configuration and extensions are versioned and released together. For staging and development, we'd recommend using a separate copy of your app in the Partner Dashboard, which you can release independently.

Learn more about releasing to different apps from the CLI in the App Configuration documentation.

@kinngh
Copy link

kinngh commented Feb 4, 2024

@isaacroldan here's a usecase for when this would actually be needed - I don't use the Remix CLI and have separate folders for extensions and the actual app ref: @kinngh/shopify-app-js. What happens here is if I just want to push my config to Shopify, I loose all my extensions wether in dev and prod (with dev and prod being independent apps in my partner dashboard).

If there's a way to just push the config up, that'd be really great since not everyone wants to be locked into Remix^

Screenshot 2024-02-04 at 8 16 55 PM

@isaacroldan
Copy link
Contributor

Hi @kinngh, this has nothing to do with Remix, you can still use the framework and folder structure of your preference.

The only difference is that now during app deploy we'll deploy both your extensions and the config defined in your toml file. So it's not possible to push just the config or just the extensions anymore.

By default the CLI looks for extensions in ./extensions, but you can override this value using the extension_directories config.

I'm curious to know more about your current setup, where did you you had your toml file before this CLI change? can you share more about your project folder structure?

@kinngh
Copy link

kinngh commented Feb 5, 2024

  • When I said Remix CLI I meant I don't use the Remix template and while I understand this has nothing to do with it, the idea was to state I don't use the recommended folder structure.
  • I did drop in an example of what the project looks like which is here @kinngh/shopify-app-js.
  • My toml file so far has just been in the root of the app so the CLI doesn't throw warnings about not being in an app directory.
  • The problem with unification of config + extensions has been in dev where I'm just working on the app and not on the extension and I can't update my scopes or application url without either pulling my entire project to dev or deleting extensions

@Jay-Plumb
Copy link

Jay-Plumb commented Feb 5, 2024

@hsdonkin / @kinngh I have the same issue.

It's entirely plausible that a developer works on a feature named feature_1 and introduces a UI Extension with certain access scopes. In parallel, another feature named feature_2 is worked on with a new (separate) UI Extension with different access scopes. There should be a way that we can work with one development app that:

  1. Does not delete the UI Extension
  2. Pushes up the new UI Extension with the correct scopes

In other words, there needs to be a cleaner or automated way to sync app scopes to the ones defined within shopify.app.dev.toml locally.

Solution

Bring back shopify app config push for those who build ui extensions or provide an equivalent approach going forward.

@hsdonkin
Copy link
Author

Thanks for getting back to me @isaacroldan !

For staging and development, we'd recommend using a separate copy of your app in the Partner Dashboard, which you can release independently.

Yeah this is what's kind of borking up our development flow, and might need some soul searching in Shopify app development in general. There's not really a practical way to separate prod / staging / development environments without creating whole new apps.

Our current DX:

  • We have a subscription app that requires really specific scopes, so we had to re-request all of those scopes again in order to create a development environment
  • We now have duplicate apps installed on our development store, and our team is getting confused about which app they should be working in
  • The .toml in our main branch has to point at the production app for CI/CD, but for development we have to point it at the development app (but remember not to commit anything on accident!)
  • Even for development branches on the development app, we can still delete extensions in progress if someone's branch doesn't include the correct .toml content, and our scopes can get out of sync
  • And, we can only have one team member working on each app at a time because of the cloudflare tunnel config 🙃

@isaacroldan
Copy link
Contributor

Thank you everyone for your feedback, i'm passing it internally so that it is considered in the next iterations of the platform.

@hsdonkin The CLI supports having multiple toml files, you can have one for production called shopify.app.production.toml that never changes and then as many as you need for each testing app.

Each person in the team might modify only the staging or personal toml, but never the production one.

Use shopify app config link to link to multiple apps and create new tomls
Use shopify app config use <toml name> to select the active toml

If you delete an extension in a branch that's using a custom dev toml, it will only affect that linked app and not any other, so it's safe.

Since each person uses its own development app with a custom toml, everyone can work at the same time with different tunnels. Just remember to use different names for each app so they are easy to identify in the store if you have multiple installed.

I think this should solve all the issues you mention right? let me know if it doesn't or you have any question.

@kinngh
Copy link

kinngh commented Feb 13, 2024

I believe another scenario that isn't taken into consideration is every time a url update happens that creates a new release, which means in dev apps the entire release is polluted with meaningless releases that are just URL updates for when you swap out your tunnel URL and no development has been done on the extension side. For production apps this makes sense, but pollutes dev instances.

Screenshot 2024-02-13 at 5 49 38 PM

@hsdonkin
Copy link
Author

hsdonkin commented Feb 15, 2024

@isaacroldan This is viable, but still has a couple issues! Our pain points still include re-re-requesting API scopes for each development app though, instead of being able to have a development environment within a single app.

For subscriptions and customer APIs, there's a whole scopes request process, so it's not easy to bring on a new developer.

We tried creating a new development app, but had some problems:

  • development app didn't have correct scopes, and so we had to re-request them
  • development app created was a custom app, not a draft public app, which couldn't use the billing API 🥲
  • started over and created a second development app, and had to go through the scopes request process for a third time (+7 days)

We're making the best of it, but not looking forward to adding a third developer to the project

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.

@hsdonkin
Copy link
Author

hsdonkin commented Apr 2, 2024

Bumping this because it's still a really relevant issue for us 😞 and because of this our theme app extensions have become malformed, and our app is connected to deleted extensions

@daviareias
Copy link

daviareias commented Apr 18, 2024

@isaacroldan anyway to reenable the shopify app config push command? We don't want to have to push the entire app and its extensions each time a change has to be made in config.

Our extension functions for example use Rust, and it's well known that compiling Rust takes a lot of time, I can't even imagine how much time is taking for people who also use the Shopify app template.

In our case we just want to opt in for the new auth flow, but there's no button in the admin dashboard to do this.

@isaacroldan
Copy link
Contributor

anyway to reenable the shopify app config push command? We don't want to have to push the entire app and its extensions each time a change has to be made in config.

I'm afraid this is not possible, the system is designed to deploy everything as a single version.

@hsdonkin We are working on improving the matching logic between local and remote extensions. Can't promise any dates though. You should be able to reset the current connection by removing the .env file where the extension identifiers are stored.

@isaacroldan
Copy link
Contributor

I'll close this issue since there are no updates and the original message has been addressed.

If you have any other problem with the CLI please open a new issue 🙏

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

No branches or pull requests

5 participants