Skip to content

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

Merged
roychying merged 3 commits into
uber:mainfrom
roychying:chenghan.ying/stovepipe-buildrunner-extention
Jul 22, 2026
Merged

feat(stovepipe): add BuildRunner extension contract and fake backend#401
roychying merged 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
@roychying
roychying force-pushed the chenghan.ying/stovepipe-buildrunner-extention branch from 96902d1 to c50b42d Compare July 21, 2026 22:51
@roychying
roychying added this pull request to the merge queue Jul 22, 2026
Merged via the queue into uber:main with commit c06e3dc Jul 22, 2026
15 checks passed
JamyDev pushed a commit that referenced this pull request Jul 24, 2026
…401)

## 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=<token> 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
<!-- 
Link the issue here. 
- Use 'Closes #123' if this is the final fix. 
- Use 'Part of #123' or just '#123' if the feature is still in progress.
-->
JamyDev pushed a commit that referenced this pull request Jul 24, 2026
…401)

## 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=<token> 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
<!-- 
Link the issue here. 
- Use 'Closes #123' if this is the final fix. 
- Use 'Part of #123' or just '#123' if the feature is still in progress.
-->
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