Skip to content

feat(stovepipe): add BuildRunner extension contract and fake backend#401

Open
roychying wants to merge 3 commits into
uber:mainfrom
roychying:chenghan.ying/stovepipe-buildrunner-extention
Open

feat(stovepipe): add BuildRunner extension contract and fake backend#401
roychying wants to merge 3 commits into
uber:mainfrom
roychying:chenghan.ying/stovepipe-buildrunner-extention

Conversation

@roychying

Copy link
Copy Markdown
Contributor

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

@roychying
roychying requested review from a team, behinddwalls and sbalabanov as code owners July 20, 2026 18:35
Comment thread stovepipe/extension/buildrunner/buildrunner.go Outdated
Comment thread stovepipe/extension/buildrunner/README.md
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