Skip to content

Add provider plugin architecture#1

Merged
hidetzu merged 1 commit into
mainfrom
feature/provider-plugin-architecture
Apr 11, 2026
Merged

Add provider plugin architecture#1
hidetzu merged 1 commit into
mainfrom
feature/provider-plugin-architecture

Conversation

@hidetzu
Copy link
Copy Markdown
Owner

@hidetzu hidetzu commented Apr 11, 2026

Summary

  • Introduce plugin-based provider extensibility for multi-VCS support
  • GitHub remains built-in; external providers are discovered as prism-provider-<name> binaries on PATH
  • Add --provider flag for explicit provider selection (auto-detected from URL if omitted)
  • Define provider plugin protocol v1 with versioned JSON schema
  • Version bump to 0.2.0-alpha.1

Changes

New files

  • internal/provider/plugin/plugin.go — Plugin executor (subprocess + JSON parse + fileutil enrichment)
  • internal/provider/plugin/plugin_test.go — TestHelperProcess pattern tests
  • internal/provider/registry.go — Provider registry (built-in GitHub + PATH plugin discovery)
  • internal/provider/registry_test.go — Auto-detection and resolution tests
  • docs/provider-plugin-protocol.md — Plugin protocol specification (the contract)
  • docs/adr/0001-provider-plugin-architecture.md — Architecture decision record
  • docs/implementation/v0.2.0-provider-plugin.md — Implementation guide

Modified files

  • cmd/prism/main.go — Replace newProvider() with registry-based resolveProvider(), add --provider persistent flag
  • cmd/prism/integration_test.go — Update error assertions for auto-detection, add unknown provider test
  • cmd/prism/main_test.go — Add --provider flag test
  • internal/provider/github/github.go — Remove compile-time interface check (fixes import cycle)
  • README.md — Add Providers section with --provider usage and plugin docs
  • docs/spec.md — Add Global Flags section, fix PRISM_CONFIG env var name
  • docs/architecture.md — Add Registry/Plugin Executor to diagram and description

Design decisions (ADR-0001)

  • GitHub built-ingo install works out of the box
  • External providers as plugins — No AWS SDK or other heavy deps in prism core
  • Future: GitHub can also be extracted to plugin if needed

Test plan

  • All existing tests pass (no regressions)
  • Plugin executor: valid JSON, invalid JSON, wrong version, timeout, binary not found
  • Registry: GitHub auto-detect, unknown host error, missing plugin error
  • CLI: --provider flag exists, unknown provider error message
  • make test (race), make lint, make vet all pass

Introduce plugin-based provider extensibility for multi-VCS support.
GitHub remains built-in; external providers (e.g., CodeCommit) are
discovered as prism-provider-<name> binaries on PATH and invoked as
subprocesses returning JSON to stdout.

- Add --provider flag (persistent, available on all commands)
- Add URL-based provider auto-detection (github.com → GitHub)
- Add provider registry with built-in and plugin resolution
- Add plugin executor with protocol version validation
- Add plugin protocol specification (docs/provider-plugin-protocol.md)
- Add ADR-0001 documenting plugin architecture decision
- Update README, spec.md, architecture.md
- Version bump to 0.2.0-alpha.1
@hidetzu hidetzu merged commit b7dc89c into main Apr 11, 2026
2 checks passed
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.

1 participant