@@ -458,30 +458,33 @@ fn evaluate_nags() -> DashResult<()> {
458
458
}
459
459
} ;
460
460
461
- // Execute FFCP actions:
462
- if is_rfc_repo ( & issue) {
463
- match disp {
464
- FcpDisposition :: Merge => {
465
- // TODO: This one will require a lot of work to
466
- // auto-merge RFCs and create the tracking issue.
467
- } ,
468
- FcpDisposition :: Close => {
469
- let _ = issue. add_label ( Label :: Closed ) ;
470
- issue. remove_label ( Label :: DispositionClose ) ;
471
- issue. close ( ) ;
472
- } ,
473
- FcpDisposition :: Postpone => {
474
- let _ = issue. add_label ( Label :: Postponed ) ;
475
- issue. remove_label ( Label :: DispositionPostpone ) ;
476
- issue. close ( ) ;
477
- } ,
478
- }
479
- }
461
+ execute_ffcp_actions ( & issue, disp) ;
480
462
}
481
463
482
464
Ok ( ( ) )
483
465
}
484
466
467
+ fn execute_ffcp_actions ( issue : & Issue , disposition : FcpDisposition ) {
468
+ if !is_rfc_repo ( & issue) { return ; }
469
+
470
+ match disposition {
471
+ FcpDisposition :: Merge => {
472
+ // TODO: This one will require a lot of work to
473
+ // auto-merge RFCs and create the tracking issue.
474
+ } ,
475
+ FcpDisposition :: Close => {
476
+ let _ = issue. add_label ( Label :: Closed ) ;
477
+ issue. remove_label ( Label :: DispositionClose ) ;
478
+ issue. close ( ) ;
479
+ } ,
480
+ FcpDisposition :: Postpone => {
481
+ let _ = issue. add_label ( Label :: Postponed ) ;
482
+ issue. remove_label ( Label :: DispositionPostpone ) ;
483
+ issue. close ( ) ;
484
+ } ,
485
+ }
486
+ }
487
+
485
488
fn list_review_requests ( proposal_id : i32 ) -> DashResult < Vec < ( GitHubUser , FcpReviewRequest ) > > {
486
489
use domain:: schema:: { fcp_review_request, githubuser} ;
487
490
@@ -846,9 +849,10 @@ impl<'a> RfcBotCommand<'a> {
846
849
}
847
850
RfcBotCommand :: NewConcern ( concern_name) => {
848
851
849
- if let Some ( proposal) = existing_proposal {
852
+ if let Some ( mut proposal) = existing_proposal {
850
853
// check for existing concern
851
854
use domain:: schema:: fcp_concern:: dsl:: * ;
855
+ use domain:: schema:: fcp_proposal:: dsl:: * ;
852
856
853
857
let existing_concern = fcp_concern
854
858
. filter ( fk_proposal. eq ( proposal. id ) )
@@ -870,8 +874,26 @@ impl<'a> RfcBotCommand<'a> {
870
874
diesel:: insert ( & new_concern)
871
875
. into ( fcp_concern)
872
876
. execute ( conn) ?;
877
+
878
+ // Take us out of FCP and back into PFCP if need be:
879
+ if proposal. fcp_start . is_some ( ) {
880
+ // Update DB: FCP is not started anymore.
881
+ proposal. fcp_start = None ;
882
+ match diesel:: update ( fcp_proposal. find ( proposal. id ) )
883
+ . set ( & proposal)
884
+ . execute ( conn) {
885
+ Ok ( _) => ( ) ,
886
+ Err ( why) => {
887
+ error ! ( "Unable to mark FCP {} as unstarted: {:?}" , proposal. id, why) ;
888
+ return Ok ( ( ) ) ;
889
+ }
890
+ }
891
+
892
+ // Update labels:
893
+ let _ = issue. add_label ( Label :: PFCP ) ;
894
+ issue. remove_label ( Label :: FCP ) ;
895
+ }
873
896
}
874
-
875
897
}
876
898
}
877
899
RfcBotCommand :: ResolveConcern ( concern_name) => {
0 commit comments