Plugins: Add module hash field to plugin model (#116119)

* add module hash field to plugin model

* fix tests

* fix lint issues
This commit is contained in:
Will Browne
2026-01-13 14:35:45 +00:00
committed by GitHub
parent 86652a6515
commit aa9b587cc1
43 changed files with 767 additions and 620 deletions
+3 -4
View File
@@ -13,10 +13,9 @@ const (
)
// PluginAssetsCalculator is an interface for calculating plugin asset information.
// LocalProvider requires this to calculate loading strategy and module hash.
// LocalProvider requires this to calculate loading strategy.
type PluginAssetsCalculator interface {
LoadingStrategy(ctx context.Context, p pluginstore.Plugin) plugins.LoadingStrategy
ModuleHash(ctx context.Context, p pluginstore.Plugin) string
}
// LocalProvider retrieves plugin metadata for locally installed plugins.
@@ -27,7 +26,7 @@ type LocalProvider struct {
}
// NewLocalProvider creates a new LocalProvider for locally installed plugins.
// pluginAssets is required for calculating loading strategy and module hash.
// pluginAssets is required for calculating loading strategy.
func NewLocalProvider(pluginStore pluginstore.Store, pluginAssets PluginAssetsCalculator) *LocalProvider {
return &LocalProvider{
store: pluginStore,
@@ -43,7 +42,7 @@ func (p *LocalProvider) GetMeta(ctx context.Context, pluginID, version string) (
}
loadingStrategy := p.pluginAssets.LoadingStrategy(ctx, plugin)
moduleHash := p.pluginAssets.ModuleHash(ctx, plugin)
moduleHash := plugin.ModuleHash
spec := pluginStorePluginToMeta(plugin, loadingStrategy, moduleHash)
return &Result{