diff --git a/plugin/deps.go b/plugin/deps.go index 7d190b7..594374f 100644 --- a/plugin/deps.go +++ b/plugin/deps.go @@ -50,6 +50,7 @@ type ServiceDeps struct { CoreServiceBindings CoreServiceBindings ReviewSubmitter ReviewSubmitter BadgeRefresher BadgeRefresher + SettingsUpdater settings.Updater // Extension points — typed as narrow interfaces where possible JobRunner JobRunner diff --git a/settings/settings.go b/settings/settings.go index f97e4ca..0f5393f 100644 --- a/settings/settings.go +++ b/settings/settings.go @@ -8,6 +8,11 @@ type Settings interface { GetPluginSettings(ctx context.Context, pluginName string) (map[string]any, error) } +// Updater allows plugins to modify site settings. +type Updater interface { + UpdateSiteSetting(ctx context.Context, key string, value any) error +} + // GetStringOr returns a string value from a map, or defaultVal if not found/wrong type. func GetStringOr(m map[string]any, key, defaultVal string) string { if v, ok := m[key].(string); ok {