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

Forbid synced configs to be edited in Admin panel #68

Open
goodhoko opened this issue Sep 4, 2022 · 3 comments
Open

Forbid synced configs to be edited in Admin panel #68

goodhoko opened this issue Sep 4, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@goodhoko
Copy link
Contributor

goodhoko commented Sep 4, 2022

Feature request

Summary

Add an option that makes it impossible to edit configs eligible for exporting from the Admin panel.

Why is it needed?

I'm using the config-sync plugin as outlined in the Workflow section of its documentation. I.e. I alter the configs locally, check the changes into git, and then import them on remote (staging/prod) environments.

Since my deploys to remote envs are fully automated I'm taking advantage of the importOnBootstrap option to import the changes automatically with every deploy. This causes any changes in the DB to be overwritten. This is ultimately correct, as the developer's (and hence the imported) config version should be the source of truth. However it can still cause confusion and/or trouble as users using the Admin panel may not know/understand their changes will disappear with the next deploy.

Suggested solution(s)

The optimal solution is to have an option in the plugin's config that, when set to true, prevents any writes to configs eligible for exporting. This option can then be set depending on the environment.

Indicating that a config is locked in the Admin Panel GUI would be very nice, but simply returning an error after submit would work too, IMO.

@boazpoolman boazpoolman added the enhancement New feature or request label Sep 5, 2022
@boazpoolman
Copy link
Member

Hi @goodhoko.

Thanks for yet another great feature request.
IMO this is definitely something thats benefitial for the future of the plugin.

I'm not sure if we have that much control from within a plugin.
Changing the layout of other plugins (the lock indication) is something I surely know is not possible (yet).

For returning an error when trying to update locked settings I think we have to write some kind of middleware.
The middleware will check the request and if it is one that is locked, and the lock setting is set to true, it will act as an interference for finishing the request.

@BabyDino
Copy link

+1. We use this feature to import configs for different API's. We are running into this issue so we are not using the importOnBootstrap feature.

One example:

  • We have a table with e-mail templates. In our dev, we export staging/production ready email templates.
  • We'd like to use importOnBootstrap on staging/production, which would be ideal for a first run.
  • Now we change an imported template in staging or production
  • On the next run, importOnBootstrap overrides the customized template with the dev template.

So basically, if the state is Different for a template, we would like to have that entry skipped by importOnBootstrap. We only like to import the state Only in sync dir with importOnBootstrap.

@boazpoolman
Copy link
Member

@BabyDino That seems like a nice suggestion! I feel like it is a different feature then issue #68.
Could you maby create a new issue for this? It's def something I could do within short term.
I would suggest having a new boolean setting like soft. If that is set to true it will only import new config, not update or delete current ones. Love it!

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

No branches or pull requests

3 participants