feat(stovepipe): add and wire the buildsignal stage controller#409
Open
roychying wants to merge 2 commits into
Open
feat(stovepipe): add and wire the buildsignal stage controller#409roychying wants to merge 2 commits into
roychying wants to merge 2 commits into
Conversation
roychying
requested review from
a team,
behinddwalls and
sbalabanov
as code owners
July 20, 2026 23:24
roychying
force-pushed
the
chenghan.ying/stovepipe-buildsignal-controller
branch
from
July 21, 2026 00:01
7459fe1 to
63562b5
Compare
Comment on lines
+45
to
+51
| // PollDelayAcceptedMs is the delay before the next Status call while the | ||
| // build is queued by the runner but has not started executing. | ||
| PollDelayAcceptedMs int64 = 5000 | ||
| // PollDelayRunningMs is the delay before the next Status call while the | ||
| // build is executing. | ||
| PollDelayRunningMs int64 = 2000 | ||
| ) |
Collaborator
There was a problem hiding this comment.
i think this needs to be configurable and come via controller inputs eventially, can you add TODO to do so
| buildRunner, err := c.buildRunners.For(buildrunner.Config{QueueName: request.Queue}) | ||
| if err != nil { | ||
| // A queue with no registered builder is a config error. | ||
| return fmt.Errorf("BuildSignalController failed to resolve build runner for queue %s: %w", request.Queue, err) |
Collaborator
There was a problem hiding this comment.
BuildSignalController marker? can we remove those?
| // loadRequest returns the request for id. A miss here is almost certainly a | ||
| // lagging read behind the Build that referenced it, so it is retryable; a | ||
| // genuinely orphaned Build still dead-letters at MaxAttempts. | ||
| func (c *Controller) loadRequest(ctx context.Context, id string) (entity.Request, error) { |
Collaborator
There was a problem hiding this comment.
i see it being duplicated between build and buildsignal
| if err == nil { | ||
| return got, nil | ||
| } | ||
| if errors.Is(err, storage.ErrNotFound) { |
Collaborator
There was a problem hiding this comment.
same as other PR, why do we need to handle not found?
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.
What?
Adds
stovepipe/controller/buildsignalplus the newRecordqueue message/proto andTopicKeyRecord.Processconsumes aBuildSignal(build id), loadsBuild+Request, no-ops if the request is terminal, pollsbuildRunner.Status, persists a real status transition via CAS (BuildStore.Update) with terminal status write-once (a later poll of a flaky backend can never overwrite an already-committed terminal status), and either reschedules itself viaPublishAfter(5s whileaccepted, 2s whilerunning) or, once terminal, publishes torecord. Wires the controller intomain.goand registers thebuildsignal(subscribed) andrecord(publish-only, no consumer yet) topics.Test Plan
make build,make test- all clean.Issue