nopCommerce icon indicating copy to clipboard operation
nopCommerce copied to clipboard

Do not store LimitedToStores / LimitedToRoles in plugin.json because of CI/CD

Open Manuel-Innovapps opened this issue 1 year ago • 6 comments

nopCommerce version: any

Steps to reproduce the problem:

  1. As of today, we have setup CI/CD Pipelines for nearly all of our customers, where we deploy nopCommerce from Bitbucket Pipelines to their hosting Server (Mostly Azure)
  2. During deployment the plugin.json for every plugin is overridden, which would require us to save LimitedToStores / LimitedToRoles inside our repo, which doesn't make a lot of sense.
  3. Also if the customer decides to make a change to LimitedToStores / LimitedToRoles during runtime, nobody will notice, and we would override the file with the old information during the next deployment.

As CI/CD pipelines become much more common these days, we think that we can't be the only ones having this problem.

Also we haven't figured out a viable workaround for this, expect to override the appropriate PluginManager, which cause some work.

Manuel-Innovapps avatar Mar 07 '23 06:03 Manuel-Innovapps

It seems to me easier to set up the СD in such a way that it does not overwrite the configuration files. Historically, we don't store any information about plugins in the database and allow users to change plugins through the file system, otherwise the plugin system would be very inflexible. I do not see a way to transfer this functionality without global changes.

skoshelev avatar Mar 07 '23 07:03 skoshelev

But not deploying the plugin.json would bring other problems. What about if we update the plugin version locally to add a new migration? If we don't overrwrite the plugin.json, the migration would not be executed.

I see your point, but as you suggest, I think this would require global changes.

Manuel-Innovapps avatar Mar 07 '23 07:03 Manuel-Innovapps

Well, that's a good clarification. I was thinking that we could consider a fairly simple migration of the LimitedToStores / LimitedToRoles properties to the root plugins.json file. I guess it won't be too hard and will solve the CI/CD problem

skoshelev avatar Mar 07 '23 10:03 skoshelev

Yep, I think that should work out. We initially also tried to deploy the plugins.json, but we have stopped that trough all customers, because of other issues.

So deploying the plugins.json is not a good idea in itself, so I think your idea should work out!

Manuel-Innovapps avatar Mar 07 '23 10:03 Manuel-Innovapps

Is there any update on this?

We also experienced this with Widget-Display order, so the problem is bigger than initially expected

Manuel-Innovapps avatar Oct 05 '23 06:10 Manuel-Innovapps

@AndreiMaz @skoshelev Are there any plans to incorporate this into the next version?

If not we will be required to find a custom solution for our customers for this general problem! Thanks for your opinion!

Manuel-Innovapps avatar Oct 11 '23 13:10 Manuel-Innovapps