@@ -13,6 +13,7 @@ use rust_project_goals::format_champions::format_champions;
1313use rust_project_goals:: format_team_ask:: format_team_asks;
1414use rust_project_goals:: markdown_processor:: { MarkdownProcessor , MarkdownProcessorState } ;
1515use rust_project_goals:: util;
16+ use rust_project_goals_cli:: Order ;
1617
1718use rust_project_goals:: spanned:: Spanned ;
1819use rust_project_goals:: {
@@ -611,7 +612,7 @@ impl<'c> GoalPreprocessorWithContext<'c> {
611612 let team_virtual_path = format ! ( "{}/index.md" , team_name_str) ;
612613 let team_path = Path :: new ( & team_virtual_path) ;
613614
614- let team_content = format ! ( "# {} Team Champion Reports\n \n This section contains monthly champion reports for the {} team." , team_name_str, team_name_str) ;
615+ let team_content = format ! ( "# {} Team Champion Reports\n \n This section contains champion reports for the {} team." , team_name_str, team_name_str) ;
615616 let mut team_chapter = Chapter :: new (
616617 & team_chapter_name,
617618 team_content,
@@ -627,36 +628,34 @@ impl<'c> GoalPreprocessorWithContext<'c> {
627628
628629 let mut team_parent_names = parent_names. clone ( ) ;
629630 team_parent_names. push ( team_chapter_name. clone ( ) ) ;
630- let mut team_sub_index = 1 ;
631-
632- // Generate monthly reports for this team
633- for ( year, month, month_name) in months. iter ( ) . rev ( ) {
634- // Reverse to show newest first
635- let champion_content =
636- self . generate_champion_report_content ( milestone, team_name_str, * year, * month) ?;
637-
638- let monthly_chapter_name = format ! ( "{} {}" , month_name, year) ;
639- let monthly_virtual_path = format ! ( "{}/{:04}-{:02}.md" , team_name_str, year, month) ;
640- let monthly_path = Path :: new ( & monthly_virtual_path) ;
641-
642- let mut monthly_chapter = Chapter :: new (
643- & monthly_chapter_name,
644- champion_content,
645- monthly_path,
646- team_parent_names. clone ( ) ,
647- ) ;
648-
649- if let Some ( mut number) = team_chapter. number . clone ( ) {
650- number. 0 . push ( team_sub_index) ;
651- monthly_chapter. number = Some ( number) ;
652- team_sub_index += 1 ;
653- }
631+ let team_sub_index = 1 ;
632+
633+ // Generate the "recent updates" report for this team
634+
635+ // Reverse to show newest first
636+ let champion_content =
637+ self . generate_champion_report_content ( milestone, team_name_str) ?;
638+
639+ let report_name = format ! ( "Recent updates" ) ;
640+ let report_virtual_path = format ! ( "{team_name_str}/recent-updates.md" ) ;
641+ let report_path = Path :: new ( & report_virtual_path) ;
642+
643+ let mut report_chapter = Chapter :: new (
644+ & report_name,
645+ champion_content,
646+ report_path,
647+ team_parent_names. clone ( ) ,
648+ ) ;
654649
655- team_chapter
656- . sub_items
657- . push ( BookItem :: Chapter ( monthly_chapter ) ) ;
650+ if let Some ( mut number ) = team_chapter. number . clone ( ) {
651+ number . 0 . push ( team_sub_index ) ;
652+ report_chapter . number = Some ( number ) ;
658653 }
659654
655+ team_chapter
656+ . sub_items
657+ . push ( BookItem :: Chapter ( report_chapter) ) ;
658+
660659 parent_chapter
661660 . sub_items
662661 . push ( BookItem :: Chapter ( team_chapter) ) ;
@@ -704,6 +703,7 @@ impl<'c> GoalPreprocessorWithContext<'c> {
704703 & Some ( end_date) ,
705704 None ,
706705 false ,
706+ Order :: OldestFirst ,
707707 )
708708 . map_err ( |e| anyhow:: anyhow!( "Failed to generate blog post content: {}" , e) ) ?;
709709
@@ -714,26 +714,16 @@ impl<'c> GoalPreprocessorWithContext<'c> {
714714 & mut self ,
715715 milestone : & str ,
716716 team_name : & str ,
717- year : i32 ,
718- month : u32 ,
719717 ) -> anyhow:: Result < String > {
720- use chrono:: NaiveDate ;
718+ // Look at the updates for the last ~three months
719+ let end_date = chrono:: Utc :: now ( ) . date_naive ( ) ;
720+ let start_date = end_date - chrono:: TimeDelta :: days ( 90 ) ;
721721
722722 eprintln ! (
723- "👥 Generating champion report for {} team, {}-{:02 } (milestone: {})" ,
724- team_name, year , month , milestone
723+ "👥 Generating champion report for {} team, {start_date} - {end_date } (milestone: {})" ,
724+ team_name, milestone
725725 ) ;
726726
727- // Calculate start and end dates for the month
728- let start_date = NaiveDate :: from_ymd_opt ( year, month, 1 )
729- . ok_or_else ( || anyhow:: anyhow!( "Invalid date: {}-{:02}-01" , year, month) ) ?;
730- let end_date = if month == 12 {
731- NaiveDate :: from_ymd_opt ( year + 1 , 1 , 1 )
732- } else {
733- NaiveDate :: from_ymd_opt ( year, month + 1 , 1 )
734- }
735- . ok_or_else ( || anyhow:: anyhow!( "Invalid end date calculation for {}-{:02}" , year, month) ) ?;
736-
737727 // Get repository from context - assuming rust-lang/rust-project-goals as default
738728 let repository =
739729 rust_project_goals:: gh:: issue_id:: Repository :: new ( "rust-lang" , "rust-project-goals" ) ;
@@ -750,6 +740,7 @@ impl<'c> GoalPreprocessorWithContext<'c> {
750740 & Some ( end_date) ,
751741 Some ( team_name) ,
752742 false ,
743+ Order :: NewestFirst ,
753744 )
754745 . map_err ( |e| anyhow:: anyhow!( "Failed to generate champion report content: {}" , e) ) ?;
755746
0 commit comments