#176 Prioritized Bugs hotfix
Merged 3 years ago by frantisekz. Opened 3 years ago by frantisekz.

@@ -94,6 +94,8 @@ 

                                      Vote!

                                  {% endif %}

                              </a>

+                             {% elif buglist.startswith('Prioritized') %}

+                             <!-- Nothing here, go on...-->

                              {% else %}

                              TBD

                              {% endif %}
@@ -119,7 +121,7 @@ 

              </tbody>

          </table>{% endif %}

          {% endfor %}

-         {% for buglist in ['Proposed Blockers','Accepted Blockers', 'Accepted 0-day Blockers', 'Accepted Previous Release Blockers', 'Proposed Freeze Exceptions', 'Accepted Freeze Exceptions'] %}

+         {% for buglist in ['Proposed Blockers','Accepted Blockers', 'Accepted 0-day Blockers', 'Accepted Previous Release Blockers', 'Proposed Freeze Exceptions', 'Accepted Freeze Exceptions', 'Prioritized Bugs'] %}

              {% if not buglists[buglist] %}<h4>No {{ buglist }}</h4>{% endif %}

          {% endfor %}

      </div> <!-- end of 12 columns -->

file modified
+1 -1
@@ -188,7 +188,7 @@ 

  

              self.log.info("Syncing PrioritizedBug for milestone %s" % milestone)

              self.cleanup_milestone(milestone, 'PrioritizedBug')

-             self.update_milestone(milestone, 'PrioritizedBug', last_sync_time)

+             self.update_milestone(milestone, 'PrioritizedBug', None)

  

              # update the last query time for the milestone

              milestone.last_bug_sync = starttime

@@ -26,6 +26,8 @@ 

  import logging

  import datetime

  

+ from blockerbugs import app

+ 

  # First, try to import modern xmlrpc.client and support also old one on EPEL 7/Python 2

  try:

      from xmlrpc.client import Fault
@@ -69,11 +71,8 @@ 

      def get_bz_query(self, tracker, last_update=None):

          query = {}

          query.update(base_query)

-         if tracker:

-             query['v1'] = str(tracker)

-         else:

-             query['status_whiteboard'] = 'PrioritizedBug'

-             query['keywords'] = 'Triaged'

+         query['v1'] = str(tracker)

+ 

          if last_update:

              last_update_string = last_update.strftime("%Y-%m-%d %H:%M GMT")

  
@@ -119,9 +118,14 @@ 

              buglist = self.flatten_bug_list(query)

              self.logger.debug('Doing query: %s' % str(query))

              return buglist

-         else:

-             result = self.bz.query(query)

-             return result

+ 

+         # https://bugzilla.redhat.com/buglist.cgi?bug_status=__open__&

+         # f1=flagtypes.name&o1=substring&query_format=advanced&v1=fedora_prioritized_bug%2B

+         query = self.bz.url_to_query("{}buglist.cgi?bug_status=__open__&f1=flagtypes.name&o1=substring"

+             "&query_format=advanced&v1=fedora_prioritized_bug%2B".format(app.config['BUGZILLA_URL']))

+         result = self.bz.query(query)

+         self.logger.debug('Doing query: %s' % str(query))

+         return result

  

  

      # instead of having a bunch of nested bug objects, make a final list of

Just a hotfix, the code around would reeaally love some refactoring (eg. it's fetching the same data for every milestone.. imo, this can be fixed later, the pr just moves it from "broken" to "working ugly code").

The question is... do we want to display prioritized bugs for every milestone? Or a separate tab?

Build succeeded.

rebased onto 4a072ae

3 years ago

Build succeeded.

Pull-Request has been merged by frantisekz

3 years ago