Skip to content

feat: notification events v3 APIs - #4977

Draft
borosr wants to merge 5 commits into
feat/v3-notification-channelsfrom
feat/v3-notification-events
Draft

borosr wants to merge 5 commits into
feat/v3-notification-channelsfrom
feat/v3-notification-events

Conversation

@borosr

@borosr borosr commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR introduces internal v3 APIs for listing, retrieving, filtering, and resending notification events.

  • Defines notification-event schemas and operations in TypeSpec and generated clients.
  • Adds v3 handlers, routes, model conversion, filtering, and delivery-status mapping.
  • Extends notification persistence and reconciliation behavior to support the new APIs.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains within the eligible follow-up-review scope.

No blocking failure remains.

Important Files Changed

Filename Overview
api/spec/packages/aip/src/notifications/event.tsp Defines the v3 notification-event resource, polymorphic payloads, delivery statuses, and delivery-attempt responses.
api/spec/packages/aip/src/notifications/operations.tsp Adds internal list, get, and asynchronous resend operations for notification events.
api/v3/handlers/notification/events/convert.go Converts notification domain events, payloads, filters, and delivery metadata into the generated v3 API models.
api/v3/handlers/notification/events/list.go Implements paginated notification-event listing with sorting and structured filters.
api/v3/handlers/notification/events/resend.go Implements the bodyless asynchronous resend endpoint and delegates status transitions to the notification service.
openmeter/notification/adapter/event.go Extends event repository queries with typed field, JSONB annotation, channel, status, and ordering filters.
openmeter/notification/eventhandler/reconcile.go Migrates reconciliation event selection to the new delivery-status filter representation.
pkg/filter/jsonb.go Adds reusable JSONB filter predicate construction used by notification-event queries.

Sequence Diagram

sequenceDiagram
    participant Client
    participant API as Notification Events API
    participant Service as Notification Service
    participant DB as Event Repository
    participant Worker as Reconciliation Worker
    participant Webhook

    Client->>API: GET /notification/events
    API->>Service: ListEvents(filters)
    Service->>DB: Query namespaced events
    DB-->>Service: Events and delivery statuses
    Service-->>API: Domain events
    API-->>Client: v3 event representations

    Client->>API: "POST /notification/events/{id}/resend"
    API->>Service: ResendEvent(event, channels)
    Service->>DB: Mark eligible statuses RESENDING
    API-->>Client: 202 Accepted
    Worker->>DB: Poll pending/resending events
    Worker->>Webhook: Re-send delivery
    Webhook-->>Worker: Delivery result
    Worker->>DB: Update delivery status
Loading

Reviews (6): Last reviewed commit: "fix: resolve notification type format to..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

@borosr
borosr changed the base branch from main to feat/v3-notification-channels August 23, 2026 09:59
@borosr
borosr force-pushed the feat/v3-notification-events branch from 6075994 to 8855743 Compare August 24, 2026 07:32
@borosr borosr changed the title feat: notification channels v3 APIs feat: notification events v3 APIs Aug 24, 2026
@borosr
borosr force-pushed the feat/v3-notification-events branch from 8855743 to 5778d95 Compare August 24, 2026 10:07
@borosr
borosr force-pushed the feat/v3-notification-events branch from 5778d95 to 805caac Compare August 24, 2026 10:55
feat: wip

chore: regenerate api clients and restore server notification wiring after rebase

The rebase onto main resolved the generated artifacts with main's side, so
they are regenerated here from the merged TypeSpec sources. The v3 server
lost its notification handler wiring in the same resolution (main renamed
the surrounding governance service to entitlement-access); the notification
config field, validation, handler fields, and constructor wiring are
restored on top of main's entitlement-access naming.
Replace the either-key-or-id subject/feature event filters with explicit
subject_key, subject_id, feature_key and feature_id filters, and add general
JSONB key predicate support to pkg/filter (SelectJSONB, ApplyToQueryJSONB)
in place of the adapter-local annotation filter special-casing. The v1
handler maps its legacy repeated parameters onto the split filters by
partitioning values on ULID validity.
@borosr
borosr force-pushed the feat/v3-notification-events branch from 703aab7 to d988636 Compare September 7, 2026 13:39
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