Skip to content

test(pluginhost): replace the plugin dispatch test that no longer compiled - #2583

Closed
bulderi wants to merge 1 commit into
Silo-Server:mainfrom
bulderi:fix/pluginhost-integration-dispatch-test
Closed

bulderi wants to merge 1 commit into
Silo-Server:mainfrom
bulderi:fix/pluginhost-integration-dispatch-test

Conversation

@bulderi

@bulderi bulderi commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #2335
Related issue: N/A
Validation tasks: none

The integration-tagged tests in internal/pluginhost could not run. integration_dispatch_test.go did not compile after the plugin SDK dropped publicmanifest.Manifest and the dispatcher dropped OnInstallationsChanged. 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 the integration tag, so none of this was caught. As a result, no test ran an event from the dispatcher into a real plugin process.

Approach

  • Remove 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 in internal/plugins and internal/pluginhost already cover, one on each side of the hub.
  • Add a test in its place that sends a plugin event through the hub and the EventDispatcher to the HandleEvent of a real plugin process. It uses the existing testdata/fakeevents fixture, 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.go now builds hello-runtime-host by import path, so the plugin comes from the SDK version in go.mod. With no outside checkout needed, the integration build tag is dropped and both tests run in the normal suite and in CI.

Validation

  • Focused internal/pluginhost and internal/plugins tests pass in a Linux container.
  • The new test fails when the fixture's HandleEvent returns an error, so it detects a failed delivery.
  • Full gate from CONTRIBUTING.md passes in Linux containers: Go build, 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.
  • DB-backed tests were not run separately, because the change touches no database code.
  • /code-review at high effort over the branch diff. Results are under AI Disclosure.

Evidence

Evidence: none, no user-visible change

Risks

  • The normal Go test run now builds two small plugin binaries, one of them from the SDK module. Each run adds a few seconds.
  • hello-runtime-host is built with silo-server's go.sum. If a later SDK release gives that example a dependency silo-server does not have, its test fails to build until go.mod and go.sum gain that dependency.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code in the Claude desktop app
  • Tool(s): Claude Code
  • Model(s): claude-opus-5-5
  • Involvement: AI-assisted
  • Adversarial review: /code-review at high effort (same model) over the branch diff. It found three issues: the integration tag 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's go.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

  • Adds 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)
  • New test store, resolver, and memoryOutbox fakes in event_dispatch_test.go replace the deleted SDK-example-based infrastructure
  • Removes integration_dispatch_test.go and its two integration-tagged dispatch tests that depended on an external SDK worktree and no longer compiled
  • Removes the integration build constraint from integration_test.go and builds the hello-runtime-host example by SDK package import path instead of a fixed /opt/worktrees directory
  • Behavioral Change: capability-scoped and targeted-publish dispatch scenarios (TestCapabilityScopedDispatchEndToEnd, TestTargetedPublishReachesOnlyNamedPlugin) are no longer covered

Macroscope summarized fb93cc1.

…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-triage silo-triage Bot added the size/XL 500–999 added + deleted lines (all files); change volume, not priority. label Oct 16, 2026
@silo-kody

silo-kody Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@silo-triage silo-triage Bot added bug Something isn't working go Pull requests that update go code priority: P2 Limited scope, workaround exists, or polish labels Oct 16, 2026
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6a8b98b6-40cb-4974-88fe-6dccd77efea0
📥 Commits

Reviewing files that changed from the base of the PR and between c78d233 and fb93cc1.

📒 Files selected for processing: 4
  • internal/pluginhost/event_dispatch_test.go
  • internal/pluginhost/integration_dispatch_test.go
  • internal/pluginhost/integration_test.go
  • internal/pluginhost/testdata/fakeevents/manifest.json
💤 Files with no reviewable changes: 1
  • internal/pluginhost/integration_dispatch_test.go

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The plugin host tests now include an outbox-backed integration test that builds and runs a fake event consumer and checks delivery of a hub event. The old integration dispatch tests were removed. The remaining example-plugin test builds from the SDK module package without a hard-coded worktree path.

Changes: Plugin host integration tests

Layer / File(s) Summary
Fake plugin event dispatch test
internal/pluginhost/event_dispatch_test.go, internal/pluginhost/testdata/fakeevents/manifest.json, internal/pluginhost/integration_dispatch_test.go
A fake event-consumer manifest and in-memory test dependencies support a test that publishes a hub event and checks for a delivered 1 outcome. The previous integration dispatch tests were removed.
Example plugin test build setup
internal/pluginhost/integration_test.go
The integration build constraint was removed. The example plugin test now builds the SDK example package without a hard-coded worktree directory.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to fb93c

This change replaces a stale plugin dispatch test with a working one and removes the build tag so the tests run in normal CI. It has no production impact and no remaining merge-blocking risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly describes the primary change: replacing a pluginhost dispatch test that no longer compiled.
Description check Passed The description directly explains the broken tests, the replacement end-to-end test, related integration changes, validation, and risks.
Linked Issues check Passed Issue #2335 requires the broken integration dispatch coverage to run or be removed when unit coverage replaces it. The PR removes the obsolete SDK-dependent test, adds `TestDispatcherDeliversHubEventT…
Out of Scope Changes check Passed The changed files support issue #2335. The new fake-events manifest and in-memory test fakes support the replacement dispatch test. Removing the obsolete integration_dispatch_test.go and its build t…
Full details: Linked Issues check

Explanation

Issue #2335 requires the broken integration dispatch coverage to run or be removed when unit coverage replaces it. The PR removes the obsolete SDK-dependent test, adds TestDispatcherDeliversHubEventToPluginProcess, and sends an event through the hub, dispatcher, and a real plugin process. The test asserts delivered 1, not a retry. The test has no integration build tag. integration_test.go also builds the SDK example by import path.

Full details: Out of Scope Changes check

Explanation

The changed files support issue #2335. The new fake-events manifest and in-memory test fakes support the replacement dispatch test. Removing the obsolete integration_dispatch_test.go and its build tag removes broken or obsolete coverage. The PR description states that targeted publishing remains covered by unit tests and that capability-scoped subscriptions no longer exist. No unrelated product behavior is changed.

Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Quick104

Copy link
Copy Markdown
Contributor

Closing: #2817 deleted integration_dispatch_test.go and integration_test.go on main, which resolves #2335.

@Quick104 Quick104 closed this Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working go Pull requests that update go code priority: P2 Limited scope, workaround exists, or polish size/XL 500–999 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] The integration-tagged plugin dispatch test does not compile

2 participants