Skip to content

feat(hook): Deliver events to integrations - #607

Open
prathshenoy wants to merge 1 commit into
prath.shenoy/hook-event-contractfrom
prath.shenoy/hook-dispatch
Open

feat(hook): Deliver events to integrations#607
prathshenoy wants to merge 1 commit into
prath.shenoy/hook-event-contractfrom
prath.shenoy/hook-dispatch

Conversation

@prathshenoy

@prathshenoy prathshenoy commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

What:

  • Consume lifecycle events from a durable queue and hand each one to every integration wired for the deployment, retrying and then dead-lettering the ones that keep failing.
  • Record every dead-lettered event with its full payload and failure reason, and count it on a metric meant to page.

Why:

  • Keep a slow or broken integration from stalling or failing the work that triggered it.
  • Make a lost notification recoverable and impossible to miss, since nothing else in the system notices when one goes missing.

Test Plan

  • Add unit tests.

Revert Plan

  • Revert this PR. No service constructs the dispatcher or subscribes to the hook topic.

Issues

Stack

  1. feat(hook): Add contract for lifecycle events #606
  2. @ feat(hook): Deliver events to integrations #607
  3. feat(orch): Consume hook events #608

@prathshenoy
prathshenoy force-pushed the prath.shenoy/hook-event-contract branch from b5394eb to 837e0d8 Compare August 17, 2026 16:54
@prathshenoy
prathshenoy force-pushed the prath.shenoy/hook-dispatch branch from a09dcab to b6aef89 Compare August 17, 2026 16:56
@prathshenoy
prathshenoy marked this pull request as ready for review August 17, 2026 16:56
@prathshenoy
prathshenoy force-pushed the prath.shenoy/hook-event-contract branch from 837e0d8 to b5394eb Compare August 18, 2026 00:27
@prathshenoy
prathshenoy force-pushed the prath.shenoy/hook-dispatch branch from b6aef89 to a09dcab Compare August 18, 2026 00:27
@behinddwalls

Copy link
Copy Markdown
Collaborator

🛑 Automatic stack rebase aborted — diff mismatch

The rebase of prath.shenoy/hook-dispatch completed without conflicts, but the resulting code diff does not match the original. This means the rebase silently altered code content. The branch was not force-pushed.

Please rebase manually and verify the changes are correct.

failures = append(failures, fmt.Errorf("hook %s: %w", child.Name(), err))
}
}
return errors.Join(failures...)

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.

errors.Join creates an error tree (Unwrap() []error), but platform/errs.NewClassifierProcessor only walks linear Unwrap() error chains. Plain transient errors returned by child hooks can therefore bypass configured classifiers and default to non-retryable, sending the event directly to the DLQ. Let's think through how to make the error classifier properly unwrap joined error chains and classify them for retryability.

// succeeded.
func (h Hook) Handle(ctx context.Context, event *basehook.HookEvent) error {
var failures []error
for _, child := range h.children {

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.

Should these independent hooks run concurrently rather than serially? This would avoid one slow hook from blocking others from starting. Just need to be careful to avoid any leaked goroutines here.

behinddwalls pushed a commit to behinddwalls/submitqueue that referenced this pull request Aug 19, 2026
## Summary
**What**:
- Define the shared event format every domain publishes for
fire-and-forget lifecycle notifications, carrying origin, type, timing,
a staleness marker, and open per-event detail.
- Derive an event's identity from the transition it describes, so
replaying a transition produces the same identity and duplicate
deliveries collapse.

**Why**:
- Enable integrations to react to pipeline milestones without adding
call sites that can stall or fail a merge.
- Establish one schema and one identity rule before any producer ships,
so a consumer spanning several domains needs only one reader.

## Test Plan
- [x] Add unit tests.

## Revert Plan
- Revert this PR. No topic is registered and no message of this shape
exists on any queue.

## Issues
-
[CODEM-416](https://linear.app/uber/issue/CODEM-416/hooks-integration-downstream-notificaiton)

## Stack
1. @ uber#606
1. uber#607
1. uber#608
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants