Skip to content

Commit

Permalink
limit to > P3 priority
Browse files Browse the repository at this point in the history
  • Loading branch information
after-ephemera committed Sep 9, 2024
1 parent 21100cf commit 698b938
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion crates/suiop-cli/src/cli/incidents/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,18 @@ pub async fn incidents_cmd(args: &IncidentsArgs) -> Result<()> {

let incidents = fetch_incidents(*limit, start_time, current_time).await?;
if *interactive {
println!("{:?} incidents found", incidents);
review_recent_incidents(
incidents
.into_iter()
.filter(|i| i.priority.is_some() || i.slack_channel.is_some())
// filter on priority > P3 and any slack channel association
.filter(|i| {
i.priority
.clone()
.filter(|p| !p.name.is_empty() && p.name != "P3")
.is_some()
|| i.slack_channel.is_some()
})
.collect::<Vec<_>>(),
)
.await?
Expand Down
2 changes: 1 addition & 1 deletion crates/suiop-cli/src/cli/incidents/pd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::DEBUG_MODE;

#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct Priority {
name: String,
pub name: String,
id: String,
color: String,
}
Expand Down

0 comments on commit 698b938

Please sign in to comment.