#218 add discussion link to bugs api
Merged 2 years ago by kparal. Opened 2 years ago by lbrabec.

@@ -70,7 +70,7 @@ 

  

  

  def get_bug_info(bug):

-     bug_simple_fields = ['bugid', 'url', 'summary', 'component', 'active']

+     bug_simple_fields = ['bugid', 'url', 'summary', 'component', 'active', 'discussion_link']

      bug_info = dict((attr, getattr(bug, attr)) for attr in bug_simple_fields)

      bug_info['type'] = [tp for tp in ACCEPTED_BUGTYPES if getattr(bug, tp)]

      return bug_info

file modified
+11 -7
@@ -33,6 +33,7 @@ 

          bug1 = add_bug(9000, 'testbug1', cls.milestone)

          bug1.accepted_fe = True

          bug1.status = 'CLOSED'

+         bug1.discussion_link = 'example.com'

          bug1copy = add_bug(9000, 'testbug1', cls.milestone2)  # different milestone than bug1

          bug1copy.accepted_fe = True

          bug1copy.status = 'CLOSED'
@@ -98,13 +99,16 @@ 

          assert resp.status_code == httplib.OK

          data = json.loads(resp.data)

          assert len(data) == 3

-         bug = data[0]

-         assert bug['bugid'] == 9000

-         assert bug['url'] == 'https://bugzilla.redhat.com/show_bug.cgi?id=9000'

-         assert bug['summary'] == 'testbug1'

-         assert bug['component'] == 'testcomponent'

-         assert bug['active']

-         assert set(bug['type']) == set(('accepted_blocker', 'accepted_fe'))

+         bug1 = data[0]

+         bug2 = data[1]

+         assert bug1['bugid'] == 9000

+         assert bug1['url'] == 'https://bugzilla.redhat.com/show_bug.cgi?id=9000'

+         assert bug1['summary'] == 'testbug1'

+         assert bug1['component'] == 'testcomponent'

+         assert bug1['active']

+         assert bug1['discussion_link'] == 'example.com'

+         assert bug2['discussion_link'] is None

+         assert set(bug1['type']) == set(('accepted_blocker', 'accepted_fe'))

  

      def test_list_accepted_blocker_bugs(self):

          url = '/api/v0/milestones/99/final/bugs?bugtype=accepted_blocker&'

no initial comment

Build succeeded.

Commit cd5931d fixes this pull-request

Pull-Request has been merged by kparal

2 years ago

Ehm... sorry! Merged now.