Skip to content

refactor(notification): move v4 provider contracts into provider package - #5401

Merged
chrisgacsal merged 1 commit into
mainfrom
feat/notification-v4-provider-package
Oct 29, 2026
Merged

chrisgacsal merged 1 commit into
mainfrom
feat/notification-v4-provider-package

Conversation

@chrisgacsal

@chrisgacsal chrisgacsal commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

Move Notification V4 provider contracts into v4/provider so provider operation types are separate from the core notification model. Rename v4/providers/{svix,noop} to v4/provider/{svix,noop} and update imports, tests, and documentation.

The package exposes Namespace, Registry, RegistryConfig, and NewRegistry. Move provider errors and WebhookProvider alongside the contracts. Replace the named ProviderData map with map[string]string to keep the dependency direction provider -> v4 without an import cycle.

Notes for reviewer

This is a package refactor with unchanged validation and runtime behavior. It contains no service/adapter implementation, schema changes, or migrations.

Validation passed:

  • go test -race -short ./openmeter/notification/v4/...
  • make lint-go GO_LINT_PATH=./openmeter/notification/v4/...
  • git diff --check

Live Svix integration tests were excluded by -short.

RetriggerView in GreptileConfidence Score: 5/5

This refactor appears safe to merge.

Summary

Moves notification V4 provider contracts into v4/provider, separate from the core notification model.

  • Notification V4 providers now live behind a separate provider package.

No actionable issues found. This review used source comparisons; tests were not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Svix["provider/svix"] --> Contracts["provider: contracts, errors, registry"]
  Noop["provider/noop"] --> Contracts
  Contracts --> Core["v4: events, delivery states, channel configuration"]
  Svix --> Core
  Noop --> Core
Loading

Reviews (1) · Last reviewed commit: "refactor(notification): move v4 provider..." · Reviewed by Greptile

Summary by CodeRabbit

  • New Features
    • Notification providers now have a dedicated interface and registry for configuring webhook delivery integrations.
    • Provider errors are classified by type, including retryable failures, configuration issues, rate limits, and unavailable services.
  • Bug Fixes
    • Svix errors are mapped to clearer failure categories, helping distinguish configuration problems from temporary delivery issues.
    • Notification delivery and retry operations continue to preserve results when interrupted by cancellation.

@chrisgacsal
chrisgacsal requested a review from a team as a code owner October 29, 2026 15:58
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 6397700 and e1c94be.

Files selected for processing: 31
  • openmeter/notification/v4/deliverystatus.go
  • openmeter/notification/v4/event.go
  • openmeter/notification/v4/provider/errors.go
  • openmeter/notification/v4/provider/noop/README.md
  • openmeter/notification/v4/provider/noop/webhook.go
  • openmeter/notification/v4/provider/noop/webhook_test.go
  • openmeter/notification/v4/provider/provider.go
  • openmeter/notification/v4/provider/provider_test.go
  • openmeter/notification/v4/provider/registry.go
  • openmeter/notification/v4/provider/registry_test.go
  • openmeter/notification/v4/provider/svix/README.md
  • openmeter/notification/v4/provider/svix/cancellation_test.go
  • openmeter/notification/v4/provider/svix/channel.go
  • openmeter/notification/v4/provider/svix/errors.go
  • openmeter/notification/v4/provider/svix/errors_test.go
  • openmeter/notification/v4/provider/svix/event.go
  • openmeter/notification/v4/provider/svix/event_cancellation_test.go
  • openmeter/notification/v4/provider/svix/event_test.go
  • openmeter/notification/v4/provider/svix/eventattempt.go
  • openmeter/notification/v4/provider/svix/eventmapping.go
  • openmeter/notification/v4/provider/svix/eventmapping_test.go
  • openmeter/notification/v4/provider/svix/namespace.go
  • openmeter/notification/v4/provider/svix/provider.go
  • openmeter/notification/v4/provider/svix/provider_test.go
  • openmeter/notification/v4/provider/svix/testutils/auth.go
  • openmeter/notification/v4/provider/svix/testutils/env.go
  • openmeter/notification/v4/provider/svix/testutils/webhook.go
  • openmeter/notification/v4/provider/svix/testutils/webhook_test.go
  • openmeter/notification/v4/provider/webhook.go
  • openmeter/notification/v4/providers/svix/errors.go
  • openmeter/notification/v4/webhook.go
Files with no reviewable changes: 2
  • openmeter/notification/v4/webhook.go
  • openmeter/notification/v4/providers/svix/errors.go

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

The provider contracts and registry move from the notification v4 root package into notification/v4/provider. Provider metadata fields now use map[string]string. The no-op and Svix implementations, their tests, and the Svix registry documentation use the relocated API.

Changes: Notification provider package

Layer / File(s) Summary
Provider contracts and registry
openmeter/notification/v4/provider/*, openmeter/notification/v4/event.go, openmeter/notification/v4/deliverystatus.go, openmeter/notification/v4/webhook.go, openmeter/notification/v4/provider/svix/README.md
The provider contracts and registry use the provider package. The API uses Namespace and v4 notification types, and provider metadata fields use map[string]string. Provider error types are defined in the provider package.
No-op and Svix provider adapters
openmeter/notification/v4/provider/noop/*, openmeter/notification/v4/provider/svix/namespace.go, openmeter/notification/v4/provider/svix/channel.go, openmeter/notification/v4/provider/svix/errors.go, openmeter/notification/v4/provider/svix/provider.go, openmeter/notification/v4/providers/svix/errors.go
The no-op and Svix providers use the provider-package interfaces and operation types. Svix error normalization classifies HTTP and transport errors; the previous implementation file is removed.
Svix event delivery and observation
openmeter/notification/v4/provider/svix/event.go, openmeter/notification/v4/provider/svix/eventattempt.go, openmeter/notification/v4/provider/svix/eventmapping.go, openmeter/notification/v4/provider/svix/*_test.go
Svix event send, resend, and retrieval paths use provider-package types. Event and delivery provider metadata use string maps. Existing delivery, cancellation, retry, and routing test scenarios use the updated types.

Priority: Low

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Refactor

Possibly related PRs

Suggested reviewers: gergely-kurucz-konghq

Merge Risk: Minimal · up to e1c94

The provider relocation appears mergeable after normal checks. No remaining repository references to the removed API were found; live Svix integration behavior remains unverified.

Pre-merge checks: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: moving Notification V4 provider contracts into the provider package.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chrisgacsal chrisgacsal self-assigned this Oct 29, 2026
@chrisgacsal chrisgacsal added the release-note/ignore Ignore this change when generating release notes label Oct 29, 2026
@chrisgacsal
chrisgacsal merged commit 354cd29 into main Oct 29, 2026
42 of 44 checks passed
@chrisgacsal
chrisgacsal deleted the feat/notification-v4-provider-package branch October 29, 2026 16:38
gergely-kurucz-konghq added a commit that referenced this pull request Nov 3, 2026
The provider packages moved from providers/ to provider/ in #5401.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/ignore Ignore this change when generating release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants