Allow plugins to report their own version and store it in the registry #12883
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This allows plugins to report their version (and potentially other metadata in the future). The version is shown in
plugin list
and inversion
.The metadata is stored in the registry file, and reflects whatever was retrieved on
plugin add
, not necessarily the running binary. This can help you to diagnose if there's some kind of mismatch with what you expect. We could potentially use this functionality to show a warning or error if a plugin being run does not have the same version as what was in the cache file, suggestingplugin add
be run again, but I haven't done that at this point.It is optional, and it requires the plugin author to make some code changes if they want to provide it, since I can't automatically determine the version of the calling crate or anything tricky like that to do it.
Example:
cc @maxim-uvarov (he asked for it)
User-Facing Changes
plugin list
gets aversion
columnversion
shows plugin versions when availablefn metadata()
to theirimpl Plugin
, but don't have toTests + Formatting
Tested the low level stuff and also the
plugin list
column.After Submitting
Metadata
call & response)fn metadata()
should be easy)