[RFE] headlamp-plugin "upgrade" command for upgrading plugins
See original GitHub issueCurrent situation
There are a number of things that need updating in existing plugin package.json scripts, and there could be in the future.
Typically new headlamp plugin versions required plugin authors to do things like:
- upgrading the headlamp-plugin dependency version
- adding extra config inside package.json (like the new eslint/prettier config)
- adding extra required config files (like a previous version did with a tsconfig file)
Impact
As we upgrade headlamp plugins, make it easier for authors to upgrade their plugins so they are compatible.
Ideal future situation
Plugin authors know how to migrate to new versions of the plugin configuration (and code).
Implementation options
headlamp-plugin migrate
would see the version in the package.json and try to run a migration script for each version. Similar to db migration scripts.- mention migration requirements in the release notes
- add a plugin migration documentation page (to also link to from release notes) mentioning how to upgrade every version.
The headlamp-plugin/template folder git history shows changes to recent versions of the plugin.
By keeping most changes inside headlamp-plugins and keeping the API backwards compatible, the need for this is reduced. However that can’t work for every change.
This is related to the “Create a compatibility validation for plugins” issue. It could be that headlamp-plugin could check for new releases of headlamp-plugin and print a warning that the plugin is outdated, and link to instructions on how to do migration.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
@illume , thanks for raising this issue. The 0.4.0 version of headlamp-plugin we published is still compatible with the previous versions. However, plugins created with this new version will have files like the ts/jsconfig ones which should be used but are not available unless one is creating a new plugin. So, this makes me think that instead of a
headlamp-plugin migrate
command, maybe we should just haveheadlamp-plugin update
(and/or upgrade) command, which updates the headlamp-plugin version listed in the plugin’s package.json and performs any migration (including things not purely considered migration, like adding the mentioned config files).About the docs, I think having a migration or update section with the changes needed to be done by plugin authors to stay up to date is a good idea as you suggested.
npm start
should probably print a warning if the version of headlamp-plugin is not up to date.