#1857 editTagExternalRepo sets merge_mode back to "koji"
Closed: Fixed by tkopecek. Opened by ktdreyer.

I can only set merge_mode on an external repository when I first add it to a tag with addExternalRepoToTag. If I want to update this relationship, I have to delete the relationship with removeExternalRepoFromTag, and then add it again with the new merge_mode.

It would be great if I could do this directly with editTagExternalRepo. This would simplify client code implementations that want to change the tag's merge_mode. It would eliminate the small time gap where a tag does not have the repository defined at all, which will make the tag history easier to understand and eliminate that small potential race condition with newRepo tasks kicking off between the "remove" and "add".


Heh, I read the code for edit_tag_external_repo() and it actually just does the remove+add internally:

remove_external_repo_from_tag(tag_id, repo_id)
add_external_repo_to_tag(tag_id, repo_id, priority)

So we'll still have the potential race here, but it would make client implementations easier if we could pass through merge_mode to our add_external_repo_to_tag() call.

Since this does a full add+remove under the hood, the current implementation of editTagExternalRepo in master has a hidden bug: it resets merge_mode back to "koji".

We should decide what happens when the user specifies "None" to "priority" or "None" to "merge_mode" for editTagExternalRepo.

Metadata Update from @tkopecek:
- Custom field Size adjusted to None
- Issue set to the milestone: 1.21

PR #2051

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

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

Commit ae8958e9 fixes this issue

Commit 944d1055 fixes this issue

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

Please continue any further discussion there.

Metadata
Related Pull Requests