Skip to content

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

Merged
roychying merged 3 commits into
mainfrom
chenghan.ying/sq-hook-failure-reason
Dec 3, 2026
Merged

roychying merged 3 commits into
mainfrom
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 4 times, most recently from 123f09d to 4e39350 Compare December 3, 2026 16:39
@roychying
roychying added this pull request to the merge queue Dec 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to invalid changes in the merge commit Dec 3, 2026
@roychying
roychying added this pull request to the merge queue Dec 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to invalid changes in the merge commit Dec 3, 2026
Base automatically changed from chenghan.ying/sq-request-failure-category to main December 3, 2026 19:49
@roychying
roychying force-pushed the chenghan.ying/sq-hook-failure-reason branch from 4e39350 to 306f5d4 Compare December 3, 2026 19:49
@roychying
roychying added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit 420604e Dec 3, 2026
23 checks passed
@roychying
roychying deleted the chenghan.ying/sq-hook-failure-reason branch December 3, 2026 20:08
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.

3 participants