#1477 Unexpected type returned from listTagged()
Closed: Fixed 2 years ago by julian8628. Opened 5 years ago 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

5 years ago

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.

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

2 years ago

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

2 years ago

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

2 years ago

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

2 years ago

Log in to comment on this ticket.

Metadata
Related Pull Requests
  • #3095 Merged 2 years ago