@@ -419,6 +419,9 @@ pub(crate) struct MajorChangeConfig {
419419 pub ( crate ) zulip_stream : u64 ,
420420 /// Extra text in the opening major change.
421421 pub ( crate ) open_extra_text : Option < String > ,
422+ /// Template for a tracking issue to be created when the major change is accepted
423+ #[ serde( rename = "tracking-issue-template" ) ]
424+ pub ( crate ) tracking_issue_template : Option < MajorChangeTrackingIssueTemplateConfig > ,
422425}
423426
424427impl MajorChangeConfig {
@@ -433,6 +436,20 @@ impl MajorChangeConfig {
433436 }
434437}
435438
439+ #[ derive( PartialEq , Eq , Debug , serde:: Deserialize ) ]
440+ #[ serde( rename_all = "kebab-case" ) ]
441+ #[ serde( deny_unknown_fields) ]
442+ pub ( crate ) struct MajorChangeTrackingIssueTemplateConfig {
443+ /// Template for the title
444+ pub ( crate ) title : String ,
445+ /// Repository where to create the tracking issue (otherwise the current repository)
446+ pub ( crate ) repository : Option < String > ,
447+ /// List of labels to add to the issue
448+ pub ( crate ) labels : Vec < String > ,
449+ /// Template of the body
450+ pub ( crate ) body : String ,
451+ }
452+
436453#[ derive( PartialEq , Eq , Debug , serde:: Deserialize ) ]
437454#[ serde( deny_unknown_fields) ]
438455pub ( crate ) struct CloseConfig { }
@@ -1030,4 +1047,50 @@ mod tests {
10301047 } )
10311048 ) ) ;
10321049 }
1050+
1051+ #[ test]
1052+ fn major_change ( ) {
1053+ let config = r#"
1054+ [major-change]
1055+ enabling_label = "major-change"
1056+ meeting_label = "to-announce"
1057+ second_label = "final-comment-period"
1058+ concerns_label = "has-concerns"
1059+ accept_label = "major-change-accepted"
1060+ waiting_period = 1
1061+ auto_closing = true
1062+ zulip_stream = 224082
1063+ zulip_ping = "Urgau"
1064+
1065+ [major-change.tracking-issue-template]
1066+ repository = "triagebot"
1067+ title = "Tracking issue for MCP#${mcp_number}"
1068+ body = """
1069+ Multi text body with ${mcp_issue} and ${mcp_title}
1070+ """
1071+ labels = ["C-tracking-issue", "T-compiler"]
1072+ "# ;
1073+ let config = toml:: from_str :: < Config > ( & config) . unwrap ( ) ;
1074+ assert_eq ! (
1075+ config. major_change,
1076+ Some ( MajorChangeConfig {
1077+ zulip_ping: "Urgau" . to_string( ) ,
1078+ enabling_label: "major-change" . to_string( ) ,
1079+ second_label: "final-comment-period" . to_string( ) ,
1080+ accept_label: "major-change-accepted" . to_string( ) ,
1081+ meeting_label: "to-announce" . to_string( ) ,
1082+ concerns_label: Some ( "has-concerns" . to_string( ) ) ,
1083+ waiting_period: 1 ,
1084+ auto_closing: true ,
1085+ zulip_stream: 224082 ,
1086+ open_extra_text: None ,
1087+ tracking_issue_template: Some ( MajorChangeTrackingIssueTemplateConfig {
1088+ title: "Tracking issue for MCP#${mcp_number}" . to_string( ) ,
1089+ repository: Some ( "triagebot" . to_string( ) ) ,
1090+ body: "Multi text body with ${mcp_issue} and ${mcp_title}\n " . to_string( ) ,
1091+ labels: vec![ "C-tracking-issue" . to_string( ) , "T-compiler" . to_string( ) ] ,
1092+ } )
1093+ } )
1094+ ) ;
1095+ }
10331096}
0 commit comments