#2038 Don't use listTagged(tag, *) for untag-build
Merged 3 years ago by tkopecek. Opened 4 years ago by tkopecek.
tkopecek/koji issue2037  into  master

file modified
+11 -1
@@ -3,6 +3,7 @@ 

  import ast

  import fnmatch

  import hashlib

+ import itertools

  import json

  import logging

  import os
@@ -6608,8 +6609,17 @@ 

                  builds.append(binfo)

              seen_pkg[binfo['name']] = 1

      else:

-         tagged = session.listTagged(args[0])

+         # find all pkg's builds in tag

+         pkgs = set([koji.parse_NVR(nvr)['name'] for nvr in args[1:]])

+         tagged = []

+         with session.multicall() as m:

+             for pkg in pkgs:

+                 tagged.append(m.listTagged(args[0], package=pkg))

+         # flatten

+         tagged = list(itertools.chain(*[t.result for t in tagged]))

          idx = dict([(b['nvr'], b) for b in tagged])

+ 

+         # check exact builds

          builds = []

          for nvr in args[1:]:

              binfo = idx.get(nvr)

rebased onto ede5bf3

4 years ago

2 new commits added

  • fix chain iteration
  • Don't use listTagged(tag, *) for untag-build
4 years ago

pretty please pagure-ci rebuild

4 years ago

@tkopecek what's missing here? Can we target it for 1.22?

Yes, it is scheduled for 1.22 (see #2037, version are linked to issues, so it is not visible in PRs)

Well this is certainly better, but I find I'm frustrated with the api limitations here. We're still querying irrelevant data, just less of it. Unfortunately, I don't see any way that is much better without changing the hub. We could call listTags for each build instead, but that is also full of irrelevant data. I guess we could use queryHistory calls, but that seems obscure.

Anyway... :thumbsup:

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

3 years ago

Commit ef0730f fixes this pull-request

Pull-Request has been merged by tkopecek

3 years ago