Skip to content

ChipIngress: Introduce per-event idempotency keys#2199

Merged
patrickhuie19 merged 4 commits into
mainfrom
CRE-4733/chip-idemp-key
Jun 26, 2026
Merged

ChipIngress: Introduce per-event idempotency keys#2199
patrickhuie19 merged 4 commits into
mainfrom
CRE-4733/chip-idemp-key

Conversation

@tarcisiozf

@tarcisiozf tarcisiozf commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This pull request adds support for an idempotency key as a CloudEvent extension attribute in the NewEvent function, allowing downstream consumers to deduplicate events.

Idempotency Key Support:

  • Added the constant IdempotencyKeyAttr in types.go to define the CloudEvent extension attribute name for idempotency keys, with documentation explaining its usage and behavior in ChIP Ingress and Kafka headers.
  • Updated NewEvent in client.go to set the idempotency key as a CloudEvent extension if provided and non-empty in the attributes map.

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

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

✅ Compatible Changes (1)

./ (1)
  • IdempotencyKeyAttr — ➕ Added

📄 View full apidiff report

@tarcisiozf tarcisiozf marked this pull request as ready for review June 25, 2026 16:28
@tarcisiozf tarcisiozf requested a review from a team as a code owner June 25, 2026 16:28
Copilot AI review requested due to automatic review settings June 25, 2026 16:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a per-event idempotency key as a CloudEvent extension attribute emitted by NewEvent, enabling downstream consumers (e.g., via Kafka header mappings) to deduplicate events.

Changes:

  • Introduced IdempotencyKeyAttr constant defining the extension attribute name.
  • Updated NewEvent to set idempotencykey as a CloudEvent extension when present and non-empty.
  • Added unit tests validating extension presence/absence behavior for the idempotency key.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
pkg/chipingress/types.go Adds the exported IdempotencyKeyAttr constant and associated documentation.
pkg/chipingress/client.go Sets the idempotency key extension on newly created CloudEvents when provided.
pkg/chipingress/client_test.go Adds coverage ensuring the idempotency key extension is set only when non-empty.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/chipingress/types.go Outdated
pkcll
pkcll previously approved these changes Jun 25, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@patrickhuie19 patrickhuie19 added this pull request to the merge queue Jun 26, 2026
Merged via the queue into main with commit 052e55e Jun 26, 2026
33 checks passed
@patrickhuie19 patrickhuie19 deleted the CRE-4733/chip-idemp-key branch June 26, 2026 15:29
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.

4 participants