Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tag: enforce unique tag inheritance names and priorities client-side #188

Open
ktdreyer opened this issue Jul 13, 2020 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@ktdreyer
Copy link
Owner

ktdreyer commented Jul 13, 2020

The koji_tag module calls a validate_repos() method to ensure that the playbook author has specified valid inputs for external_repos. The playbook author must specify a unique name string and priority integer for each external repository. This method will raise DuplicateNameError or DuplicatePriorityError if the user specifies invalid inputs.

We should do the same validation check for the tag inheritance values.

This will help us catch errors earlier when we apply tag inheritance in check mode. This is important when a playbook might assemble the final tag inheritance value from a couple different variables, and the final impact is not immediately clear when a user changes one variable without looking at all the others.

Note: thankfully the Koji Hub will raise GenericError: Inheritance priorities must be unique or GenericError: Changes should not contain duplicated parent_id if the user specifies invalid inputs live, so this is already solved for "live" mode on the server-side. We just need to implement the validation client-side to improve the check mode UX.

Second note: I've updated the server-side message text to be clearer, at https://pagure.io/koji/pull-request/3208, and discussed adding DuplicatePriorityError in https://pagure.io/koji/pull-request/3152

@ktdreyer ktdreyer added the enhancement New feature or request label Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant