whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: ignore reporter drafts produced before the previous board meeting
Date Sun, 25 Aug 2019 20:19:36 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new eaebf37  ignore reporter drafts produced before the previous board meeting
eaebf37 is described below

commit eaebf37dabac2345efa4a3f424f950e6d9389e3e
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sun Aug 25 16:18:55 2019 -0400

    ignore reporter drafts produced before the previous board meeting
    
    Also, chronic (no longer?) appears to support "this month"
---
 lib/whimsy/asf/board.rb             | 22 +++++++++++++++++++++-
 www/board/agenda/models/reporter.rb |  2 ++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/lib/whimsy/asf/board.rb b/lib/whimsy/asf/board.rb
index 8e6d760..83ce573 100644
--- a/lib/whimsy/asf/board.rb
+++ b/lib/whimsy/asf/board.rb
@@ -27,8 +27,9 @@ module ASF
 
       if not time
         require 'chronic'
+        this_month = Time.now.strftime('%B')
 
-        time ||= Chronic.parse('3rd wednesday this month')
+        time ||= Chronic.parse("3rd wednesday in #{this_month}")
 
         if not time or time < Time.now.utc
           time = Chronic.parse('3rd wednesday next month')
@@ -38,6 +39,25 @@ module ASF
       time
     end
 
+    # time of previous meeting
+    def self.lastMeeting
+      next_meeting = self.nextMeeting
+      time = self.calendar.select {|time| time < next_meeting}.max
+
+      if not time
+        require 'chronic'
+        this_month = Time.now.strftime('%B')
+
+        time ||= Chronic.parse("3rd wednesday in #{this_month}")
+
+        if not time or time > Time.now.utc
+          time = Chronic.parse('3rd wednesday last month')
+        end
+      end
+
+      time
+    end
+
     # list of PMCs reporting in the specified meeting
     def self.reporting(meeting)
       month = meeting.strftime('%B')
diff --git a/www/board/agenda/models/reporter.rb b/www/board/agenda/models/reporter.rb
index 66e777b..b2af4ee 100644
--- a/www/board/agenda/models/reporter.rb
+++ b/www/board/agenda/models/reporter.rb
@@ -58,9 +58,11 @@ class Reporter
     end
 
     # extract projects with drafts for this agenda
+    lastMeeting = ASF::Board.lastMeeting.to_i
     drafts = report_status.select do |project, status| 
       next false unless status['agenda'] == agenda_file
       last_draft = status['last_draft']
+      next false if last_draft and status['draft_timestamp'] <= lastMeeting
       last_draft and not last_draft.empty?
     end
 


Mime
View raw message