Ticket #297 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

Have bodhi's query interfaces be able to select on multiple packages

Reported by: anonymous Owned by: lmacken
Priority: major Milestone:
Component: bodhi-server Version:
Keywords: Cc: johnp
Blocked By: Blocking:

Description

As per this mockup https://fedoraproject.org/w/uploads/b/b0/Myfedora-updateslist_overview-mock1.png

Fedora Community needs the ability to group releases of packages across different versions of Fedora. The algorithm is as such:

Request a list of a user's 10 latest releases (or the latest releases in general) from bodhi. When list received:

for row in list:

display row append package name to package list

request a list of releases for each active distribution for every package in the package list

When new list recived:

append to row with same package

There is one issue if FComm does this. If two distro releases of the same package happen at the same time they will both be shown as different rows instead of the one row. Ideally the query interface from Bodhi should be such that I can request a list of packages and ask it to group results by package name such that the results resemble something like:

{updates:[{package_name: d-bus, dist_updates:[{dist-name: rawhide, version: 1.2.7.f11}, {dist-name: Fedora 10, version: 1.2.5.f11}, etc.]},{etc}]}

However allowing me to just supply a list of names will give me enough info to work with for now.

Change History

comment:1 Changed 5 years ago by lmacken

  • Status changed from new to assigned
  • Cc johnp added
  • Owner set to lmacken

I just commited a 'query_updates' method that should hopefully meet these needs.

>>> pprint(bodhi.send_request('query_updates', req_params={'username': 'lmacken'}))
{'tg_flash': None,
 'updates': [{'dist_updates': [{'approved': None,
                                'close_bugs': True,
                                'date_modified': None,
                                'date_pushed': 'datetime.datetime...)',
                                'date_submitted': 'datetime.datetime...)',
                                'karma': 0,
                                'nagged': None,
                                'notes': 'u"* Added BodhiCl..."',
                                'pushed': False,
                                'release': 'Fedora 8',
                                'request': None,
                                'status': 'obsolete',
                                'submitter': 'lmacken',
                                'title': "u'python-fedora-0...'",
                                'type': 'bugfix',
                                'updateid': 'FEDORA-2008-6649',
                                'version': '0.3.2-1.fc8'},
                               {'approved': None,
                                'close_bugs': True,
                                'date_modified': None,
                                'date_pushed': 'datetime.datetime...)',
                                'date_submitted': 'datetime.datetime...)',
                                'karma': 0,
                                'nagged': None,
                                'notes': 'u"* Added BodhiCl..."',
                                'pushed': False,
                                'release': 'Fedora 9',
                                'request': None,
                                'status': 'obsolete',
                                'submitter': 'lmacken',
                                'title': "u'python-fedora-0...'",
                                'type': 'bugfix',
                                'updateid': 'FEDORA-2008-6587',
                                'version': '0.3.2-1.fc9'}],
              'package_name': 'python-fedora'},

Note, that it seems to be quite fast when specifying a username, but is extremely slow when not.

comment:2 Changed 5 years ago by lmacken

I just added add 'group_updates' parameter to bodhi's list method, which does the same thing.

https://fedorahosted.org/bodhi/changeset/161b46ecfe0f6de1f00882e907d57a924e931440

I also added some validators to the list method, which should fix the 'mine' issue.

https://fedorahosted.org/bodhi/changeset/1d04e9e1a2e290277d8051a267def7c06ba537f3

comment:3 Changed 5 years ago by lmacken

  • Status changed from assigned to closed
  • Resolution set to fixed

So I ended up reverting 161b46ecfe0f6de1f00882e907d57a924e931440, as grouping updates in bodhi turns out to make our query *extremely* inefficient. Thus, we are now doing the grouping outside of Bodhi, which turns out to be a much better way to do it, with bodhi's current model.

Note: See TracTickets for help on using tickets.