Repository navigation
Conversation
…piled integration_dispatch_test.go stopped compiling: it used publicmanifest.Manifest and EventDispatcher.OnInstallationsChanged, which no longer exist. It also built fake-router, fake-consumer, fake-publisher and fake-target plugins from a private local SDK checkout that the published SDK does not ship, and the integration build tag kept it out of every CI run. Remove it. Capability-scoped subscriptions, which its first test covered, no longer exist in the SDK or the host. Targeted publishing, which its second test covered, is tested by TestRuntimeHostServer_PublishEventTo_AutoPrefixesAndTargets and TestDispatcherTargetedEventReachesOnlyTarget. Add TestDispatcherDeliversHubEventToPluginProcess in its place. It sends a plugin event through the hub and the dispatcher to the HandleEvent of a real plugin process, built from testdata/fakeevents, and checks that the delivery is recorded as delivered. No other test crosses from the dispatcher into a plugin process. TestPluginPublishEvent_FlowsToHub built its example plugin from the same private path. Build hello-runtime-host by import path instead, from the SDK version go.mod requires, and drop the integration build tag so both tests run with the rest of the suite. Closes Silo-Server#2335
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Problem
Closes #2335
Related issue: N/A
Validation tasks: none
The
integration-tagged tests ininternal/pluginhostcould not run.integration_dispatch_test.godid not compile after the plugin SDK droppedpublicmanifest.Manifestand the dispatcher droppedOnInstallationsChanged. It also built four fake plugins from a local SDK checkout path that the published SDK does not ship. The other tagged test,integration_test.go, built its example plugin from the same path. CI never builds theintegrationtag, so none of this was caught. As a result, no test ran an event from the dispatcher into a real plugin process.Approach
integration_dispatch_test.go. Its first test covered capability-scoped subscriptions (subscriptions_by_capability), which no longer exist in the SDK or the host. Its second test covered targeted publishing, which the unit tests ininternal/pluginsandinternal/pluginhostalready cover, one on each side of the hub.EventDispatcherto theHandleEventof a real plugin process. It uses the existingtestdata/fakeeventsfixture, which nothing used before and which now has a manifest. The test checks that the outbox row is deleted as delivered, not retried. It runs after fix(plugins): deliver each plugin event once across API servers, with retries #2334's outbox changes, as the issue asks.integration_test.gonow buildshello-runtime-hostby import path, so the plugin comes from the SDK version ingo.mod. With no outside checkout needed, theintegrationbuild tag is dropped and both tests run in the normal suite and in CI.Validation
internal/pluginhostandinternal/pluginstests pass in a Linux container.HandleEventreturns an error, so it detects a failed delivery.gofmt,go vet,make lint-changed,make test-go, the web lint, format, build, budget and test steps, and every generated-contract, fixture and docs check, with actionlint 1.7.12 and ShellCheck 0.11.0./code-reviewat high effort over the branch diff. Results are under AI Disclosure.Evidence
Evidence: none, no user-visible change
Risks
hello-runtime-hostis built with silo-server'sgo.sum. If a later SDK release gives that example a dependency silo-server does not have, its test fails to build untilgo.modandgo.sumgain that dependency.Checklist
AI Disclosure
/code-reviewat high effort (same model) over the branch diff. It found three issues: theintegrationtag would let the tests break again without CI noticing, deleting the old file left no test that crossed from the dispatcher into a plugin process, and building the example by import path depends on silo-server'sgo.sum. The first two are fixed on this branch. The third is accepted and listed under Risks.Note
Replace broken pluginhost dispatch integration tests with in-tree fake-events test
TestDispatcherDeliversHubEventToPluginProcess, an end-to-end test that builds the repository-local fakeevents plugin, starts it, publishes a subscription event, and asserts delivery ID 1 is deleted as delivered (no retry)memoryOutboxfakes in event_dispatch_test.go replace the deleted SDK-example-based infrastructure/opt/worktreesdirectoryTestCapabilityScopedDispatchEndToEnd,TestTargetedPublishReachesOnlyNamedPlugin) are no longer coveredMacroscope summarized fb93cc1.