feat(stovepipe)!: key the record stage on the request id - #468
Open
behinddwalls wants to merge 1 commit into
Open
feat(stovepipe)!: key the record stage on the request id#468behinddwalls wants to merge 1 commit into
behinddwalls wants to merge 1 commit into
Conversation
This was referenced Jul 29, 2026
behinddwalls
force-pushed
the
preetam/stovepipe-record-request-id
branch
from
July 29, 2026 22:41
96413b8 to
c524a8a
Compare
behinddwalls
marked this pull request as ready for review
July 29, 2026 23:09
## Summary ### Why? `buildsignal` published the *build* id to `record`, but `record`'s unit of work is a Request: it writes whole-repo greenness for the Request's URI, advances the Queue's last-green bookmark, and fires Hooks. Keying its input on a build artifact forces every future reader to navigate Build→Request, and it bakes a one-build-per-Request assumption into the wire contract. The assumption is also the wrong one to encode. The concurrency knob gates how many *Requests* are in flight per Queue — same base, different head, one build each — so the fan-out axis is Queue→N Requests, not Request→N Builds. And if a Request ever did fan out, a build-keyed input would give `record` N messages with no way to tell "one build failed" from "one failed and three haven't reported yet". A request-keyed input lets `record` answer its own question. ### What? `Record.id` now carries the request id, and `publishRecord` uses it for the payload, the message id, and the partition key. The field name stays `id`, matching `ProcessRequest.id` and `BuildRequest.id`. Partitioning is unchanged — it was already request id — so the only wire change is what the payload means. No reverse index is needed to make this work: the previous commit projects the build's terminal status onto `Request.State`, so `record` reads the Request and never reaches a `Build`. That also leaves the "no reverse index from Request to its builds" property in `build.md` intact, for a better reason than before, and the derived-build-key alternative explicitly untriggered — its condition is a stage that must derive a build's key from a Request, which `record` no longer does. Marked `!` because the `record` topic's payload semantics change. Nothing consumes it yet — the `record` stage lands later — so there is no migration. ## Test Plan ✅ `bazel test //stovepipe/...` — new unit test pins that the record payload, message id, and partition key are all the request id. ✅ `bazel test //test/e2e/stovepipe/...` — the slow-build case now additionally asserts the request reaches `succeeded` and the queue's `in_flight_count` returns to 0.
behinddwalls
force-pushed
the
preetam/stovepipe-record-request-id
branch
from
July 30, 2026 07:51
c524a8a to
1879181
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why?
buildsignalpublished the build id torecord, butrecord's unit of work is a Request: it writes whole-repo greenness for the Request's URI, advances the Queue's last-green bookmark, and fires Hooks. Keying its input on a build artifact forces every future reader to navigate Build→Request, and it bakes a one-build-per-Request assumption into the wire contract.The assumption is also the wrong one to encode. The concurrency knob gates how many Requests are in flight per Queue — same base, different head, one build each — so the fan-out axis is Queue→N Requests, not Request→N Builds. And if a Request ever did fan out, a build-keyed input would give
recordN messages with no way to tell "one build failed" from "one failed and three haven't reported yet". A request-keyed input letsrecordanswer its own question.What?
Record.idnow carries the request id, andpublishRecorduses it for the payload, the message id, and the partition key. The field name staysid, matchingProcessRequest.idandBuildRequest.id. Partitioning is unchanged — it was already request id — so the only wire change is what the payload means.No reverse index is needed to make this work: the previous commit projects the build's terminal status onto
Request.State, sorecordreads the Request and never reaches aBuild. That also leaves the "no reverse index from Request to its builds" property inbuild.mdintact, for a better reason than before, and the derived-build-key alternative explicitly untriggered — its condition is a stage that must derive a build's key from a Request, whichrecordno longer does.Marked
!because therecordtopic's payload semantics change. Nothing consumes it yet — therecordstage lands later — so there is no migration.Test Plan
✅
bazel test //stovepipe/...— new unit test pins that the record payload, message id, and partition key are all the request id.✅
bazel test //test/e2e/stovepipe/...— the slow-build case now additionally asserts the request reachessucceededand the queue'sin_flight_countreturns to 0.Stack