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

Update plugin in the list and backup plugins config when using plugin install #349

Merged
merged 7 commits into from
Oct 20, 2023

Conversation

mostafa
Copy link
Member

@mostafa mostafa commented Oct 19, 2023

Ticket(s)

Description

In this PR, I've introduced some new features:

  1. I've added an option to enable interactive prompt when updating the plugin or backing up the plugins config file before the update. To activate the interactive prompt, you can use the --no-prompt=false flag.
  2. When using the plugin install command, users can now choose whether they want to create a backup of the current plugins config file (if it exists) before proceeding with the installation. This can be achieved by using the --backup=true flag.
  3. The updated plugin install command will replace the plugin configuration of the newly installed plugin with any existing configuration for a plugin in the plugins list that shares the same name. You can enable this behavior using the --update=true flag.

Warning
Important Change in plugin install Command
Starting with this update, there is a breaking change in the plugin install command. By default, the interactive prompt is now disabled (--no-prompt=true) when installing a new plugin. If an existing plugin with the same name is detected during installation, the process will be aborted, and any downloaded files will be automatically deleted.

To override this default behavior and have more control:

  1. Enable the interactive prompt to be notified of the changes and have the option to approve or deny them.
  2. Pass the appropriate flags to enable the update and backup features.

These changes are aimed at enhancing your control over the installation process and minimizing any unexpected actions when dealing with plugins. Please adjust your installation process accordingly to accommodate these modifications.

Related PRs

Development Checklist

  • I have added a descriptive title to this PR.
  • I have squashed related commits together.
  • I have rebased my branch on top of the latest main branch.
  • I have performed a self-review of my own code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added docstring(s) and type annotations to my code.
  • I have made corresponding changes to the documentation (docs).
  • I have added tests for my changes.

Legal Checklist

Ask user if they want to update the plugin config or not
Update existing plugin config, rather than appending to the plugin list
@mostafa mostafa force-pushed the check-for-existing-plugin-before-installing branch from ad63378 to d1b17ec Compare October 19, 2023 22:22
@mostafa mostafa merged commit 9c0cbcd into main Oct 20, 2023
@mostafa mostafa deleted the check-for-existing-plugin-before-installing branch October 20, 2023 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check if the plugin is already installed before adding it to gatewayd_plugins.yaml
1 participant