Skip to content

refactor: merge StageState into StageResult; per-stage error model#906

Merged
dieppa merged 1 commit into
masterfrom
refactor/pipeline_manualintervention_aggregation
May 13, 2026
Merged

refactor: merge StageState into StageResult; per-stage error model#906
dieppa merged 1 commit into
masterfrom
refactor/pipeline_manualintervention_aggregation

Conversation

@dieppa
Copy link
Copy Markdown
Member

@dieppa dieppa commented May 13, 2026

Collapse StageState (was in flamingock-core) into a polymorphic class on StageResult
(in flamingock-core-commons), replacing the StageStatus enum. Per-stage errors now live
on StageResult.state and surface in the response without a pipeline-level fallback.

  • StageState (polymorphic, Jackson @JsonTypeInfo): NotStarted, Started, Completed,
    Failed(ErrorInfo), BlockedForMI extends Failed (also carries List<RecoveryIssue>).
  • StageResult.status: StageStatusstate: StageState. StageStatus enum removed.
  • StageRun simplifies: single non-null StageResult, initialised with NOT_STARTED.
  • ErrorInfo.changeId: StringchangeIds: List<String>. fromThrowable signature updated.
  • BlockedForMI synthesises its own ErrorInfo (type MANUAL_INTERVENTION_REQUIRED,
    changeIds populated). No more null-changeId leaking out.
  • Runner's MI catch drops the redundant markPipelineFailed(miEx); BlockedForMI stages
    carry their own error info. findStageForChange throws IllegalStateException on an
    unmappable changeId (deterministic contract).
  • RecoveryIssue gets @JsonCreator so BlockedForMI round-trips through Jackson.
  • NOT_STARTED stages now appear in response.stages.

Wire format: StageResult.state is polymorphic ({"type":"FAILED","errorInfo":{...}}).
ErrorInfo.changeId renamed to changeIds (array).

Collapse StageState (was in flamingock-core) into a polymorphic class on StageResult
(in flamingock-core-commons), replacing the StageStatus enum. Per-stage errors now live
on StageResult.state and surface in the response without a pipeline-level fallback.

- `StageState` (polymorphic, Jackson `@JsonTypeInfo`): `NotStarted`, `Started`, `Completed`,
  `Failed(ErrorInfo)`, `BlockedForMI extends Failed` (also carries `List<RecoveryIssue>`).
- `StageResult.status: StageStatus` → `state: StageState`. `StageStatus` enum removed.
- `StageRun` simplifies: single non-null `StageResult`, initialised with `NOT_STARTED`.
- `ErrorInfo.changeId: String` → `changeIds: List<String>`. `fromThrowable` signature updated.
- `BlockedForMI` synthesises its own `ErrorInfo` (type `MANUAL_INTERVENTION_REQUIRED`,
  `changeIds` populated). No more null-changeId leaking out.
- Runner's MI catch drops the redundant `markPipelineFailed(miEx)`; BlockedForMI stages
  carry their own error info. `findStageForChange` throws `IllegalStateException` on an
  unmappable changeId (deterministic contract).
- `RecoveryIssue` gets `@JsonCreator` so BlockedForMI round-trips through Jackson.
- NOT_STARTED stages now appear in `response.stages`.

Wire format: `StageResult.state` is polymorphic (`{"type":"FAILED","errorInfo":{...}}`).
`ErrorInfo.changeId` renamed to `changeIds` (array).
@dieppa dieppa merged commit a67ed68 into master May 13, 2026
4 checks passed
@dieppa dieppa deleted the refactor/pipeline_manualintervention_aggregation branch May 13, 2026 11:47
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.

1 participant