Fix external plugin trigger callbacks#593
Merged
Merged
Conversation
External trigger providers need a dedicated CreateTrigger path and host callback broker setup so Workflow plugins can provide native trigger types without overloading module creation.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the external plugin gRPC surface to properly support external trigger instances and host callback wiring, so external plugins can create triggers during Configure() (after YAML config is known) and reliably call back into the host engine.
Changes:
- Added
ConfigureCallbackandCreateTriggerRPCs to the external plugin protocol and implemented them in the plugin-side gRPC server. - Updated host-side external plugin loading to provision a callback broker/server and to disable trigger factories when callback setup is unavailable (to preserve module/step compatibility).
- Refactored
RemoteTriggerso trigger handles are created duringConfigure()(ensuring YAML trigger config reaches the plugin) and added focused tests for the new lifecycle.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| plugin/external/sdk/grpc_server.go | Implements ConfigureCallback and CreateTrigger on the plugin server; adds callback connection tracking. |
| plugin/external/sdk/grpc_server_test.go | Adds trigger-provider lifecycle and routing tests for the new RPCs. |
| plugin/external/remote_trigger.go | Defers remote trigger creation to Configure(); adds handle guards for lifecycle methods. |
| plugin/external/remote_trigger_test.go | New tests validating trigger creation/config forwarding and error propagation. |
| plugin/external/remote_step_test.go | Extends stub client to satisfy new RPCs for tests. |
| plugin/external/proto/plugin.proto | Adds ConfigureCallback + CreateTrigger RPCs and request messages. |
| plugin/external/proto/plugin.pb.go | Regenerated protobuf types for new messages/RPCs. |
| plugin/external/proto/plugin_grpc.pb.go | Regenerated gRPC stubs for new methods. |
| plugin/external/manager.go | Allows injecting a host CallbackServer into external plugin clients. |
| plugin/external/manager_test.go | New test verifying callback server is retained by the manager. |
| plugin/external/adapter.go | Configures callback broker during adapter creation and disables trigger factories when callback setup fails/unavailable; defers trigger handle creation. |
| plugin/external/adapter_test.go | Adds coverage for callback setup and trigger factory deferral behavior. |
| cmd/server/main.go | Wires a callback server into the external plugin manager for server-loaded plugins. |
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
Contributor
Author
|
Addressed the latest review comments in
Local verification before push: go test ./plugin/external/... ./cmd/server
golangci-lint run --timeout=10m ./plugin/external/... ./cmd/server
git diff --check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
CreateTriggerandConfigureCallbackRPCsConfigureso YAML trigger config reaches pluginsVerification
go test ./cmd/server ./plugin/external/... ./plugin/...go test ./...Context
Needed by
workflow-computebeforetrigger.compute_completedcan become a native Workflow external plugin trigger instead of a polling/callback workaround.