feat(stovepipe): add BuildRunner extension contract and fake backend#401
Open
roychying wants to merge 3 commits into
Open
feat(stovepipe): add BuildRunner extension contract and fake backend#401roychying wants to merge 3 commits into
roychying wants to merge 3 commits into
Conversation
roychying
requested review from
a team,
behinddwalls and
sbalabanov
as code owners
July 20, 2026 18:35
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.
Why?
Stovepipe's build pipeline step needs a vendor-agnostic way to trigger and poll builds against an external CI system before it can wire up a real backend (e.g. Buildkite/GitHub Actions) or the controller that drives it. SubmitQueue already has this shape via its own buildrunner extension, but Stovepipe validates a single commit against a baseline rather than a stack of dependency batches, so it needs its own interface with URI-based identity instead of batch identity — see doc/rfc/stovepipe/steps/build.md's "Why separate contracts" for the full rationale. This PR lands that contract plus a stateless fake implementation.
What?
stovepipe/extension/buildrunner/buildrunner.go: the BuildRunner interface (Trigger/Status/Cancel), Config, and the Factory interface, per the repo's extension rules (concrete factories and per-queue routing stay in the wiring layer). Trigger(ctx, headURI, baseURI, metadata) (entity.BuildID, error) mints a fresh build id every call — no caller-supplied dedup key; Status may round-trip to the backend; Cancel is defined for contract parity but not yet called by any controller.stovepipe/extension/buildrunner/fake/fake.go: a stateless BuildRunner for tests/examples. Defaults to succeeding immediately; failure modes are injected via a buildrunner-fake= marker embedded in headURI (trigger-error, build-fail, build-error). The outcome is encoded directly in the returned BuildID (with a random suffix for uniqueness) so Status needs no per-build bookkeeping and can even be served by a different runner instance/process than the one that triggered it.stovepipe/extension/buildrunner/mock/buildrunner_mock.go: generated gomock mock for BuildRunner, for controller-level unit tests.Test Plan
make gazelle, make build, make test - all clean.
Issue