feat(build): add BuildManager extension and trim BuildStatus enum#167
Closed
behinddwalls wants to merge 1 commit into
Closed
feat(build): add BuildManager extension and trim BuildStatus enum#167behinddwalls wants to merge 1 commit into
behinddwalls wants to merge 1 commit into
Conversation
bf4822a to
39d6643
Compare
## Summary
Adds a vendor-agnostic `BuildManager` interface under `extension/build`
so the orchestrator can drive builds against an external provider
(BuildKite, Jenkins, an internal job runner, etc.) without coupling to
any one of them.
### Interface
`BuildManager` exposes four verbs — `Trigger`, `Status`, `Cancel`,
`Close`:
- `Trigger` returns `(buildID, status, error)`; an implementation that
can deduce an already-finished build returns its terminal status so
the caller can skip the first `Status` poll, otherwise `Accepted`.
- `Status` may be synchronous and lengthy (a provider round trip);
`Trigger`/`Cancel` must return promptly.
- The godoc spells out what is required of an implementation:
concurrency safety, internal recovery from transient connectivity
failures, transient-only local state, and plain errors left for the
controller to classify per `core/errs`. No custom error sentinels
ship yet — they land with the first implementation that needs them.
### Entity changes
- `entity.BuildStatus` is
`{Unknown, Accepted, Running, Succeeded, Failed, Cancelled}`. This
drops the provider-specific `Queued`/`Blocked` stages and renames
`Passed → Succeeded`, while keeping `Running` as a first-class
non-terminal state so callers can distinguish a queued/accepted build
from one that is actively executing. Orchestrator build/buildsignal
references use `Accepted`.
- Adds `entity.ChangeAction`, `entity.BuildChange`,
`entity.BuildMetadata` as `Trigger` inputs/outputs.
### Out of scope
No backend implementation and no orchestrator wiring — those are
follow-ups.
## Test Plan
- ✅ \`make fmt && make lint\`
- ✅ \`make check-tidy && make check-gazelle && make check-mocks\`
- ✅ \`bazel build //...\`
- ✅ \`bazel test //... --test_tag_filters=-integration\`
(integration tests require Docker, not run here)
## Issues
(none)
39d6643 to
81d6537
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
Adds a vendor-agnostic
BuildManagerinterface underextension/buildso the orchestrator can drive builds against an external provider
(BuildKite, Jenkins, an internal job runner, etc.) without coupling to
any one of them.
Interface
BuildManagerexposes four verbs —Trigger,Status,Cancel,Close:Triggerreturns(buildID, status, error); an implementation thatcan deduce an already-finished build returns its terminal status so
the caller can skip the first
Statuspoll, otherwiseAccepted.Statusmay be synchronous and lengthy (a provider round trip);Trigger/Cancelmust return promptly.concurrency safety, internal recovery from transient connectivity
failures, transient-only local state, and plain errors left for the
controller to classify per
core/errs. No custom error sentinelsship yet — they land with the first implementation that needs them.
Entity changes
entity.BuildStatusis{Unknown, Accepted, Running, Succeeded, Failed, Cancelled}. Thisdrops the provider-specific
Queued/Blockedstages and renamesPassed → Succeeded, while keepingRunningas a first-classnon-terminal state so callers can distinguish a queued/accepted build
from one that is actively executing. Orchestrator build/buildsignal
references use
Accepted.entity.ChangeAction,entity.BuildChange,entity.BuildMetadataasTriggerinputs/outputs.Out of scope
No backend implementation and no orchestrator wiring — those are
follow-ups.
Test Plan
(integration tests require Docker, not run here)
Issues
Stack