@@ -29,6 +29,7 @@ pub struct ExistingGithubComment {
29
29
pub body : String ,
30
30
pub created_at : String ,
31
31
pub url : String ,
32
+ hidden : bool ,
32
33
}
33
34
34
35
#[ derive( Debug , Serialize , Deserialize , PartialEq , Eq , PartialOrd , Ord ) ]
@@ -56,6 +57,9 @@ struct ExistingGithubCommentJson {
56
57
#[ serde( rename = "createdAt" ) ]
57
58
created_at : String ,
58
59
url : String ,
60
+ /// Whether a comment was marked "hidden" on the GH UI.
61
+ #[ serde( rename = "isMinimized" ) ]
62
+ is_minimized : bool ,
59
63
}
60
64
61
65
#[ derive( Debug , Serialize , Deserialize , PartialEq , Eq , PartialOrd , Ord ) ]
@@ -471,8 +475,17 @@ pub fn lock_issue(repository: &Repository, number: u64) -> Result<()> {
471
475
}
472
476
473
477
impl 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
+
474
487
/// 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 {
476
489
let trimmed_body = self . body . trim ( ) ;
477
490
trimmed_body == LOCK_TEXT || trimmed_body. starts_with ( CONTINUING_GOAL_PREFIX )
478
491
}
@@ -497,6 +510,7 @@ impl From<ExistingGithubIssueJson> for ExistingGithubIssue {
497
510
body : c. body ,
498
511
url : c. url ,
499
512
created_at : c. created_at ,
513
+ hidden : c. is_minimized ,
500
514
} )
501
515
. collect ( ) ,
502
516
body : e_i. body ,
0 commit comments