Closed DaveWysochanskiRH closed 2 years ago
Ok, in 53cb39e I've fixed up the query to use "offset" as well as "limit" in the bugzilla API query, which is the way to query until all bugs are returned. I moved things around a bit and hopefully it is all more readable. As far as I can tell this does exactly what we want, and it should be safe for any future changes on the server end to limit the number of bugs returned.
A couple comments:
I decided to split out the reformatting changes into a separate commit on top of the main commit which implements the functional changes of this PR. I am not sure how important cleanups like the line lengths are so if they are not important we can just drop that without affecting the functional changes.
The two remaining items have been addressed in c09a689. Thank you for the review - made the code much better.
…bugs
Set the 'limit' option to bzapi.build_query() function to ensure we are not artificially limited to a small default number of bugs. Note the 'limit' option is new in python-bugzilla 3.1.0. In production we were seeing an artificial limit of 20 bugs get queried without setting this option. If we ever meet our defined limit of 1000 bugs in the query this means we probably did not query all bugs.
In addition, cut down on the number of bugs in the query by only querying those with recent modification times. Here we pick 7 days, somewhat arbitrarily, but with the understanding that the cronjob that runs bugzilla-query should be run at least once per week. We can look at only the recently modified bugs because we are looking for additions of retrace-server task strings in the bug comment text.
Signed-off-by: Dave Wysochanski dwysocha@redhat.com