Skip to content

WIP: plugins: add compile-time plugin system, migrate aws + ripeatlas#869

Open
brainexe wants to merge 1 commit into
masterfrom
plugin_fable
Open

WIP: plugins: add compile-time plugin system, migrate aws + ripeatlas#869
brainexe wants to merge 1 commit into
masterfrom
plugin_fable

Conversation

@brainexe

@brainexe brainexe commented Jul 3, 2026

Copy link
Copy Markdown
Member

Turn the bot into a framework with a proper plugin system built on the existing bot.RegisterPlugin registry (Caddy/xcaddy-style compile-time composition). Plugins register commands, read their own config, use storage, run async tasks and access the Slack client.

  • bot/config: add Config.LoadPlugin (reads "plugins: :" with a legacy top-level key fallback) and Config.IsPluginEnabled kill switch; promote the viper key delimiter to a const and fix Config.Set to use it; drop the dead Plugins []string field
  • bot/plugin.go: gate loadPlugins on IsPluginEnabled, warn on dup names
  • plugins are own Go modules so their deps stay out of the core module: the AWS SDK now lives only in plugins/aws, not in slack-bot itself
  • migrate command/clouds/aws -> plugins/aws and command/ripeatlas -> plugins/ripeatlas; add plugins/example reference plugin
  • cmd/bot + cmd/cli become own modules that blank-import the plugins; a go.work workspace ties everything together (make dep -> go work vendor)
  • Makefile/CI/gosec use the module-path pattern to span all modules, lint runs per module; examples build with GOWORK=off
  • docs/plugins.md authoring guide, config.example.yaml + readme updates

Turn the bot into a framework with a proper plugin system built on the
existing bot.RegisterPlugin registry (Caddy/xcaddy-style compile-time
composition). Plugins register commands, read their own config, use
storage, run async tasks and access the Slack client.

- bot/config: add Config.LoadPlugin (reads "plugins: <name>:" with a
  legacy top-level key fallback) and Config.IsPluginEnabled kill switch;
  promote the viper key delimiter to a const and fix Config.Set to use it;
  drop the dead Plugins []string field
- bot/plugin.go: gate loadPlugins on IsPluginEnabled, warn on dup names
- plugins are own Go modules so their deps stay out of the core module:
  the AWS SDK now lives only in plugins/aws, not in slack-bot itself
- migrate command/clouds/aws -> plugins/aws and command/ripeatlas ->
  plugins/ripeatlas; add plugins/example reference plugin
- cmd/bot + cmd/cli become own modules that blank-import the plugins;
  a go.work workspace ties everything together (make dep -> go work vendor)
- Makefile/CI/gosec use the module-path pattern to span all modules,
  lint runs per module; examples build with GOWORK=off
- docs/plugins.md authoring guide, config.example.yaml + readme updates
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.

1 participant