#10944 FTBFS bug reports: If the bug has been closed since epoch, open a new one
Merged 2 years ago by kevin. Opened 2 years ago by churchyard.
churchyard/releng ftbfs-open-for-closed  into  main

@@ -15,6 +15,7 @@ 

  import getpass

  import tempfile

  import urllib

+ from datetime import datetime

  from bugzilla.rhbugzilla import RHBugzilla

  from xmlrpc.client import Fault

  from find_failures import get_failed_builds
@@ -203,6 +204,17 @@ 

          results += _iterate_query(querydata,bzclient)

      return results

  

+ 

+ def _is_relevant_bugzilla(bug, epoch_datetime):

+     """We only care for bugs that are not yet closed or that were modified after

+     the given epoch"""

+     if bug.status != 'CLOSED':

+         return True

+     last_change_datetime = datetime.strptime(str(bug.last_change_time),

+                                              '%Y%m%dT%H:%M:%S')

+     return last_change_datetime > epoch_datetime

+ 

+ 

  if __name__ == '__main__':

      massrebuild = MASSREBUILDS[rebuildid]

  
@@ -213,7 +225,9 @@ 

                                     massrebuild['desttag'])

      print('Getting the list of filed bugs...')

      filed_bugs = get_filed_bugs(massrebuild['tracking_bug'])

-     filed_bugs_components = [bug.component for bug in filed_bugs]

+     epoch_datetime = datetime.fromisoformat(massrebuild['epoch'])

+     filed_bugs_components = [bug.component for bug in filed_bugs

+                              if _is_relevant_bugzilla(bug, epoch_datetime)]

      for build in failbuilds:

          task_id = build['task_id']

          component = build['package_name']

no initial comment

rebased onto d9a6f42

2 years ago

Note that I naïvely assume that last_change_time is the time when the bug was closed. I failed to figure out how to read the Last closed field.

But even if this assumption might not always be true, it is a significant improvement.

looks reasonable. Should we merge this and I will re-run? Or just don't do anything until f38?

Pull-Request has been merged by kevin

2 years ago

Yes, please run it again.

Metadata