Skip to content

feat(stovepipe): extend Request entity to support new process step#319

Open
mnoah1 wants to merge 2 commits into
mnoah1/stovepipe-queue-storefrom
mnoah1/stovepipe-request-entity
Open

feat(stovepipe): extend Request entity to support new process step#319
mnoah1 wants to merge 2 commits into
mnoah1/stovepipe-queue-storefrom
mnoah1/stovepipe-request-entity

Conversation

@mnoah1

@mnoah1 mnoah1 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

What?

Updating the Request entity to accommodate upcoming functionality in the process step:

  • New RequestState values - processing once the processing step has started, and superseded for requests that will be skipped in favor of building a newer one
  • BuildStrategy/BaseURI fields which will get populated by the process process for downstream use during builds
  • Since request IDs are minted in order by ingest, I realized it's a bit redundant to store a separate sequence ID in the DB. Instead, define a CompareRequestID function for cases that require ID comparison, and converge to just storing the ID.

Why?

Implementing behavior in https://github.com/uber/submitqueue/blob/main/doc/rfc/stovepipe/steps/process.md - which introduces two new outcome states and includes logic to determine the build strategy for a request.

Test Plan

  • Unit tests
  • Subsequent changes will pull this logic together into an end to end flow

@mnoah1 mnoah1 marked this pull request as ready for review July 8, 2026 21:19
@mnoah1 mnoah1 requested review from a team, behinddwalls and sbalabanov as code owners July 8, 2026 21:19
@mnoah1 mnoah1 changed the title feat(stovepipe): extend Request entity and MySQL storage feat(stovepipe): extend Request entity to support new process step Jul 8, 2026
Comment thread stovepipe/entity/request.go Outdated
Comment on lines +77 to +79
// BaseURI is the base URI to be used for this request when the strategy is incremental.
// Empty for full-monorepo builds and cold start.
BaseURI string `json:"base_uri"`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this in request itself? would we publish to build only when the last one is done? i guess question i have is where to we decide latest last green?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where to we decide latest last green?

We currently propose doing this just before starting builds (process steps - 7a).

do we need this in request itself?

Once selected above, we need to store it somewhere for retrieval once the builds start. I think Request is reasonable for the MVP, but alternatively we could put it in a separate table of planned builds. The latest green value stored in the Queue entity represents more of a moving bookmark of latest green, while the value here serves as the fixed base for that specific request.

would we publish to build only when the last one is done?

Yes - when the concurrent builds is 1, that is effectively true. When increased, it would be whenever an available build slot has become free.

Comment on lines +53 to +60
// requestCounter extracts the per-queue counter suffix from a request id.
func requestCounter(id, queue string) (int64, error) {
prefix := requestIDPrefix(queue)
if !strings.HasPrefix(id, prefix) {
return 0, fmt.Errorf("request id %q does not match queue %q", id, queue)
}
return strconv.ParseInt(id[len(prefix):], 10, 64)
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to understand the format the ID? can we treat it string which is separate from seq?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going back and forth a bit on this (initially I was thinking we'll track sequence and ID as two separate fields). But as I worked on this branch, realized we could avoid a separate sequence field if we require sequence info to be encoded in the ID and use a comparison function. Do you have any thoughts on one approach vs. the other? Obviously there is the cost to parse the int on each comparison, but doing that a handful of times per request will be far from a bottleneck.

mnoah1 added 2 commits July 9, 2026 16:51
Align entity and storage contract tests with review feedback to use
"full" instead of "monorepo" for the whole-repo build strategy.
@mnoah1 mnoah1 force-pushed the mnoah1/stovepipe-request-entity branch from bbf0abf to 90cbeef Compare July 9, 2026 18:20
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.

2 participants