From 9b18930487e1f23b0276ab3997df99875f2be9a2 Mon Sep 17 00:00:00 2001 From: Without Boats Date: Wed, 21 Jun 2017 16:45:02 -0700 Subject: [PATCH 1/4] Add 'entering-final-coment-period' label. --- src/github/nag.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/github/nag.rs b/src/github/nag.rs index 1513b5c7..a3e53786 100644 --- a/src/github/nag.rs +++ b/src/github/nag.rs @@ -901,12 +901,18 @@ impl<'a> RfcBotComment<'a> { if CONFIG.post_comments { if self.issue.open { - Ok(match existing_comment { + match existing_comment { Some(comment_id) => { GH.edit_comment(&self.issue.repository, comment_id, &self.body) } - None => GH.new_comment(&self.issue.repository, self.issue.number, &self.body), - }?) + None => { + if let CommentType::FcpProposed(..) = self.comment_type { + GH.add_label(&self.issue.repository, self.issue.number, + "entering-final-comment-period")?; + } + GH.new_comment(&self.issue.repository, self.issue.number, &self.body) + } + } } else { info!("Skipping comment to {}#{}, the issue is no longer open", self.issue.repository, From 1f25ed320527e1c5495720b7463e5316202d6a86 Mon Sep 17 00:00:00 2001 From: Without Boats Date: Wed, 21 Jun 2017 20:56:07 -0700 Subject: [PATCH 2/4] Add comment type to RfcBotComment --- src/github/nag.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/github/nag.rs b/src/github/nag.rs index a3e53786..25875b3a 100644 --- a/src/github/nag.rs +++ b/src/github/nag.rs @@ -776,6 +776,7 @@ impl<'a> RfcBotCommand<'a> { struct RfcBotComment<'a> { issue: &'a Issue, body: String, + comment_type: &'a CommentType<'a>, } enum CommentType<'a> { @@ -800,6 +801,7 @@ impl<'a> RfcBotComment<'a> { RfcBotComment { issue: issue, body: body, + comment_type: comment_type, } } From 1d56584559b04734b169141c4f0fbdec28ee5000 Mon Sep 17 00:00:00 2001 From: Without Boats Date: Thu, 22 Jun 2017 11:24:32 -0700 Subject: [PATCH 3/4] Type error. --- src/github/nag.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/github/nag.rs b/src/github/nag.rs index 25875b3a..2cfa24fd 100644 --- a/src/github/nag.rs +++ b/src/github/nag.rs @@ -908,9 +908,9 @@ impl<'a> RfcBotComment<'a> { GH.edit_comment(&self.issue.repository, comment_id, &self.body) } None => { - if let CommentType::FcpProposed(..) = self.comment_type { - GH.add_label(&self.issue.repository, self.issue.number, - "entering-final-comment-period")?; + if let &CommentType::FcpProposed(..) = self.comment_type { + let _ = GH.add_label(&self.issue.repository, self.issue.number, + "proposed-final-comment-period"); } GH.new_comment(&self.issue.repository, self.issue.number, &self.body) } From 1c44b9ad4615aa24bbe6fd10c907179fd0508076 Mon Sep 17 00:00:00 2001 From: Without Boats Date: Thu, 22 Jun 2017 17:38:45 -0700 Subject: [PATCH 4/4] Fix ref business. --- src/github/nag.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/github/nag.rs b/src/github/nag.rs index 2cfa24fd..85d0143d 100644 --- a/src/github/nag.rs +++ b/src/github/nag.rs @@ -776,7 +776,7 @@ impl<'a> RfcBotCommand<'a> { struct RfcBotComment<'a> { issue: &'a Issue, body: String, - comment_type: &'a CommentType<'a>, + comment_type: CommentType<'a>, } enum CommentType<'a> { @@ -908,7 +908,7 @@ impl<'a> RfcBotComment<'a> { GH.edit_comment(&self.issue.repository, comment_id, &self.body) } None => { - if let &CommentType::FcpProposed(..) = self.comment_type { + if let CommentType::FcpProposed(..) = self.comment_type { let _ = GH.add_label(&self.issue.repository, self.issue.number, "proposed-final-comment-period"); }