Skip to content

feat(F18): plugin-to-core connector bridge - #76

Merged
lekhrocks merged 2 commits into
mainfrom
feat/f18-plugin-bridge
Sep 6, 2026
Merged

lekhrocks merged 2 commits into
mainfrom
feat/f18-plugin-bridge

Conversation

@lekhrocks

Copy link
Copy Markdown
Owner

Summary

Implements the missing integration layer between the plugin system and the core connector SPI. Installed plugins are now usable by pipelines, snapshots, CDC, and metadata discovery end to end.

What This Adds

Adapter Layer (10 new files)

File Purpose
PluginConnectorAdapter Superset adapter implementing Connector, MetadataCapableConnector, SnapshotCapableConnector, CdcCapableConnector
PluginContextAdapter ConnectorContext (nested) -> PluginContext (flat)
PluginCapabilitiesAdapter 6-plugin-booleans -> 5-core-booleans
PluginHealthAdapter "UP"/"DOWN" string -> ConnectorHealth record
PluginCdcEventAdapter Flat plugin CdcEvent -> deeply nested core CDCEvent
PluginCursorCodec batchNumber <-> "b:n" cursor string
PluginWriterAdapter DestinationWriterProvider -> DestinationWriter
ConnectorTypeResolver Free-form plugin connectorType string -> ConnectorType enum

Registry Integration (2 new files)

File Purpose
DelegatingConnectorRegistry @primary registry composing built-in + plugin registries
PluginConnectorRegistry PluginId-keyed plugin connector store

Changes to Existing Code

  • ConnectorType: added GENERIC_PLUGIN enum value
  • DestinationWriterProvider: added default delete() and upsert() methods (backward-compatible)
  • PluginManager: enable/disable/uninstall now register/unregister adapters in the connector registry

Tests (28 new unit tests)

  • Adapter type resolution (known types, unknown -> GENERIC_PLUGIN)
  • Capabilities translation (6 -> 5 booleans, all combinations)
  • Health parsing (UP/DOWN/DEGRADED/UNKNOWN/garbage/null)
  • Cursor round-trip (null -> batch 0, cursor -> batch N)
  • CDC event synthesis (all core fields populated with sensible defaults)
  • CDC operation normalization (INSERT/UPDATE/DELETE/READ)
  • Plugin registry delegation (register/unregister by type and pluginId)
  • Plugin built-in shadowing (plugin advertising "postgresql" shadows built-in)

Documented Limitations

  • rangeChunks returns single whole-table chunk (no PK splitting) -- plugin SPI has no range API
  • Metadata: PK/FK/index/constraint discovery return empty/zero -- plugin SPI lacks these methods
  • CDC transaction metadata is always null
  • Pause/resume CDC are no-op flags on the plugin side
  • Parallel snapshot parallelism=1 for plugin-backed sources (sequential per plugin)

Implement the missing integration layer between the plugin system and
the core connector SPI so installed plugins are usable by pipelines,
snapshots, CDC, and metadata discovery.

New classes:
- PluginConnectorAdapter: superset adapter implementing all core SPI
  sub-interfaces (Connector, MetadataCapableConnector,
  SnapshotCapableConnector, CdcCapableConnector, DestinationWriter)
- PluginContextAdapter, PluginCapabilitiesAdapter, PluginHealthAdapter,
  PluginCdcEventAdapter, PluginCursorCodec, PluginWriterAdapter:
  helper adapters for type conversion
- ConnectorTypeResolver: maps free-form plugin connectorType string
  to ConnectorType enum
- DelegatingConnectorRegistry: @primary connector registry composing
  SpringConnectorRegistry and PluginConnectorRegistry
- PluginConnectorRegistry: pluginId-keyed plugin connector store

Changes to existing code:
- ConnectorType.GENERIC_PLUGIN enum value added
- DestinationWriterProvider: added default delete() and upsert() methods
  (backward-compatible, existing plugins compile unchanged)
- PluginManager: enable/disable/uninstall now register/unregister
  adapters in the connector registry

Documented limitations:
- rangeChunks returns single whole-table chunk (no PK splitting)
- Metadata: PK/fk/index/constraint discovery return empty/zero
- CDC transaction metadata is always null
- Pause/resume CDC are no-op flags on plugin side
- Parallel snapshot parallelism=1 for plugin-backed sources

Tests: 28 new unit tests covering adapters, registry delegation,
cursor round-trip, CDC event synthesis, capabilities mapping,
health parsing, and operation normalization.
…ce, validation

- DelegatingConnectorRegistry.unregisterPlugin(): disconnect before
  unregister (was: remove from map first, disconnect never fired)
- readBatch cursor check: strict 'b:' prefix (was: single-char 'b',
  matched any plugin cursor starting with 'b')
- isCdcActive(): check adapter flag first so pauseCDC makes it return
  false consistently with captureStatus()
- startCDC(): set cdcActive=true before startCapture() to close the
  race window where concurrent stopCDC() skips stopCapture()
- validate(): call delegate.health() and check status instead of
  always returning ok() (connect() was a no-op)
@lekhrocks
lekhrocks merged commit 1f752b0 into main Sep 6, 2026
19 checks passed
@lekhrocks
lekhrocks deleted the feat/f18-plugin-bridge branch September 6, 2026 09:38
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