#68 Ensure flags are included in the mass BZ query
Merged 5 years ago by adamwill. Opened 5 years ago by adamwill.
fedora-qa/ adamwill/blockerbugs no-flag-refresh  into  develop

@@ -29,7 +29,8 @@ 

  

  base_query = {'o1': 'anywords',

              'f1': 'blocked',

-             'query_format':'advanced'}

+             'query_format':'advanced',

+             'extra_fields':['flags']}

  

  class BZInterfaceError(Exception):

      def __init__(self, msg):

While updating my test instance today I noticed a bunch of
warnings from python-bugzilla like this:

Bug 1371338 missing attribute 'flags' - doing implicit refresh().
This will be slow, if you want to avoid this, properly use
query/getbug include_fields, and set bugzilla.bug_autorefresh =
False to force failure.

This happens in update_milestone() in bug_sync. We do a mass
query for newbugs then call self.extract_information() on
each individual bug. That in turn looks at the bug's flags to
determine whether needinfo is set. But it appears that, by
default, the flags are not included in the result of the mass
newbugs query, so python-bugzilla is doing an extra individual
query for each bug to get the flags. This is obviously slow and
produces needless load on the server.

To avoid this, it seems that we can just specify extra_fields
in the code that ultimately produces the query we use to get
newbugs. That way each newbug already has its flags and no
re-query is necessary.

Signed-off-by: Adam Williamson awilliam@redhat.com

Pull-Request has been merged by adamwill

5 years ago
Metadata