storyblok / field-plugin

Create and deploy Storyblok Field Plugin
https://www.storyblok.com/docs/plugins/field-plugins/introduction
25 stars 3 forks source link

Extend CLI to enable deleting field-type plugins #382

Open edvinasjurele opened 3 months ago

edvinasjurele commented 3 months ago

Is your feature request related to a problem? Please describe.

There is a way to publish (creates new or updates existing one), but there is no way to delete plugins via CLI, hence only via admin panel.

Describe the solution you'd like

Add possibility to delete plugin by name (or id (?), but name makes more sense as the publishing happens by stating the name) via CLI

eunjae-lee commented 3 months ago

Hi @edvinasjurele Thank you for raising this issue. Could you explain when you prefer deleting plugins using CLI instead of the admin panel?

edvinasjurele commented 3 months ago

Hi @eunjae-lee, it might not be strong argument for it, but we have been establishing the review flow of contributors pushing reviewable plugin version from MR via CI.

F.e. plugin is my-plugin and with a manual CI job contributor can push the plugin with name prefix of -REVIEW-{MR_ID}:

my-plugin-REVIEW-20

NOTE: We cannot use the original my-plugin as it first, meant for production, and second, there are only 2 states - draft and publish - per plugin instance, which is not scalable to work with multiple contributors at the same time, while risking accidentally publishing it for our content editors.

Also Organisation field-types can only be accessed by ADMINs, hence only admins can configure assigned spaces and delete plugins. We would like to finish review flow cycle to establish manual CI job for not only publishing a version, but also removing old plugin and leftovers.

edvinasjurele commented 3 months ago

More on the same note, we ended up in self-hosting the plugin /dist to our servers to enable us in testing plugins via sandbox https://plugin-sandbox.storyblok.com/field-plugin?url={URL}, but pushing plugin from MR branch is also an option, thus may be used not that frequently. Bugfixes or features can be checked in sandbox, but drastical reworks may need to be doublechecked in the wild :).

eunjae-lee commented 3 months ago

Thanks for sharing. What an interesting way to create a temporary plugin for testing. Then I understand why you'd want to delete leftovers. While we don't have that feature yet on the CLI, you could send a request to our Management API to achieve the same thing in the meantime.