You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8fbbaaf
Browse filesBrowse the repository at this point in the historyBrowse files
Build analysis records confirmed failures. The `fix` queue step selects the first failed target for each build and triggers one repair through a Go extension. Later failed targets remain recorded and their fix requests no-op. Submission can happen while the build is running. See the [workflow](workflow.md#workflow).
4
+
5
+
## 1. Record the failure
6
+
7
+
[`buildanalysis.Controller.Process`](../../../stovepipe/controller/buildanalysis/buildanalysis.go) obtains confirmed `BuildIssue{TaskID, UnitID}` observations from [`buildissue.Detector`](../../../stovepipe/extension/buildissue/buildissue.go). The detector owns provider confirmation rules.
8
+
9
+
Persist the observation through [`BuildIssueStore`](../../../stovepipe/extension/storage/build_issue_store.go) and reconcile its [`OpenBuildIssue`](../../../stovepipe/entity/open_build_issue.go). Preserve the opening's `FirstObservedBuildID` and any `FixID` when updating observation fields. A reopened issue has a new opening build. Build IDs are opaque identities.
10
+
11
+
Publish [`FixRequest`](../../../stovepipe/core/messagequeue/proto/fix.proto) with the queue, detecting BuildID, TaskID, UnitID, and FirstObservedBuildID. Partition by detecting BuildID. Replay publication after duplicate observation writes so interrupted handoffs can finish.
12
+
13
+
## 2. Select one target for the build
14
+
15
+
[`fix.Controller.Process`](../../../stovepipe/controller/fix/fix.go) reloads the Build and Request, checks queue identity, and verifies the persisted failure and issue opening.
16
+
17
+
1. If `Build.FirstFixID` is empty, persist a queued [`Fix`](../../../stovepipe/entity/fix.go) and conditionally select it through the existing `Build.Version` guard.
18
+
2. Keep the selected ID for the lifetime of the build. Requests for other targets acknowledge without submitting anything.
19
+
3. A duplicate request for the selected target can finish preparation while the repair is still queued. Recheck the issue opening and persist its `FixID` while preserving observation fields.
20
+
4. Mark an unselected competing candidate or a queued repair whose opening recovered as skipped. Preserve the build's selection.
21
+
22
+
The first eligible request processed wins. Build analysis continues collecting all observations. Each build has its own selection; cross-build or shared-cause deduplication requires later decision logic.
23
+
24
+
## 3. Trigger once
25
+
26
+
[`RepairExecutor.Submit(ctx, Fix) (string, error)`](../../../stovepipe/extension/fixer/fixer.go) is the provider interface. Resolve the executor and finish local preparation before claiming dispatch.
27
+
28
+
Conditionally persist `FixSubmitting` before making the outbound call. Only the delivery whose conditional write succeeds calls Submit. Redelivery after that marker acknowledges without another call, including after a timeout, process restart, or result-persistence failure.
29
+
30
+
On success, store `FixSubmitted` and the nonempty opaque `ExecutionRef`. On an error or empty reference, store `FixSubmissionUnknown` and the diagnostic in metadata. A trigger error can follow acceptance, so it does not establish execution failure. A failed result write leaves the durable submitting marker and does not repeat the outbound call.
31
+
32
+
This is at-most-once dispatch. A crash after the submitting marker and before the call may leave the repair unlaunched. A lost response leaves acceptance unknown. Both cases retain the build selection and require explicit follow-up rather than another automatic trigger. The provider's own execution behavior remains its responsibility.
33
+
34
+
## 4. Retain provenance
35
+
36
+
| Record | Key | Repair data |
37
+
| --- | --- | --- |
38
+
| Fix | queue/fix ID | Initiating BuildID, issue references, submission state, optional execution reference and metadata, version, timestamps. |
39
+
| Existing Build | queue/build ID | Write-once `FirstFixID` under the existing snapshot version. |
40
+
| OpenBuildIssue | queue/task/unit | Most recently selected `FixID` alongside the opening and observation state. |
41
+
42
+
Navigate `Fix.BuildID -> Build.RequestID -> Request.URI` for the initiating change. `Fix.Issues` retains the opening identity even if another build later assigns its own repair to that opening. Build analysis owns failure and recovery evidence.
43
+
44
+
The fixer adds one table and uses primary-key operations. Apply the schema additions and backfill the existing build/open-issue columns before deployment. Metadata contains optional provider details and submission diagnostics.
45
+
46
+
## Integration and follow-up work
47
+
48
+
[`core/fixrequest.Publish`](../../../stovepipe/core/fixrequest/publish.go) is the build-analysis handoff after observation and positive open-issue persistence. The build-analysis owner supplies that reconciliation and calls the helper, including on replay. The reference host retains its no-op detector until the integration lands.
49
+
50
+
The initial implementation ends after recording the trigger result. A future `fixsignal` step can observe execution and correlate authoritative recovery. A future decision policy can attach related failures to an existing repair or start additional fixes for unrelated causes. Those features are separate from this one-shot submission flow.
Copy file name to clipboardExpand all lines: doc/rfc/stovepipe/workflow.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,6 +169,8 @@ Per-stage design detail lives under `steps/` so this doc stays a pipeline overvi
169
169
-[buildsignal.md](steps/buildsignal.md) — the poll loop: hold-based re-poll cadence, per-build partitioning, and the fail-closed handoff to record
170
170
-[record.md](steps/record.md) — turning a terminal build outcome into an immutable validation fact, monotonic last-green advancement and ref promotion, and the hook event announcing the outcome. Project analysis already runs inline through `projectstatus.Resolver` and may later use results calculated by build analysis
171
171
172
+
For repair decisions, execution, and recovery, see the [repair RFC](fixer.md).
173
+
172
174
## Dedup, idempotency, and history rewrites
173
175
174
176
Ingestion is idempotent on `(Queue, head URI)`, so duplicate poller reports — and any future webhook producer racing the poller — converge on one Request. The pipeline persists the Queue's last-green URI and per-URI greenness, so it must tolerate a **history rewrite**: when `SourceControl` reports that the last-green URI is no longer an ancestor of the current head, `process` falls back to a full-monorepo build rather than trusting a baseline that no longer exists on the branch. The system converges to a correct greenness rather than wedging on a stale pointer.
Copy file name to clipboardExpand all lines: stovepipe/core/messagequeue/README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,3 +11,9 @@ Payloads are defined in proto3 (`proto/`, generated into `protopb/`) and seriali
11
11
-**buildsignal** (`TopicKeyBuildSignal`, `BuildSignal`) — build publishes the build id here after triggering; buildsignal holds the delivery between polls until the build reaches a terminal status. Partitioned by build id, so each build's poll loop is an independent partition.
12
12
-**buildanalysis** (`TopicKeyBuildAnalysis`, `BuildAnalysis`) — identifies a persisted build for issue detection, partitioned by build id. Build publishes a start notice and buildsignal publishes a completion notice with a distinct message id. See [build analysis](../../controller/buildanalysis/README.md) for polling and persistence behavior.
13
13
-**record** (`TopicKeyRecord`, `Record`) — buildsignal publishes the request id after persisting the terminal outcome; record reloads the request and records its validation fact. Partitioned by request id.
14
+
15
+
## Repair stage contract
16
+
17
+
**fix** (`TopicKeyFix`, [`FixRequest`](proto/fix.proto)) identifies a persisted observation and issue opening using queue, detecting build, task, unit, and first-observed build. Partition by detecting build ID. The `consumer.Controller` selects the first failed target through `Build.FirstFixID`, persists a submitting marker, and calls `RepairExecutor.Submit` once. Later failed targets no-op.
18
+
19
+
Persist observations and their current opening before publishing a request. Replay publication after duplicate observation writes so a crash between persistence and handoff can recover. Redelivery can complete preparation, but a durable submitting marker suppresses any further outbound call. Execution monitoring and verified recovery are follow-up work.
0 commit comments