theforeman / foreman-ansible-modules

Ansible modules for interacting with the Foreman API and various plugin APIs such as Katello
GNU General Public License v3.0
147 stars 163 forks source link

Rename repository_set to red_hat_repository #1188

Open wbclark opened 3 years ago

wbclark commented 3 years ago

End users who are primarily WebUI users are mostly not familiar with the concept of a repository set. They may be familiar with this term if they also use hammer, or they may encounter it when managing default repositories on an activation key or enabled repositories for content hosts; but it's not immediately clear how this related to the Content -> Red Hat Repositories page on the WebUI, which is the likely source of most user intuition in this area.

With https://github.com/theforeman/foreman-ansible-modules/commit/39da5f97b6aef5ed058ea3c87d46ac030b67cae0 we added clarifying documentation for users to use the repository_set module rather than repository to enabled/disable Red Hat Repositories.

Still, if we make the following (I think, reasonable) assumptions:

Then, I think it is reasonable to conclude that there would be less user confusion over time if we go ahead and rename the module. I propose to do this in the following way:

  1. Initially create an identical copy of the module using the new name theforeman.foreman.red_hat_repository
  2. Add a deprecation warning to theforeman.foreman.repository_set which states the module will be removed in a future release
  3. Update roles in the collection to use the renamed module
  4. Allow time for current users to make the change in their own playbooks and roles
  5. In a future major release, remove theforeman.foreman.repository_set

An interesting and related observation is that the Katello RepositorySetsController does accept a param :with_custom[1] which returns repository sets for custom repositories in addition to Red Hat Repositories. However as far as I can tell, this parameter is only ever passed by the WebUI's content-hosts-bulk-repository-sets-modal.controller.js, and specifying a custom product would otherwise result in an error 'Repository sets are not available for custom products.'[2] At any rate, since this module does not support that parameter and exists only to enable/disable Red Hat Repositories available through subscriptions, the renaming I am proposing seems better aligned to what the module actually does and should be much clearer to future users.

[1] https://github.com/Katello/katello/commit/8765d1599e244eb6d3162c0bd49c474b8b659937 [2] https://github.com/Katello/katello/blob/0af4bbeba0346544c015a58f61ceb16e84ffb810/app/controllers/katello/api/v2/repository_sets_controller.rb#L149-L151

jlsherrill commented 3 years ago

One reason to not do this is that the repository sets api actually supports returning custom content and partha has been working to use this api more for listing repo sets for activation keys and hosts: https://github.com/Katello/katello/pull/9219

So repository sets is actually the better name, but enable/disable/available_repositories apis is just for Red hat repository sets. We might could rename those to make that more clear, but we might should do that at the api level first (while deprecating the old endpoints)