@@ -110,6 +110,7 @@ fn evaluate_nags() -> DashResult<()> {
110
110
let pending_proposals = fcp_proposal. filter ( fcp_start. is_null ( ) ) . load :: < FcpProposal > ( conn) ?;
111
111
112
112
for mut proposal in pending_proposals {
113
+ let initiator = githubuser:: table. find ( proposal. fk_initiator ) . first :: < GitHubUser > ( conn) ?;
113
114
let issue = issue:: table. find ( proposal. fk_issue ) . first :: < Issue > ( conn) ?;
114
115
115
116
// check to see if any checkboxes were modified before we end up replacing the comment
@@ -125,6 +126,7 @@ fn evaluate_nags() -> DashResult<()> {
125
126
126
127
// update existing status comment with reviews & concerns
127
128
let status_comment = RfcBotComment :: new ( & issue, CommentType :: FcpProposed (
129
+ & initiator,
128
130
FcpDisposition :: from_str ( & proposal. disposition ) ?,
129
131
& reviews,
130
132
& concerns) ) ;
@@ -136,6 +138,8 @@ fn evaluate_nags() -> DashResult<()> {
136
138
proposal. fcp_start = Some ( UTC :: now ( ) . naive_utc ( ) ) ;
137
139
diesel:: update ( fcp_proposal. find ( proposal. id ) ) . set ( & proposal) . execute ( conn) ?;
138
140
141
+ // TODO attempt to add the final-comment-period label
142
+
139
143
// leave a comment for FCP start
140
144
let fcp_start_comment = RfcBotComment :: new ( & issue,
141
145
CommentType :: FcpAllReviewedNoConcerns ) ;
@@ -322,8 +326,8 @@ impl<'a> RfcBotCommand<'a> {
322
326
info ! ( "proposal is a new FCP, creating..." ) ;
323
327
324
328
// leave github comment stating that FCP is proposed, ping reviewers
325
- let gh_comment = RfcBotComment :: new ( issue ,
326
- CommentType :: FcpProposed ( disp, & [ ] , & [ ] ) ) ;
329
+ let gh_comment =
330
+ RfcBotComment :: new ( issue , CommentType :: FcpProposed ( author , disp, & [ ] , & [ ] ) ) ;
327
331
328
332
let gh_comment = gh_comment. post ( None ) ?;
329
333
info ! ( "Posted base comment to github, no reviewers listed yet" ) ;
@@ -352,10 +356,11 @@ impl<'a> RfcBotCommand<'a> {
352
356
353
357
let review_requests = issue_subteam_members. iter ( )
354
358
. map ( |member| {
359
+ // let's assume the initiator has reviewed it
355
360
NewFcpReviewRequest {
356
361
fk_proposal : proposal. id ,
357
362
fk_reviewer : member. id ,
358
- reviewed : false ,
363
+ reviewed : if member . id == author . id { true } else { false } ,
359
364
}
360
365
} )
361
366
. collect :: < Vec < _ > > ( ) ;
@@ -373,7 +378,10 @@ impl<'a> RfcBotCommand<'a> {
373
378
374
379
let new_gh_comment =
375
380
RfcBotComment :: new ( issue,
376
- CommentType :: FcpProposed ( disp, & review_requests, & [ ] ) ) ;
381
+ CommentType :: FcpProposed ( author,
382
+ disp,
383
+ & review_requests,
384
+ & [ ] ) ) ;
377
385
378
386
new_gh_comment. post ( Some ( gh_comment. id ) ) ?;
379
387
@@ -525,7 +533,7 @@ impl<'a> RfcBotCommand<'a> {
525
533
let invocation = tokens. next ( ) . ok_or ( DashError :: Misc ) ?;
526
534
527
535
match invocation {
528
- "fcp" => {
536
+ "fcp" | "pr" => {
529
537
let subcommand = tokens. next ( ) . ok_or ( DashError :: Misc ) ?;
530
538
531
539
debug ! ( "Parsed command as new FCP proposal" ) ;
@@ -581,7 +589,8 @@ struct RfcBotComment<'a> {
581
589
}
582
590
583
591
enum CommentType < ' a > {
584
- FcpProposed ( FcpDisposition ,
592
+ FcpProposed ( & ' a GitHubUser ,
593
+ FcpDisposition ,
585
594
& ' a [ ( GitHubUser , FcpReviewRequest ) ] ,
586
595
& ' a [ ( GitHubUser , FcpConcern ) ] ) ,
587
596
FcpProposalCancelled ( & ' a GitHubUser ) ,
@@ -602,10 +611,13 @@ impl<'a> RfcBotComment<'a> {
602
611
fn format ( & self ) -> DashResult < String > {
603
612
604
613
match self . comment_type {
605
- CommentType :: FcpProposed ( disposition, reviewers, concerns) => {
606
- let mut msg = String :: from ( "FCP proposed with disposition to " ) ;
614
+ CommentType :: FcpProposed ( initiator, disposition, reviewers, concerns) => {
615
+ let mut msg = String :: from ( "Team member " ) ;
616
+ msg. push_str ( & initiator. login ) ;
617
+ msg. push_str ( " has proposed to " ) ;
607
618
msg. push_str ( disposition. repr ( ) ) ;
608
- msg. push_str ( ". Review requested from:\n \n " ) ;
619
+ msg. push_str ( " this. The next step is review by the rest of the tagged " ) ;
620
+ msg. push_str ( "teams:\n \n " ) ;
609
621
610
622
for & ( ref member, ref review_request) in reviewers {
611
623
@@ -643,19 +655,24 @@ impl<'a> RfcBotComment<'a> {
643
655
}
644
656
}
645
657
658
+ msg. push_str ( "\n Once these reviewers reach consensus, this will enter its final " ) ;
659
+ msg. push_str ( "comment period. If you spot a major issue that hasn't been raised " ) ;
660
+ msg. push_str ( "at any point in this process, please speak up!\n " ) ;
661
+
646
662
msg. push_str ( "\n See [this document](" ) ;
647
663
msg. push_str ( "https://github.com/dikaiosune/rust-dashboard/blob/master/RFCBOT.md" ) ;
648
664
msg. push_str ( ") for info about what commands tagged team members can give me." ) ;
649
665
650
666
Ok ( msg)
651
667
}
652
668
CommentType :: FcpProposalCancelled ( initiator) => {
653
- Ok ( format ! ( "@{} FCP proposal cancelled." , initiator. login) )
669
+ Ok ( format ! ( "@{} proposal cancelled." , initiator. login) )
654
670
}
655
671
CommentType :: FcpAllReviewedNoConcerns => {
656
672
Ok ( "All relevant subteam members have reviewed. No concerns remain." . to_string ( ) )
657
673
}
658
674
CommentType :: FcpWeekPassed => {
675
+ // TODO add ping to original proposal author
659
676
Ok ( "It has been one week since all blocks to the FCP were resolved." . to_string ( ) )
660
677
}
661
678
}
0 commit comments