#1477 Unexpected type returned from listTagged()
Closed: Fixed by julian8628. Opened by mattia.

kojihub.listTagged(), kojihub.listTaggedRPMS() and kojihub.listTaggedArchives() are supposed to return a list, but the use of get_tag(strict=True) makes them return a dict which carries the error message.
This causes unexpected behavior to, for example, Bodhi:
https://github.com/fedora-infra/bodhi/issues/3274


We made this change in PR#928, in order to keep a consistent behavior for tag existence.

@mikem @tkopecek
is it worth to add a strict option for `listTagged*?

Hmm, I wouldn't add it here. For me it is a reasonable error - if you call function which has only required parameter and it is the existing tag, it seems to me reasonable to fail. Correct way should be to check existence of tag before.

Metadata Update from @tkopecek:
- Issue tagged with: discussion, easyfix, feature

What about a

try:
   get_tag(...)
except:
   return []
results = readTaggedBuilds...

In my opinion, if the provided tag doesn't exist, listTagged should return an empty result set, not an error.

PR #3095

Metadata Update from @tkopecek:
- Custom field Size adjusted to None

Metadata Update from @tkopecek:
- Issue untagged with: discussion
- Issue tagged with: testing-ready

Metadata Update from @tkopecek:
- Issue set to the milestone: 1.27

Metadata Update from @jcupova:
- Issue tagged with: testing-done

Commit 70a0c6f8 fixes this issue

Commit ea695543 fixes this issue

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/koji/koji/issues/1477

Please continue any further discussion there.

Metadata
Related Pull Requests