Skip to content

feat(beholder): backward-compat type shims for durable event store [SHARED-2644]#2095

Open
dvashchuk wants to merge 4 commits into
mainfrom
fix/beholder-backward-compat
Open

feat(beholder): backward-compat type shims for durable event store [SHARED-2644]#2095
dvashchuk wants to merge 4 commits into
mainfrom
fix/beholder-backward-compat

Conversation

@dvashchuk
Copy link
Copy Markdown

@dvashchuk dvashchuk commented May 27, 2026

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:

  • DurableEvent
  • DurableQueueStats
  • DurableQueueObserver
  • BatchInserter
  • DurableEventStore

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

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 dvashchuk requested a review from a team as a code owner May 27, 2026 15:54
Copilot AI review requested due to automatic review settings May 27, 2026 15:54
@github-actions
Copy link
Copy Markdown

👋 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!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

✅ API Diff Results - github.com/smartcontractkit/chainlink-common

✅ Compatible Changes (5)

pkg/beholder (5)
  • BatchInserter — ➕ Added

  • DurableEvent — ➕ Added

  • DurableEventStore — ➕ Added

  • DurableQueueObserver — ➕ Added

  • DurableQueueStats — ➕ Added


📄 View full apidiff report

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and DurableEventStore declarations in pkg/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.

Comment on lines +8 to +14
// 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.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dvashchuk
Copy link
Copy Markdown
Author

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.
@dvashchuk dvashchuk requested a review from a team as a code owner May 28, 2026 03:25
@dvashchuk
Copy link
Copy Markdown
Author

Hey @elatoskinas - CI is now fully green (including SonarQube). Ready for review.

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.

2 participants