#153 Add an EOL event to the Schedule
Merged 3 years ago by frantisekz. Opened 3 years ago by frantisekz.

@@ -46,6 +46,7 @@ 

      release = releases["branched"] or releases["rawhide"]

  

      resp = get_resource(app.config["SCHEDULE_URL"] % (release, release))

+     resp_previous = get_resource(app.config["SCHEDULE_URL"] % ((release - 1), (release - 1)))

      data = []

  

      if not resp:
@@ -64,6 +65,26 @@ 

                      'current': date <= today  # mark all until now as current and clean up later

                  })

  

+     # Find out EOL date from the previous ical

+     # Currently relevant EOL date is defined in a calendar for currently stable Fedora release

+     # eg. EOL date for Fedora 95 would be in release calendar for Fedora 97 which would also be the latest stable

+     if resp_previous:

+         ical_prev_raw = icalendar.Calendar.from_ical(resp_previous)

+         for c in ical_prev_raw.walk():

+             if c.name == "VEVENT":

+                 summary = c.get('summary')

+                 date = c.get('dtstart').dt.astimezone(pytz.UTC)

+                 # We can't rely on the entire name (Fedora > Fedora Linux change in f35 schedule)

+                 # Using min() cause we don't care about a release oraculum doesn't track

+                 if "%d EOL" % min(releases["values"]) in summary:

+                     data.append({

+                         'summary': "Fedora %d EOL" % min(releases["values"]),

+                         'date': date.strftime("%d %b %Y"),

+                         'dtdate': date,

+                         'current': date <= today  # mark all until now as current and clean up later

+                     })

+ 

+ 

      data = sorted(data, key=lambda c: c['dtdate'])

  

      # leave the most recent 'current' milestone and clean up rest

Fixes https://pagure.io/fedora-qa/packager_dashboard/issue/99

Frontend part is broken with this, shows a Rawhide event instead of EOL event (date is correct).

Example oraculum response to trigger the issue:

"schedule": [
    {
      "current": true, 
      "date": "04 May 2021", 
      "summary": "Rawhide"
    }, 
    {
      "current": false, 
      "date": "25 May 2021", 
      "summary": "Fedora 32 End of Life"
    }, 
    {
      "current": false, 
      "date": "10 Aug 2021", 
      "summary": "Branch Fedora Linux 35 from Rawhide"
    }, 
    {
      "current": false, 
      "date": "24 Aug 2021", 
      "summary": "Beta Freeze (starts at 1400 UTC)"
    }, 
    {
      "current": false, 
      "date": "14 Sep 2021", 
      "summary": "Beta Release Public Availability"
    }, 
    {
      "current": false, 
      "date": "05 Oct 2021", 
      "summary": "Final Freeze (starts at 1400 UTC)"
    }, 
    {
      "current": false, 
      "date": "19 Oct 2021", 
      "summary": "Final Release Public Availability (GA)"
    }
  ], 

Build succeeded.

rebased onto df00f5c

3 years ago

Build succeeded.

rebased onto 09a0ce5

3 years ago

Build succeeded.

Pull-Request has been merged by frantisekz

3 years ago
Metadata