Skip to content

Add plugins/all package to simplify built-in plugin registration for embedded engines#198

Merged
intel352 merged 2 commits intomainfrom
copilot/simplify-plugin-loading
Feb 27, 2026
Merged

Add plugins/all package to simplify built-in plugin registration for embedded engines#198
intel352 merged 2 commits intomainfrom
copilot/simplify-plugin-loading

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

Embedding the workflow engine required importing and wiring 25+ plugin packages individually. This adds a plugins/all package as a single entry point for all built-in plugins.

New: plugins/all

  • DefaultPlugins() []plugin.EnginePlugin — returns a fresh slice of all standard plugins; safe to modify before loading (add, remove, reorder)
  • LoadAll(engine PluginLoader) error — loads all default plugins in one call; PluginLoader is a minimal interface satisfied by *workflow.StdEngine
engine := workflow.NewStdEngine(app, logger)
if err := allplugins.LoadAll(engine); err != nil {
    log.Fatalf("failed to load plugins: %v", err)
}

// Or customize the set:
plugins := allplugins.DefaultPlugins()
plugins = append(plugins, myCustomPlugin)
for _, p := range plugins {
    engine.LoadPlugin(p)
}

Updated callers

  • cmd/server/main.godefaultEnginePlugins() now delegates to allplugins.DefaultPlugins(), replacing 25 individual plugin imports
  • example/main.go — migrated from the legacy handlers.New*WorkflowHandler() pattern to allplugins.LoadAll(engine)

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copilot AI changed the title [WIP] Add automatic plugin loading for embedded workflow engine Add plugins/all package to simplify built-in plugin registration for embedded engines Feb 27, 2026
@intel352 intel352 marked this pull request as ready for review February 27, 2026 12:53
Copilot AI review requested due to automatic review settings February 27, 2026 12:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a plugins/all package that provides a single entry point for registering all 25 built-in workflow engine plugins, eliminating the need to manually import and wire each plugin package individually. This significantly simplifies the setup for applications embedding the workflow engine.

Changes:

  • Added plugins/all package with DefaultPlugins() and LoadAll() functions
  • Updated cmd/server/main.go to use allplugins.DefaultPlugins() instead of manually listing 25 plugin imports
  • Migrated example/main.go from individual handler registration to allplugins.LoadAll(engine) pattern

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
plugins/all/all.go New package providing DefaultPlugins() and LoadAll() convenience functions for plugin registration
plugins/all/all_test.go Comprehensive test suite covering plugin uniqueness, independence, loading, and error handling
cmd/server/main.go Replaced 25 individual plugin imports with single allplugins.DefaultPlugins() call
example/main.go Migrated from legacy handler registration to plugin-based loading via allplugins.LoadAll()
example/go.mod Added transitive dependencies required by newly-loaded plugins (cache, reverseproxy, scheduler, gobwas/glob, robfig/cron, go-chi/chi)
example/go.sum Updated checksums for new transitive dependencies

@intel352 intel352 merged commit 23b44b1 into main Feb 27, 2026
18 checks passed
@intel352 intel352 deleted the copilot/simplify-plugin-loading branch February 27, 2026 13:05
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.

3 participants