Files
kandev/docs/plans/plugins/task-14-e2e.md
T
Kandev Agent c53f699714 feat: add plugin system with grpc runtime and native ui plugins
- go plugin backends ship as release tarballs (per-platform binaries, checksums) that
  kandev installs from url/upload or filesystem sideload+sync, then spawns and
  supervises via hashicorp/go-plugin (unix socket / loopback tcp+automtls)
- strict typed grpc contract (kandev.plugin.v1): DeliverEvent/InvokeTool/HandleWebhook
  plus a capability-gated host service (state, secrets, emit); author sdk in
  pkg/pluginsdk; packaging cli in cmd/plugin-pack
- native frontend bundles: window.registerKandevPlugin + registry/host loader with
  dynamic routes, nav items, slots and ws handlers; plugins settings page with
  install dialog, sync button and enable/disable/uninstall
- gated behind the plugins feature flag (prod off, dev/e2e on); covered by unit and
  integration tests plus playwright e2e against a real packaged fixture plugin

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 17:55:45 +01:00

2.3 KiB

id, title, status, wave, depends_on, plan
id title status wave depends_on plan
task-14 Playwright e2e for the plugin system pending 4
task-09
task-12
task-13
task-04
docs/plans/plugins/plan.md

Playwright e2e for the plugin system

Title

End-to-end browser test: start the fixture plugin, register it, see it active in the Plugins settings UI, exercise enable/disable, render its iframe page, and verify event delivery on task creation.

Inputs

  • Read apps/web/e2e/README.md and apps/web/e2e/fixtures/backend.ts (how the backend is booted for e2e; env scrubbing — see the KANDEV_* env leak guidance).
  • Fixture plugin binary from task-04 (apps/backend/cmd/plugin-fixture, prints LISTENING <addr>, -secret flag, /_debug/deliveries).
  • Feature flag: e2e profile sets KANDEV_FEATURES_PLUGINS=true (task-10). Confirm the e2e backend fixture picks it up.
  • Plugin registration/secret flow (clean, no pre-shared secret): (1) start the fixture (health needs no secret); (2) POST /api/plugins/register with a manifest whose base_url is the fixture's printed addr → kandev returns the generated webhook_secret and marks the plugin active after health; (3) POST {fixture}/_config with {"secret": <returned webhook_secret>} so the fixture verifies future deliveries with kandev's secret; (4) trigger events and assert. task-04 exposes /_config for exactly this.

Acceptance

  1. apps/web/e2e/plugins.spec.ts (in the default project unless it needs Docker):
    • boots fixture plugin, registers it, reloads Plugins settings page → plugin row shows status active.
    • disable → badge disabled; enable → back to active.
    • open detail → iframe present; assert the fixture page's #plugin-dashboard heading is visible inside the frame.
    • create a task (via UI or API) → poll fixture /_debug/deliveries until it contains task.created (event delivery works end-to-end).
  2. Test cleans up: uninstall plugin, stop fixture process.

Files

  • apps/web/e2e/plugins.spec.ts
  • apps/web/e2e/helpers/plugin-fixture.ts (spawn/stop helper capturing LISTENING)

Verification

  • cd apps/web && pnpm e2e -g "plugin"

Output contract

Report: which project the spec runs in, and any flake mitigations (polling/timeouts).

Dependencies

task-09, task-12, task-13, task-04.