feat(example): per-queue extension wiring; retire buildrunner/noop#193
Open
behinddwalls wants to merge 1 commit into
Open
feat(example): per-queue extension wiring; retire buildrunner/noop#193behinddwalls wants to merge 1 commit into
behinddwalls wants to merge 1 commit into
Conversation
behinddwalls
commented
Jun 4, 2026
| // Trigger records the desired outcome for a new build (decided from a marker | ||
| // token in the head changes) and returns its unique build ID. The base changes | ||
| // and metadata are ignored. | ||
| func (r *runner) Trigger(_ context.Context, _ []entity.Change, head []entity.Change, _ entity.BuildMetadata) (entity.BuildID, error) { |
Collaborator
Author
There was a problem hiding this comment.
what if trigger itself falils
Collaborator
Author
There was a problem hiding this comment.
| // Status returns the outcome recorded for the build at Trigger time. Unknown | ||
| // build IDs default to succeeded, keeping the runner best-case for builds it did | ||
| // not create. | ||
| func (r *runner) Status(_ context.Context, buildID entity.BuildID) (entity.BuildStatus, entity.BuildMetadata, error) { |
Collaborator
Author
There was a problem hiding this comment.
can we make buildID in certain way so we don't have maintain the state and can be just driven by what buildID contains
Collaborator
Author
There was a problem hiding this comment.
Done — the runner is now stateless. Trigger encodes the terminal outcome into the BuildID (e.g. fake-build-fail-7), and Status derives the result purely from the BuildID it's given — the per-build outcome map + mutex are gone, so any runner instance can answer Status for an ID minted by any other (even across controllers/processes). Fixed in #197 (the file moved there after the split).
7c72f1e to
603dcc4
Compare
603dcc4 to
43f3258
Compare
3471964 to
d292387
Compare
43f3258 to
b0be135
Compare
348a546 to
dd07845
Compare
b0be135 to
903c210
Compare
dd07845 to
7b45cdb
Compare
903c210 to
c98548e
Compare
JamyDev
approved these changes
Jun 5, 2026
7b45cdb to
b2171aa
Compare
c98548e to
742c208
Compare
b2171aa to
00c50e7
Compare
742c208 to
859382e
Compare
00c50e7 to
a4c97e3
Compare
859382e to
3555f6a
Compare
This was referenced Jun 5, 2026
behinddwalls
added a commit
that referenced
this pull request
Jun 5, 2026
## Summary ### Why? The scorer took entity.Change (just URIs), so it could not score on real change size — the example heuristic counted URIs as a placeholder. With typed change details now persisted on change records, the scorer can score a batch on its actual lines/files changed. ### What? - Add entity.BatchChanges — the normalized, batch-level view of all changes in a batch (BatchID, Queue, []ChangeInfo) with aggregation helpers. - Scorer.Score now takes entity.BatchChanges; the heuristic ValueFunc and the composite scorer operate over it. - The score controller resolves each request's change records, flattens their details into BatchChanges, and scores the batch once — replacing the per-request multiplicative product over len(URIs). - Example wiring buckets by total lines changed. Consumes the typed details persisted by the change-details change. ## Test Plan - ✅ `make build`, `make test`, `make lint`, `make check-mocks/gazelle/tidy` - ✅ `make integration-test`, `make e2e-test` (start -> validate enrich -> score normalizes the batch and scores on real change size) ## Issues ## Stack 1. #195 1. @ #196 1. #197 1. #193 1. #202
3555f6a to
c1fccc7
Compare
a4c97e3 to
1cb6b1f
Compare
## Summary ### Why? Demonstrate SubmitQueue's core premise — per-queue pluggable extensions — in the example orchestrator, rather than wiring one implementation for every queue, and make the fakes drivable end-to-end. Also document where factory implementations and queue routing belong. Stacked on the fakes PR, which adds the extension/*/fake packages this PR wires in. ### What? - Queue-major registry in example main.go: queueExtensions (one queue's full impl set) + queueRegistry (queue -> profile, with a default). Six thin Factory adapters resolve impls by Config.QueueName — all routing lives here in the wiring layer. - Per-queue profiles: test-queue (heuristic over lines changed), e2e-test-queue (composite scorer, no-conflict), plus a new e2e-conflict-error-queue that always fails conflict analysis. Edge integrations + build runner share a baseline; scorer/analyzer are wrapped by the decorator fakes (score-error marker / failing predicate). - Retire buildrunner/noop (subsumed by buildrunner/fake); switch the build controller unit test to buildfake. - queues.yaml: register e2e-conflict-error-queue. - CLAUDE.md: extensions hold contracts + impls only — factory implementations and routing live in the wiring layer; plus a TODO to evaluate promoting the registry into submitqueue/core later. ## Test Plan - ✅ `make test` — 44/44 unit tests - ✅ `make e2e-test` — 1/1 - ✅ `make integration-test` — 7/7 - ✅ `make check-gazelle` / `make check-tidy` — clean - ✅ Live stack (`make local-submitqueue-start`): Ping OK; gateway rejects unknown queues; validated end-to-end — scorer passthrough (test-queue), scorer error (`?sq-fake=score-error` -> "fake: marked score error"), and conflict error (e2e-conflict-error-queue -> "fake: injected analyze error").
c1fccc7 to
c766024
Compare
1cb6b1f to
36a6b69
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?
Demonstrate SubmitQueue's core premise — per-queue pluggable extensions —
in the example orchestrator, rather than wiring one implementation for
every queue, and make the fakes drivable end-to-end. Also document where
factory implementations and queue routing belong.
Stacked on the fakes PR, which adds the extension/*/fake packages this PR
wires in.
What?
full impl set) + queueRegistry (queue -> profile, with a default). Six
thin Factory adapters resolve impls by Config.QueueName — all routing
lives here in the wiring layer.
e2e-test-queue (composite scorer, no-conflict), plus a new
e2e-conflict-error-queue that always fails conflict analysis. Edge
integrations + build runner share a baseline; scorer/analyzer are wrapped
by the decorator fakes (score-error marker / failing predicate).
controller unit test to buildfake.
implementations and routing live in the wiring layer; plus a TODO to
evaluate promoting the registry into submitqueue/core later.
Test Plan
make test— 44/44 unit testsmake e2e-test— 1/1make integration-test— 7/7make check-gazelle/make check-tidy— cleanmake local-submitqueue-start): Ping OK; gateway rejectsunknown queues; validated end-to-end — scorer passthrough (test-queue),
scorer error (
?sq-fake=score-error-> "fake: marked score error"), andconflict error (e2e-conflict-error-queue -> "fake: injected analyze
error").
Issues
Stack