story-kit: merge 287_story_rename_upcoming_pipeline_stage_to_backlog
This commit is contained in:
@@ -79,7 +79,7 @@ enum WsResponse {
|
||||
},
|
||||
/// Full pipeline state pushed on connect and after every work-item watcher event.
|
||||
PipelineState {
|
||||
upcoming: Vec<crate::http::workflow::UpcomingStory>,
|
||||
backlog: Vec<crate::http::workflow::UpcomingStory>,
|
||||
current: Vec<crate::http::workflow::UpcomingStory>,
|
||||
qa: Vec<crate::http::workflow::UpcomingStory>,
|
||||
merge: Vec<crate::http::workflow::UpcomingStory>,
|
||||
@@ -160,7 +160,7 @@ impl From<WatcherEvent> for Option<WsResponse> {
|
||||
impl From<PipelineState> for WsResponse {
|
||||
fn from(s: PipelineState) -> Self {
|
||||
WsResponse::PipelineState {
|
||||
upcoming: s.upcoming,
|
||||
backlog: s.backlog,
|
||||
current: s.current,
|
||||
qa: s.qa,
|
||||
merge: s.merge,
|
||||
@@ -695,7 +695,7 @@ mod tests {
|
||||
agent: None,
|
||||
};
|
||||
let resp = WsResponse::PipelineState {
|
||||
upcoming: vec![story],
|
||||
backlog: vec![story],
|
||||
current: vec![],
|
||||
qa: vec![],
|
||||
merge: vec![],
|
||||
@@ -703,8 +703,8 @@ mod tests {
|
||||
};
|
||||
let json = serde_json::to_value(&resp).unwrap();
|
||||
assert_eq!(json["type"], "pipeline_state");
|
||||
assert_eq!(json["upcoming"].as_array().unwrap().len(), 1);
|
||||
assert_eq!(json["upcoming"][0]["story_id"], "10_story_test");
|
||||
assert_eq!(json["backlog"].as_array().unwrap().len(), 1);
|
||||
assert_eq!(json["backlog"][0]["story_id"], "10_story_test");
|
||||
assert!(json["current"].as_array().unwrap().is_empty());
|
||||
assert!(json["done"].as_array().unwrap().is_empty());
|
||||
}
|
||||
@@ -824,7 +824,7 @@ mod tests {
|
||||
#[test]
|
||||
fn pipeline_state_converts_to_ws_response() {
|
||||
let state = PipelineState {
|
||||
upcoming: vec![UpcomingStory {
|
||||
backlog: vec![UpcomingStory {
|
||||
story_id: "1_story_a".to_string(),
|
||||
name: Some("Story A".to_string()),
|
||||
error: None,
|
||||
@@ -851,8 +851,8 @@ mod tests {
|
||||
let resp: WsResponse = state.into();
|
||||
let json = serde_json::to_value(&resp).unwrap();
|
||||
assert_eq!(json["type"], "pipeline_state");
|
||||
assert_eq!(json["upcoming"].as_array().unwrap().len(), 1);
|
||||
assert_eq!(json["upcoming"][0]["story_id"], "1_story_a");
|
||||
assert_eq!(json["backlog"].as_array().unwrap().len(), 1);
|
||||
assert_eq!(json["backlog"][0]["story_id"], "1_story_a");
|
||||
assert_eq!(json["current"].as_array().unwrap().len(), 1);
|
||||
assert_eq!(json["current"][0]["story_id"], "2_story_b");
|
||||
assert!(json["qa"].as_array().unwrap().is_empty());
|
||||
@@ -864,7 +864,7 @@ mod tests {
|
||||
#[test]
|
||||
fn empty_pipeline_state_converts_to_ws_response() {
|
||||
let state = PipelineState {
|
||||
upcoming: vec![],
|
||||
backlog: vec![],
|
||||
current: vec![],
|
||||
qa: vec![],
|
||||
merge: vec![],
|
||||
@@ -873,7 +873,7 @@ mod tests {
|
||||
let resp: WsResponse = state.into();
|
||||
let json = serde_json::to_value(&resp).unwrap();
|
||||
assert_eq!(json["type"], "pipeline_state");
|
||||
assert!(json["upcoming"].as_array().unwrap().is_empty());
|
||||
assert!(json["backlog"].as_array().unwrap().is_empty());
|
||||
assert!(json["current"].as_array().unwrap().is_empty());
|
||||
assert!(json["qa"].as_array().unwrap().is_empty());
|
||||
assert!(json["merge"].as_array().unwrap().is_empty());
|
||||
@@ -991,7 +991,7 @@ mod tests {
|
||||
#[test]
|
||||
fn pipeline_state_with_agent_converts_correctly() {
|
||||
let state = PipelineState {
|
||||
upcoming: vec![],
|
||||
backlog: vec![],
|
||||
current: vec![UpcomingStory {
|
||||
story_id: "10_story_x".to_string(),
|
||||
name: Some("Story X".to_string()),
|
||||
@@ -1046,7 +1046,7 @@ mod tests {
|
||||
let root = tmp.path().to_path_buf();
|
||||
|
||||
// Create minimal pipeline dirs so load_pipeline_state succeeds.
|
||||
for stage in &["1_upcoming", "2_current", "3_qa", "4_merge"] {
|
||||
for stage in &["1_backlog", "2_current", "3_qa", "4_merge"] {
|
||||
std::fs::create_dir_all(root.join(".story_kit").join("work").join(stage)).unwrap();
|
||||
}
|
||||
|
||||
@@ -1155,7 +1155,7 @@ mod tests {
|
||||
|
||||
assert_eq!(initial["type"], "pipeline_state");
|
||||
// All stages should be empty arrays since no .md files were created.
|
||||
assert!(initial["upcoming"].as_array().unwrap().is_empty());
|
||||
assert!(initial["backlog"].as_array().unwrap().is_empty());
|
||||
assert!(initial["current"].as_array().unwrap().is_empty());
|
||||
assert!(initial["qa"].as_array().unwrap().is_empty());
|
||||
assert!(initial["merge"].as_array().unwrap().is_empty());
|
||||
|
||||
Reference in New Issue
Block a user