huskies: merge 986
This commit is contained in:
@@ -443,11 +443,18 @@ fn project_stage_for_view(
|
||||
commits_ahead: NonZeroU32::new(1).expect("1 is non-zero"),
|
||||
}),
|
||||
"merge_failure" => {
|
||||
// Reconstruct the typed kind from ContentKey::GateOutput so the
|
||||
// auto-assigner can match on the variant after a server restart.
|
||||
// This is the sole persistence backing for MergeFailureKind.
|
||||
let kind = crate::db::read_content(crate::db::ContentKey::GateOutput(story_id))
|
||||
.map(|s| crate::pipeline_state::MergeFailureKind::infer_from_gate_output(&s))
|
||||
// Story 986: read the typed kind directly from ContentKey::MergeFailureKind
|
||||
// (written since 986) so no substring-scanning is needed.
|
||||
// Fall back to infer_from_gate_output for data persisted pre-986.
|
||||
let kind = crate::db::read_content(crate::db::ContentKey::MergeFailureKind(story_id))
|
||||
.and_then(|s| {
|
||||
serde_json::from_str::<crate::pipeline_state::MergeFailureKind>(&s).ok()
|
||||
})
|
||||
.or_else(|| {
|
||||
crate::db::read_content(crate::db::ContentKey::GateOutput(story_id)).map(|s| {
|
||||
crate::pipeline_state::MergeFailureKind::infer_from_gate_output(&s)
|
||||
})
|
||||
})
|
||||
.unwrap_or(crate::pipeline_state::MergeFailureKind::Other(String::new()));
|
||||
Some(Stage::MergeFailure {
|
||||
kind,
|
||||
|
||||
Reference in New Issue
Block a user