Skip to content

feat(submitqueue): Carry a failed request's category and reason in its hook event - #1156

Open
roychying wants to merge 3 commits into
chenghan.ying/sq-request-failure-categoryfrom
chenghan.ying/sq-hook-failure-reason
Open

roychying wants to merge 3 commits into
chenghan.ying/sq-request-failure-categoryfrom
chenghan.ying/sq-hook-failure-reason

Conversation

@roychying

@roychying roychying commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Why?

request.failed says only that a request failed. A hook reacting to it would have to look up the summary to say why, and hooks run in the orchestrator, which can't read the gateway's store.

What?

  • request.failed payloads carry the failure, when the summary has it:
    • failure_category: the category from the terminal log's metadata;
    • failure_reason: the summary's reason, cut to 512 runes.
  • The payload keys are exported as hookevent.PayloadKey* constants, so consumers don't repeat string literals.
  • The hook RFC and the gateway README list the new keys.
  • Known gap, in the hookevent package doc: the payload is what the summary says when the event is published. Details a later copy of the finish fills in keep the same event ID, so they reach hooks only if the queue forgot the first. Since repair resends carry their caller's details (fix(submitqueue): Keep a finished request's reason when its terminal log is resent #1154), this is rare.

Test Plan

  • bazel test //submitqueue/core/hookevent/... //submitqueue/gateway/core/request/....
  • make lint check-gazelle check-mocks
  • End to end, on an internal staging deployment whose comment hook renders these payloads: failed builds, duplicates, merge conflicts and internal errors each reached the hook with their category and reason.

Issue

@roychying
roychying added this pull request to stack #1111 December 1, 2026 16:53
@roychying
roychying force-pushed the chenghan.ying/sq-hook-failure-reason branch from 40a7043 to 8eb8ec3 Compare December 1, 2026 17:56
@roychying
roychying force-pushed the chenghan.ying/sq-hook-failure-reason branch from 8eb8ec3 to c57ec81 Compare December 1, 2026 18:25
@roychying
roychying marked this pull request as ready for review December 1, 2026 18:29
@roychying
roychying requested review from a team and sbalabanov as code owners December 1, 2026 18:29
@roychying
roychying force-pushed the chenghan.ying/sq-hook-failure-reason branch from f30a6c7 to 35eb3a4 Compare December 2, 2026 22:23
@roychying
roychying force-pushed the chenghan.ying/sq-hook-failure-reason branch from 35eb3a4 to e25cbfd Compare December 2, 2026 22:55

This branch has not been deployed

No deployments
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