Skip to content

feat(submitqueue): Announce received and finished requests from the gateway's request materializer - #1106

Open
roychying wants to merge 4 commits into
mainfrom
chenghan.ying/sq-hook-request-started
Open

roychying wants to merge 4 commits into
mainfrom
chenghan.ying/sq-hook-request-started

Conversation

@roychying

@roychying roychying commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Why?

SubmitQueue v2 says nothing on a pull request or diff after a land. v1 comments when it receives a request, with a link to it, and again when the request lands or fails. The hooks framework is the seam for side effects like this, but SubmitQueue publishes no request events yet.

These events follow the request's summary in the gateway, the status users see, rather than pipeline transitions. That way a hook agrees with the UI in every case, including a request whose start failed before the orchestrator saved it. That request is only ever an error log with request version 0, and it gets no pipeline transition to hang an event on.

What?

  • submitqueue/core/hookevent defines four event types, published once per change of the request. Each payload is {queue, request_id, change_uri}.
    • request.received: the request left accepting, normally when Land records accepted. Version 0.
    • request.landed / request.failed / request.cancelled: the summary is landed / error / cancelled. The event carries the summary's request version.
  • Materializer.WithHookPublishing(registry) publishes to the registry's hook topic, and only if the registry has registered that topic.
    • Received is published once, when an update moves the summary out of accepting. A failed publish is only counted, on request_hook.publish_errors.
    • Landed, failed or cancelled is published on every delivery of a log that restates the summary. A failed publish is returned, so redelivering the log retries it. Republishes reuse the same event ID.
  • Known gaps are listed in the hookevent package doc:
    • A receipt can be lost if its publish fails.
    • A failure can repeat a finished event.
    • The finish can arrive before a receipt that is waiting to retry.
    • The queue only drops a duplicate event ID for a few seconds.

Test Plan

Issue

@roychying
roychying marked this pull request as ready for review November 16, 2026 23:41
@roychying roychying changed the title Chenghan.ying/sq hook request started feat(submitqueue): Announce each request's start and terminal state on the hook topic Nov 16, 2026
@roychying
roychying force-pushed the chenghan.ying/sq-hook-request-started branch from 93b20df to 86f8b0a Compare November 17, 2026 04:56
@roychying roychying changed the title feat(submitqueue): Announce each request's start and terminal state on the hook topic feat(submitqueue): Announce received and finished requests from the gateway's request materializer Nov 17, 2026
@roychying
roychying force-pushed the chenghan.ying/sq-hook-request-started branch 2 times, most recently from bf89510 to 5540e3f Compare November 17, 2026 08:12
@roychying
roychying added this pull request to stack #1111 November 17, 2026 19:44
@roychying
roychying force-pushed the chenghan.ying/sq-hook-request-started branch from 8bb8abf to ef3939c Compare November 30, 2026 16:56

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