#4481 Enable parent tag as name, not ID only
Merged by mikem. Opened by jcupova.
jcupova/koji issue-4479  into  master

Download 4481.patch

Fixes: https://pagure.io/koji/issue/4479

@mikem what do you think about this easy fix? Or we can do it more complex, that we can add parent-name to the data dict and work with this directly in the _writeInheritanceData, that we can set parent_id by getTagID(parent-name). What do you think?

While this call can technically accept a plain dict, a list of dicts is the expected input. E.g. see edit-tag-inheritance.

I do think it would be better to handle this in the underlying call where we unpack this data.

I would not add a new field to the dict, I would just convert the value if it is not an int.

rebased onto 3999728651e1a249ce1734fbd69bb4d14c78c109

ah, yes, I missed that this is list of dicts :-). Thank you for catch. Fixed now.

The underlying call technically accepts either a list of dicts or a single dict (which it will simply wrap in a list). The current version of this patch assumes it is a list, which could break any code that relies on the alternative behavior. While I don't think any code in Koji itself does this, another client might.

The underlying call does some validation on the change list, and actually does a lookup for the parent tag to validate it. I think that is the right place to address this.

rebased onto 3999728651e1a249ce1734fbd69bb4d14c78c109

I do think it would be better to fix this in the underlying call, but I guess this works. We can always move the check later.

:thumbsup:

Metadata Update from @mikem:
- Pull-request tagged with: testing-basic

Metadata Update from @mfilip:
- Pull-request tagged with: testing-done

Commit 5ff8bab2 fixes this pull-request

Pull-Request has been merged by mikem

Metadata