feat(extensions): fake implementations with error injection#197
Open
behinddwalls wants to merge 1 commit into
Open
feat(extensions): fake implementations with error injection#197behinddwalls wants to merge 1 commit into
behinddwalls wants to merge 1 commit into
Conversation
This was referenced Jun 4, 2026
## Summary ### Why? Extensions over external systems (changeprovider, buildrunner, pusher, mergechecker) had no runnable stub to exercise their success — and especially failure — paths without standing up the real backend (GitHub/CI/git). scorer and conflict had deterministic stubs (heuristic, composite, all, none) but no way to inject errors. These fakes let tests drive both happy and error paths end-to-end from a land request. ### What? - buildrunner/fake, changeprovider/fake, pusher/fake, mergechecker/fake: best-case by default; inject failures via an `sq-fake=<token>` marker in a change URI (e.g. build-fail, conflict, unmergeable, provider-error). - scorer/fake, conflict/fake: decorators that wrap an existing impl (the "pick") and overlay error injection — scorer via the URI marker (score-error) over entity.BatchChanges, analyzer via a predicate, since Analyze sees batches, not change URIs. - Each fake exposes only New(...) (decorator constructors for scorer/ conflict). No factory implementations live in extension/* — those belong in the wiring layer. - pusher/README.md documents the fake. These packages are test/example stubs, never production. They are wired into the example orchestrator in a follow-up PR. ## Test Plan - ✅ `make test` — fake package tests - ✅ `bazel build //...`
3471964 to
d292387
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?
Extensions over external systems (changeprovider, buildrunner, pusher,
mergechecker) had no runnable stub to exercise their success — and
especially failure — paths without standing up the real backend
(GitHub/CI/git). scorer and conflict had deterministic stubs (heuristic,
composite, all, none) but no way to inject errors. These fakes let tests
drive both happy and error paths end-to-end from a land request.
What?
best-case by default; inject failures via an
sq-fake=<token>marker ina change URI (e.g. build-fail, conflict, unmergeable, provider-error).
"pick") and overlay error injection — scorer via the URI marker
(score-error) over entity.BatchChanges, analyzer via a predicate, since
Analyze sees batches, not change URIs.
conflict). No factory implementations live in extension/* — those belong
in the wiring layer.
These packages are test/example stubs, never production. They are wired
into the example orchestrator in a follow-up PR.
Test Plan
make test— fake package testsbazel build //...Stack