huskies: merge 1009
This commit is contained in:
@@ -122,7 +122,7 @@ pub fn move_story_to_done(story_id: &str) -> Result<(), String> {
|
||||
merge_commit: GitSha("accepted".to_string()),
|
||||
},
|
||||
Stage::MergeFailure { .. } => PipelineEvent::Accepted,
|
||||
Stage::Coding | Stage::Qa | Stage::Backlog => PipelineEvent::Close,
|
||||
Stage::Coding { .. } | Stage::Qa | Stage::Backlog => PipelineEvent::Close,
|
||||
_ => {
|
||||
return Err(format!(
|
||||
"Work item '{story_id}' is in {} — cannot move to done.",
|
||||
@@ -160,7 +160,7 @@ pub fn move_story_to_merge(story_id: &str) -> Result<(), String> {
|
||||
let commits = NonZeroU32::new(1).expect("1 is non-zero");
|
||||
|
||||
let event = match &item.stage {
|
||||
Stage::Coding => PipelineEvent::QaSkipped {
|
||||
Stage::Coding { .. } => PipelineEvent::QaSkipped {
|
||||
feature_branch: branch,
|
||||
commits_ahead: commits,
|
||||
},
|
||||
@@ -383,8 +383,8 @@ fn map_stage_move_to_event(
|
||||
match (from, target) {
|
||||
(Stage::Upcoming, "backlog") => Ok(PipelineEvent::Triage),
|
||||
(Stage::Backlog, "current") => Ok(PipelineEvent::DepsMet),
|
||||
(Stage::Coding, "qa") => Ok(PipelineEvent::GatesStarted),
|
||||
(Stage::Coding, "merge") => Ok(PipelineEvent::QaSkipped {
|
||||
(Stage::Coding { .. }, "qa") => Ok(PipelineEvent::GatesStarted),
|
||||
(Stage::Coding { .. }, "merge") => Ok(PipelineEvent::QaSkipped {
|
||||
feature_branch: branch(),
|
||||
commits_ahead: nz1(),
|
||||
}),
|
||||
@@ -392,7 +392,7 @@ fn map_stage_move_to_event(
|
||||
feature_branch: branch(),
|
||||
commits_ahead: nz1(),
|
||||
}),
|
||||
(Stage::Coding, "backlog")
|
||||
(Stage::Coding { .. }, "backlog")
|
||||
| (Stage::Qa, "backlog")
|
||||
| (Stage::Merge { .. }, "backlog")
|
||||
| (Stage::Blocked { .. }, "backlog") => Ok(PipelineEvent::Demote),
|
||||
@@ -402,7 +402,7 @@ fn map_stage_move_to_event(
|
||||
(Stage::Merge { .. }, "done") => Ok(PipelineEvent::MergeSucceeded {
|
||||
merge_commit: GitSha("manual".to_string()),
|
||||
}),
|
||||
(Stage::Coding | Stage::Qa | Stage::Backlog, "done") => Ok(PipelineEvent::Close),
|
||||
(Stage::Coding { .. } | Stage::Qa | Stage::Backlog, "done") => Ok(PipelineEvent::Close),
|
||||
(Stage::Blocked { .. }, "current") => Ok(PipelineEvent::Unblock),
|
||||
// Story 919: MergeFailure + Unblock goes to Merge (re-attempt); manual
|
||||
// demotion to backlog uses Demote to park it without a retry.
|
||||
@@ -530,7 +530,7 @@ fn stage_to_name(s: &Stage) -> &'static str {
|
||||
match s {
|
||||
Stage::Upcoming => "upcoming",
|
||||
Stage::Backlog => "backlog",
|
||||
Stage::Coding => "current",
|
||||
Stage::Coding { .. } => "current",
|
||||
Stage::Blocked { .. } => "blocked",
|
||||
Stage::Qa => "qa",
|
||||
Stage::Merge { .. } => "merge",
|
||||
@@ -714,7 +714,7 @@ mod tests {
|
||||
"should return to coding after unblock"
|
||||
);
|
||||
assert!(
|
||||
matches!(item.stage, Stage::Coding),
|
||||
matches!(item.stage, Stage::Coding { .. }),
|
||||
"stage should be Stage::Coding after unblock"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user