feat(beholder): backward-compat type shims for durable event store [SHARED-2644]#2095
feat(beholder): backward-compat type shims for durable event store [SHARED-2644]#2095dvashchuk wants to merge 4 commits into
Conversation
Standalone type declarations (not aliases) in pkg/beholder that mirror the canonical types in pkg/durableemitter. This avoids breaking existing consumers that import from pkg/beholder while the migration to pkg/durableemitter completes. Uses standalone types instead of aliases to avoid an import cycle: durableemitter tests → servicetest → utils/tests → beholdertest → beholder. Tracked for removal in chainlink PR #22562.
|
👋 dvashchuk, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
✅ API Diff Results -
|
There was a problem hiding this comment.
Pull request overview
Adds backward-compatible durable event store type declarations under pkg/beholder so downstream consumers can continue compiling during migration to pkg/durableemitter.
Changes:
- Introduces
DurableEvent, queue stats/observer, batch inserter, andDurableEventStoredeclarations inpkg/beholder. - Documents the temporary nature of these duplicate declarations and their planned removal.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Backward-compatibility types for downstream consumers (e.g. chainlink node). | ||
| // These were moved to pkg/durableemitter in PR #2081. They are re-declared here | ||
| // (not aliases) to avoid an import cycle through test utilities. | ||
| // | ||
| // TODO(SHARED-2644): Remove this file once chainlink node migrates imports to | ||
| // pkg/durableemitter (tracked in chainlink PR #22562). These duplicate declarations | ||
| // have no compile-time sync check against the canonical types. |
There was a problem hiding this comment.
Good catch. DurableEventStoreConfig does not exist in pkg/durableemitter — the PR description was wrong. Updated the description to list the actual types: DurableEvent, DurableQueueStats, DurableQueueObserver, BatchInserter, DurableEventStore.
|
Addressed Copilot finding: DurableEventStoreConfig does not exist in pkg/durableemitter (never did). Updated PR description to list the actual 5 types provided: DurableEvent, DurableQueueStats, DurableQueueObserver, BatchInserter, DurableEventStore. |
The backward-compatibility type declarations in pkg/beholder/durable_event_store.go intentionally duplicate types from pkg/durableemitter/ to avoid an import cycle. Exclude this file from CPD (Copy-Paste Detection) so the Quality Gate passes.
|
Hey @elatoskinas - CI is now fully green (including SonarQube). Ready for review. |
Motivation
Split from #2086 per reviewer request. Provides backward-compatible type declarations in pkg/beholder so existing consumers are not broken while the migration to pkg/durableemitter completes.
What
Standalone type declarations (not aliases) that mirror the canonical types in pkg/durableemitter:
Uses standalone types instead of aliases to avoid an import cycle:
durableemitter tests, servicetest, utils/tests, beholdertest, beholder.
Tracked for removal in chainlink PR #22562.
Related