@@ -29,6 +29,7 @@ pub struct ExistingGithubComment {
2929 pub body : String ,
3030 pub created_at : String ,
3131 pub url : String ,
32+ hidden : bool ,
3233}
3334
3435#[ derive( Debug , Serialize , Deserialize , PartialEq , Eq , PartialOrd , Ord ) ]
@@ -56,6 +57,9 @@ struct ExistingGithubCommentJson {
5657 #[ serde( rename = "createdAt" ) ]
5758 created_at : String ,
5859 url : String ,
60+ /// Whether a comment was marked "hidden" on the GH UI.
61+ #[ serde( rename = "isMinimized" ) ]
62+ is_minimized : bool ,
5963}
6064
6165#[ derive( Debug , Serialize , Deserialize , PartialEq , Eq , PartialOrd , Ord ) ]
@@ -471,8 +475,17 @@ pub fn lock_issue(repository: &Repository, number: u64) -> Result<()> {
471475}
472476
473477impl ExistingGithubComment {
478+ /// Some comments are not actually updates we want to use in progress reports. For example,
479+ /// automated comments when rotating goal periods, or random comments on the tracking issues.
480+ /// The former are kinda possible to detect (this tool generates them in the first place) and to
481+ /// support filtering out the other cases, we'll just ignore comments that were marked as hidden
482+ /// on github.
483+ pub fn should_hide_from_reports ( & self ) -> bool {
484+ self . is_automated_comment ( ) || self . hidden
485+ }
486+
474487 /// True if this is one of the special comments that we put on issues.
475- pub fn is_automated_comment ( & self ) -> bool {
488+ fn is_automated_comment ( & self ) -> bool {
476489 let trimmed_body = self . body . trim ( ) ;
477490 trimmed_body == LOCK_TEXT || trimmed_body. starts_with ( CONTINUING_GOAL_PREFIX )
478491 }
@@ -497,6 +510,7 @@ impl From<ExistingGithubIssueJson> for ExistingGithubIssue {
497510 body : c. body ,
498511 url : c. url ,
499512 created_at : c. created_at ,
513+ hidden : c. is_minimized ,
500514 } )
501515 . collect ( ) ,
502516 body : e_i. body ,
0 commit comments