koji-ansible icon indicating copy to clipboard operation
koji-ansible copied to clipboard

external-repos management is not idempotent due to trailing slash

Open ignatenkobrain opened this issue 4 years ago • 4 comments

That is added by Koji, so if you try to pass URL in ansible without trailing slash it is always shown as changed. Probably the module should automatically add trailing slash regardless of what user wants...

ignatenkobrain avatar Mar 27 '20 16:03 ignatenkobrain

Thanks for this bug report.

I'm hesitant to make the Ansible module too "smart" in this case. I'm thinking that we should just require the user to always set a value with a "slash" at the end if they want their play to be idempotent.

The documentation has this section:

       - For idempotency, please ensure your url always ends with a "/"
         character. If you leave it out, Koji Hub will automatically add a "/"
         slash when storing this value in the database, and every subsequent
         Ansible run will appear to be "changing" the external repo's URL.

What do you think?

ktdreyer avatar Mar 27 '20 17:03 ktdreyer

...I will think about this some more. Maybe this is too bad of a papercut to force users to read the docs.

ktdreyer avatar Mar 27 '20 17:03 ktdreyer

I think as long as we mirror what koji would do, it would be safe.

ignatenkobrain avatar Mar 28 '20 07:03 ignatenkobrain

TODO: integration tests

ktdreyer avatar Jun 22 '20 16:06 ktdreyer