katello 4.18.1 → 4.19.0.rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of katello might be problematic. Click here for more details.

Files changed (388) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/katello/locale/bn/katello.js +379 -109
  3. data/app/assets/javascripts/katello/locale/bn_IN/katello.js +379 -109
  4. data/app/assets/javascripts/katello/locale/ca/katello.js +379 -109
  5. data/app/assets/javascripts/katello/locale/cs/katello.js +380 -110
  6. data/app/assets/javascripts/katello/locale/cs_CZ/katello.js +382 -112
  7. data/app/assets/javascripts/katello/locale/de/katello.js +385 -115
  8. data/app/assets/javascripts/katello/locale/de_AT/katello.js +379 -109
  9. data/app/assets/javascripts/katello/locale/de_DE/katello.js +379 -109
  10. data/app/assets/javascripts/katello/locale/el/katello.js +380 -110
  11. data/app/assets/javascripts/katello/locale/en/katello.js +380 -110
  12. data/app/assets/javascripts/katello/locale/en_GB/katello.js +379 -109
  13. data/app/assets/javascripts/katello/locale/en_US/katello.js +379 -109
  14. data/app/assets/javascripts/katello/locale/es/katello.js +383 -113
  15. data/app/assets/javascripts/katello/locale/et_EE/katello.js +379 -109
  16. data/app/assets/javascripts/katello/locale/fr/katello.js +388 -118
  17. data/app/assets/javascripts/katello/locale/gl/katello.js +379 -109
  18. data/app/assets/javascripts/katello/locale/gu/katello.js +379 -109
  19. data/app/assets/javascripts/katello/locale/he_IL/katello.js +379 -109
  20. data/app/assets/javascripts/katello/locale/hi/katello.js +379 -109
  21. data/app/assets/javascripts/katello/locale/id/katello.js +379 -109
  22. data/app/assets/javascripts/katello/locale/it/katello.js +379 -109
  23. data/app/assets/javascripts/katello/locale/ja/katello.js +388 -118
  24. data/app/assets/javascripts/katello/locale/ka/katello.js +385 -115
  25. data/app/assets/javascripts/katello/locale/kn/katello.js +379 -109
  26. data/app/assets/javascripts/katello/locale/ko/katello.js +388 -118
  27. data/app/assets/javascripts/katello/locale/ml_IN/katello.js +379 -109
  28. data/app/assets/javascripts/katello/locale/mr/katello.js +379 -109
  29. data/app/assets/javascripts/katello/locale/nl_NL/katello.js +379 -109
  30. data/app/assets/javascripts/katello/locale/or/katello.js +379 -109
  31. data/app/assets/javascripts/katello/locale/pa/katello.js +379 -109
  32. data/app/assets/javascripts/katello/locale/pl/katello.js +379 -109
  33. data/app/assets/javascripts/katello/locale/pl_PL/katello.js +379 -109
  34. data/app/assets/javascripts/katello/locale/pt/katello.js +379 -109
  35. data/app/assets/javascripts/katello/locale/pt_BR/katello.js +383 -113
  36. data/app/assets/javascripts/katello/locale/ro/katello.js +379 -109
  37. data/app/assets/javascripts/katello/locale/ro_RO/katello.js +379 -109
  38. data/app/assets/javascripts/katello/locale/ru/katello.js +381 -111
  39. data/app/assets/javascripts/katello/locale/sl/katello.js +379 -109
  40. data/app/assets/javascripts/katello/locale/sv_SE/katello.js +379 -109
  41. data/app/assets/javascripts/katello/locale/ta/katello.js +379 -109
  42. data/app/assets/javascripts/katello/locale/ta_IN/katello.js +379 -109
  43. data/app/assets/javascripts/katello/locale/te/katello.js +379 -109
  44. data/app/assets/javascripts/katello/locale/tr/katello.js +379 -109
  45. data/app/assets/javascripts/katello/locale/vi/katello.js +379 -109
  46. data/app/assets/javascripts/katello/locale/vi_VN/katello.js +379 -109
  47. data/app/assets/javascripts/katello/locale/zh/katello.js +379 -109
  48. data/app/assets/javascripts/katello/locale/zh_CN/katello.js +388 -118
  49. data/app/assets/javascripts/katello/locale/zh_TW/katello.js +381 -111
  50. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +41 -12
  51. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -1
  52. data/app/controllers/katello/api/v2/activation_keys_controller.rb +3 -65
  53. data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +1 -1
  54. data/app/controllers/katello/api/v2/content_views_controller.rb +18 -3
  55. data/app/controllers/katello/api/v2/debs_controller.rb +21 -11
  56. data/app/controllers/katello/api/v2/docker_tags_controller.rb +7 -0
  57. data/app/controllers/katello/api/v2/flatpak_remote_repositories_controller.rb +21 -19
  58. data/app/controllers/katello/api/v2/host_debs_controller.rb +16 -1
  59. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +3 -60
  60. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +10 -53
  61. data/app/controllers/katello/api/v2/repositories_controller.rb +0 -1
  62. data/app/controllers/katello/concerns/api/v2/hosts_controller_extensions.rb +10 -0
  63. data/app/controllers/katello/concerns/organizations_controller_extensions.rb +3 -0
  64. data/app/lib/actions/candlepin/activation_key/create.rb +0 -2
  65. data/app/lib/actions/candlepin/activation_key/update.rb +0 -2
  66. data/app/lib/actions/candlepin/product/content_create.rb +3 -5
  67. data/app/lib/actions/candlepin/product/content_update.rb +2 -3
  68. data/app/lib/actions/helpers/rolling_cv_repos.rb +1 -1
  69. data/app/lib/actions/katello/activation_key/create.rb +0 -1
  70. data/app/lib/actions/katello/activation_key/update.rb +0 -2
  71. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +1 -6
  72. data/app/lib/actions/katello/content_credential/update.rb +1 -1
  73. data/app/lib/actions/katello/content_view/add_rolling_repo_clone.rb +18 -24
  74. data/app/lib/actions/katello/content_view/create.rb +9 -4
  75. data/app/lib/actions/katello/content_view/refresh_rolling_repo.rb +6 -1
  76. data/app/lib/actions/katello/content_view/remove_rolling_repo_clone.rb +16 -11
  77. data/app/lib/actions/katello/content_view/update.rb +34 -7
  78. data/app/lib/actions/katello/product/content_create.rb +2 -2
  79. data/app/lib/actions/katello/product/content_destroy.rb +1 -1
  80. data/app/lib/actions/katello/repository/check_matching_content.rb +1 -1
  81. data/app/lib/actions/katello/repository/clone_contents.rb +1 -1
  82. data/app/lib/actions/katello/repository/create.rb +1 -1
  83. data/app/lib/actions/katello/repository/destroy.rb +4 -4
  84. data/app/lib/actions/katello/repository/finish_upload.rb +1 -1
  85. data/app/lib/actions/katello/repository/sync.rb +1 -1
  86. data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +2 -2
  87. data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +1 -1
  88. data/app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb +1 -1
  89. data/app/lib/actions/pulp3/repository/save_publication.rb +3 -1
  90. data/app/lib/actions/pulp3/repository/save_version.rb +45 -24
  91. data/app/lib/actions/pulp3/repository/save_versions.rb +2 -1
  92. data/app/lib/katello/resources/candlepin/activation_key.rb +3 -4
  93. data/app/lib/katello/resources/candlepin/upstream_job.rb +9 -1
  94. data/app/lib/katello/resources/candlepin.rb +4 -0
  95. data/app/models/katello/authorization/repository.rb +17 -4
  96. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +0 -7
  97. data/app/models/katello/content_view_deb_filter.rb +10 -0
  98. data/app/models/katello/content_view_deb_filter_rule.rb +7 -0
  99. data/app/models/katello/deb.rb +10 -10
  100. data/app/models/katello/erratum.rb +1 -1
  101. data/app/models/katello/glue/provider.rb +14 -3
  102. data/app/models/katello/host/content_facet.rb +1 -1
  103. data/app/models/katello/host/subscription_facet.rb +1 -7
  104. data/app/models/katello/product_content.rb +2 -2
  105. data/app/models/katello/repository.rb +4 -23
  106. data/app/models/katello/root_repository.rb +2 -5
  107. data/app/services/katello/candlepin/event_handler.rb +0 -33
  108. data/app/services/katello/candlepin/message_handler.rb +0 -41
  109. data/app/services/katello/content_unit_indexer.rb +59 -13
  110. data/app/services/katello/product_content_finder.rb +5 -4
  111. data/app/services/katello/pulp3/alternate_content_source.rb +2 -2
  112. data/app/services/katello/pulp3/ansible_collection.rb +1 -0
  113. data/app/services/katello/pulp3/api/content_guard.rb +5 -5
  114. data/app/services/katello/pulp3/api/core.rb +10 -0
  115. data/app/services/katello/pulp3/deb.rb +1 -0
  116. data/app/services/katello/pulp3/docker_manifest.rb +1 -0
  117. data/app/services/katello/pulp3/docker_manifest_list.rb +1 -0
  118. data/app/services/katello/pulp3/docker_tag.rb +1 -0
  119. data/app/services/katello/pulp3/file_unit.rb +1 -0
  120. data/app/services/katello/pulp3/generic_content_unit.rb +1 -0
  121. data/app/services/katello/pulp3/module_stream.rb +1 -0
  122. data/app/services/katello/pulp3/package_group.rb +1 -0
  123. data/app/services/katello/pulp3/repository/apt.rb +41 -16
  124. data/app/services/katello/pulp3/repository.rb +59 -10
  125. data/app/services/katello/pulp3/rpm.rb +3 -2
  126. data/app/services/katello/pulp3/srpm.rb +3 -2
  127. data/app/services/katello/pulp3/task_group.rb +1 -1
  128. data/app/services/katello/registration_manager.rb +19 -17
  129. data/app/services/katello/repository_type_manager.rb +7 -5
  130. data/app/services/katello/smart_proxy_helper.rb +1 -6
  131. data/app/views/foreman/job_templates/upload_profile.erb +5 -0
  132. data/app/views/katello/api/v2/activation_keys/base.json.rabl +1 -1
  133. data/app/views/katello/api/v2/content_views/base.json.rabl +1 -0
  134. data/app/views/katello/api/v2/debs/thindex.json.rabl +6 -0
  135. data/app/views/katello/api/v2/docker_tags/_base.json.rabl +32 -0
  136. data/app/views/katello/api/v2/docker_tags/show.json.rabl +0 -5
  137. data/app/views/katello/api/v2/flatpak_remotes/index.json.rabl +6 -0
  138. data/app/views/katello/api/v2/host_debs/installed_debs.json.rabl +6 -0
  139. data/app/views/katello/api/v2/hosts_bulk_actions/applicable_errata.json.rabl +1 -1
  140. data/app/views/katello/api/v2/hosts_bulk_actions/applicable_erratum.json.rabl +9 -0
  141. data/app/views/katello/api/v2/hosts_bulk_actions/installable_errata.json.rabl +1 -1
  142. data/app/views/katello/api/v2/hosts_bulk_actions/{erratum.json.rabl → installable_erratum.json.rabl} +3 -3
  143. data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
  144. data/config/initializers/monkeys.rb +1 -0
  145. data/config/routes/api/v2.rb +2 -2
  146. data/config/routes/overrides.rb +2 -7
  147. data/config/routes.rb +2 -0
  148. data/db/migrate/20211019192121_create_cdn_configuration.katello.rb +1 -1
  149. data/db/migrate/20250912000000_add_pulp_prn_fields.rb +73 -0
  150. data/db/migrate/20250912000001_populate_pulp_prn_fields.rb +403 -0
  151. data/db/migrate/20251009142516_remove_auto_attach_from_activation_keys.rb +5 -0
  152. data/db/migrate/20251009142517_remove_autoheal_from_subscription_facets.rb +5 -0
  153. data/db/seeds.d/111-upgrade_tasks.rb +2 -0
  154. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/bn.po +10 -0
  155. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/bn_IN.po +10 -0
  156. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ca.po +10 -0
  157. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/cs_CZ.po +10 -0
  158. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +10 -0
  159. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de_AT.po +10 -0
  160. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de_DE.po +10 -0
  161. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/el.po +12 -2
  162. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/en_GB.po +10 -0
  163. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/en_US.po +10 -0
  164. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +10 -0
  165. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/et_EE.po +10 -0
  166. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +10 -0
  167. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/gl.po +10 -0
  168. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/gu.po +10 -0
  169. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/he_IL.po +10 -0
  170. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/hi.po +10 -0
  171. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/id.po +10 -0
  172. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/it.po +10 -0
  173. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +10 -0
  174. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ka.po +10 -0
  175. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/kn.po +10 -0
  176. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +10 -0
  177. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ml_IN.po +10 -0
  178. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/mr.po +10 -0
  179. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/nl_NL.po +10 -0
  180. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/or.po +10 -0
  181. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pa.po +10 -0
  182. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pl.po +10 -0
  183. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pl_PL.po +10 -0
  184. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt.po +10 -0
  185. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +10 -0
  186. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ro.po +10 -0
  187. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ro_RO.po +10 -0
  188. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ru.po +10 -0
  189. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/sl.po +10 -0
  190. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/sv_SE.po +10 -0
  191. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ta.po +10 -0
  192. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ta_IN.po +10 -0
  193. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/te.po +10 -0
  194. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/tr.po +10 -0
  195. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/vi.po +10 -0
  196. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/vi_VN.po +10 -0
  197. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh.po +10 -0
  198. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +10 -0
  199. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +10 -0
  200. data/lib/katello/permission_creator.rb +2 -2
  201. data/lib/katello/permissions/host_permissions.rb +0 -6
  202. data/lib/katello/plugin.rb +17 -8
  203. data/lib/katello/tasks/jenkins.rake +1 -1
  204. data/lib/katello/tasks/upgrades/4.19/enable_structured_apt_for_deb.rake +87 -0
  205. data/lib/katello/tasks/upgrades/4.19/populate_repository_version_prns.rake +32 -0
  206. data/lib/katello/version.rb +1 -1
  207. data/lib/monkeys/fix_rpm_repository_gpgcheck.rb +38 -0
  208. data/locale/action_names.rb +0 -6
  209. data/locale/bn/LC_MESSAGES/katello.mo +0 -0
  210. data/locale/bn/katello.po +379 -109
  211. data/locale/bn_IN/LC_MESSAGES/katello.mo +0 -0
  212. data/locale/bn_IN/katello.po +379 -109
  213. data/locale/ca/LC_MESSAGES/katello.mo +0 -0
  214. data/locale/ca/katello.po +379 -109
  215. data/locale/cs/LC_MESSAGES/katello.mo +0 -0
  216. data/locale/cs/katello.po +380 -111
  217. data/locale/cs_CZ/LC_MESSAGES/katello.mo +0 -0
  218. data/locale/cs_CZ/katello.po +382 -112
  219. data/locale/de/LC_MESSAGES/katello.mo +0 -0
  220. data/locale/de/katello.po +386 -116
  221. data/locale/de_AT/LC_MESSAGES/katello.mo +0 -0
  222. data/locale/de_AT/katello.po +379 -109
  223. data/locale/de_DE/LC_MESSAGES/katello.mo +0 -0
  224. data/locale/de_DE/katello.po +379 -109
  225. data/locale/el/LC_MESSAGES/katello.mo +0 -0
  226. data/locale/el/katello.po +381 -111
  227. data/locale/en/LC_MESSAGES/katello.mo +0 -0
  228. data/locale/en/katello.po +380 -111
  229. data/locale/en_GB/LC_MESSAGES/katello.mo +0 -0
  230. data/locale/en_GB/katello.po +379 -109
  231. data/locale/en_US/LC_MESSAGES/katello.mo +0 -0
  232. data/locale/en_US/katello.po +379 -109
  233. data/locale/es/LC_MESSAGES/katello.mo +0 -0
  234. data/locale/es/katello.po +383 -113
  235. data/locale/et_EE/LC_MESSAGES/katello.mo +0 -0
  236. data/locale/et_EE/katello.po +379 -109
  237. data/locale/fr/LC_MESSAGES/katello.mo +0 -0
  238. data/locale/fr/katello.po +389 -119
  239. data/locale/gl/LC_MESSAGES/katello.mo +0 -0
  240. data/locale/gl/katello.po +379 -109
  241. data/locale/gu/LC_MESSAGES/katello.mo +0 -0
  242. data/locale/gu/katello.po +379 -109
  243. data/locale/he_IL/LC_MESSAGES/katello.mo +0 -0
  244. data/locale/he_IL/katello.po +379 -109
  245. data/locale/hi/LC_MESSAGES/katello.mo +0 -0
  246. data/locale/hi/katello.po +379 -109
  247. data/locale/id/LC_MESSAGES/katello.mo +0 -0
  248. data/locale/id/katello.po +379 -109
  249. data/locale/it/LC_MESSAGES/katello.mo +0 -0
  250. data/locale/it/katello.po +379 -109
  251. data/locale/ja/LC_MESSAGES/katello.mo +0 -0
  252. data/locale/ja/katello.po +390 -119
  253. data/locale/ka/LC_MESSAGES/katello.mo +0 -0
  254. data/locale/ka/katello.po +385 -115
  255. data/locale/katello.pot +1273 -831
  256. data/locale/kn/LC_MESSAGES/katello.mo +0 -0
  257. data/locale/kn/katello.po +379 -109
  258. data/locale/ko/LC_MESSAGES/katello.mo +0 -0
  259. data/locale/ko/katello.po +389 -119
  260. data/locale/ml_IN/LC_MESSAGES/katello.mo +0 -0
  261. data/locale/ml_IN/katello.po +379 -109
  262. data/locale/mr/LC_MESSAGES/katello.mo +0 -0
  263. data/locale/mr/katello.po +379 -109
  264. data/locale/nl_NL/LC_MESSAGES/katello.mo +0 -0
  265. data/locale/nl_NL/katello.po +379 -109
  266. data/locale/or/LC_MESSAGES/katello.mo +0 -0
  267. data/locale/or/katello.po +379 -109
  268. data/locale/pa/LC_MESSAGES/katello.mo +0 -0
  269. data/locale/pa/katello.po +379 -109
  270. data/locale/pl/LC_MESSAGES/katello.mo +0 -0
  271. data/locale/pl/katello.po +379 -109
  272. data/locale/pl_PL/LC_MESSAGES/katello.mo +0 -0
  273. data/locale/pl_PL/katello.po +379 -109
  274. data/locale/pt/LC_MESSAGES/katello.mo +0 -0
  275. data/locale/pt/katello.po +379 -109
  276. data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
  277. data/locale/pt_BR/katello.po +383 -113
  278. data/locale/ro/LC_MESSAGES/katello.mo +0 -0
  279. data/locale/ro/katello.po +379 -109
  280. data/locale/ro_RO/LC_MESSAGES/katello.mo +0 -0
  281. data/locale/ro_RO/katello.po +379 -109
  282. data/locale/ru/LC_MESSAGES/katello.mo +0 -0
  283. data/locale/ru/katello.po +381 -111
  284. data/locale/sl/LC_MESSAGES/katello.mo +0 -0
  285. data/locale/sl/katello.po +379 -109
  286. data/locale/sv_SE/LC_MESSAGES/katello.mo +0 -0
  287. data/locale/sv_SE/katello.po +379 -109
  288. data/locale/ta/LC_MESSAGES/katello.mo +0 -0
  289. data/locale/ta/katello.po +379 -109
  290. data/locale/ta_IN/LC_MESSAGES/katello.mo +0 -0
  291. data/locale/ta_IN/katello.po +379 -109
  292. data/locale/te/LC_MESSAGES/katello.mo +0 -0
  293. data/locale/te/katello.po +379 -109
  294. data/locale/tr/LC_MESSAGES/katello.mo +0 -0
  295. data/locale/tr/katello.po +379 -109
  296. data/locale/vi/LC_MESSAGES/katello.mo +0 -0
  297. data/locale/vi/katello.po +379 -109
  298. data/locale/vi_VN/LC_MESSAGES/katello.mo +0 -0
  299. data/locale/vi_VN/katello.po +379 -109
  300. data/locale/zh/LC_MESSAGES/katello.mo +0 -0
  301. data/locale/zh/katello.po +379 -109
  302. data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
  303. data/locale/zh_CN/katello.po +389 -119
  304. data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
  305. data/locale/zh_TW/katello.po +381 -111
  306. data/webpack/ForemanColumnExtensions/index.js +46 -2
  307. data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetails.test.js.snap +2 -2
  308. data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js +0 -2
  309. data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/__tests__/SystemPurposeEditModal.test.js +0 -2
  310. data/webpack/components/extensions/Hosts/ActionsBar/index.js +1 -0
  311. data/webpack/components/extensions/Hosts/BulkActions/BulkActionsConstants.js +7 -0
  312. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/BulkChangeHostCollectionsModal.js +388 -0
  313. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/__tests__/BulkChangeHostCollectionsModal.test.js +640 -0
  314. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/actions.js +28 -0
  315. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/index.js +71 -0
  316. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/02_BulkErrataTable.js +1 -1
  317. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/BulkErrataWizard.js +1 -1
  318. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/02_BulkPackagesTable.js +11 -4
  319. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js +51 -24
  320. data/webpack/components/extensions/Hosts/BulkActions/BulkRepositorySetsWizard/01_BulkRepositorySetsTable.js +1 -1
  321. data/webpack/components/extensions/Hosts/BulkActions/HostReview.js +8 -1
  322. data/webpack/containers/Application/config.js +11 -1
  323. data/webpack/global_index.js +3 -0
  324. data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/BootedContainerImagesConstants.js +1 -1
  325. data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/BootedContainerImagesPage.js +7 -43
  326. data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/__tests__/bootedContainerImagesPage.test.js +1 -1
  327. data/webpack/scenes/ContainerImages/ContainerImagesPage.js +86 -0
  328. data/webpack/scenes/ContainerImages/LabelsAnnotationsModal.js +105 -0
  329. data/webpack/scenes/ContainerImages/Synced/Details/ManifestDetails.js +218 -0
  330. data/webpack/scenes/ContainerImages/Synced/Details/ManifestDetailsActions.js +15 -0
  331. data/webpack/scenes/ContainerImages/Synced/Details/ManifestDetailsSelectors.js +16 -0
  332. data/webpack/scenes/ContainerImages/Synced/Details/__tests__/ManifestDetails.test.js +395 -0
  333. data/webpack/scenes/ContainerImages/Synced/Details/__tests__/manifestDetails.fixtures.json +43 -0
  334. data/webpack/scenes/ContainerImages/Synced/Details/__tests__/manifestList.fixtures.json +58 -0
  335. data/webpack/scenes/ContainerImages/Synced/Details/index.js +4 -0
  336. data/webpack/scenes/ContainerImages/Synced/SyncedContainerImagesPage.js +359 -0
  337. data/webpack/scenes/ContainerImages/Synced/SyncedContainerImagesPage.scss +21 -0
  338. data/webpack/scenes/ContainerImages/Synced/__tests__/LabelsAnnotationsModal.test.js +69 -0
  339. data/webpack/scenes/ContainerImages/Synced/__tests__/SyncedContainerImagesPage.test.js +335 -0
  340. data/webpack/scenes/ContainerImages/Synced/__tests__/syncedContainerImages.fixtures.json +105 -0
  341. data/webpack/scenes/ContainerImages/TableEmptyState.js +67 -0
  342. data/webpack/scenes/ContainerImages/containerImagesHelpers.js +48 -0
  343. data/webpack/scenes/ContainerImages/index.js +4 -0
  344. data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +29 -3
  345. data/webpack/scenes/ContentViews/Create/__tests__/contentViewCreateResult.fixtures.json +1 -0
  346. data/webpack/scenes/ContentViews/Create/__tests__/createContentView.test.js +45 -1
  347. data/webpack/scenes/ContentViews/Delete/__tests__/affectedHosts.fixtures.json +0 -1
  348. data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +59 -1
  349. data/webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js +1 -0
  350. data/webpack/scenes/ContentViews/Details/Filters/Rules/DebPackage/AddEditDebPackageRuleModal.js +164 -24
  351. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVDebFilterContent.test.js +268 -0
  352. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvDebFilterDetail.fixtures.json +95 -0
  353. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvDebFilterRules.fixtures.json +31 -0
  354. data/webpack/scenes/ContentViews/Details/Filters/__tests__/emptyCVDebFilterRules.fixtures.json +10 -0
  355. data/webpack/scenes/ContentViews/Details/Versions/BulkDelete/__tests__/hosts.fixtures.json +0 -1
  356. data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvAffectedHosts.fixture.json +0 -1
  357. data/webpack/scenes/ContentViews/Details/__tests__/contentViewRollingDetail.test.js +15 -0
  358. data/webpack/scenes/ContentViews/Details/__tests__/contentViewRollingDetails.fixtures.json +1 -0
  359. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +9 -0
  360. data/webpack/scenes/FlatpakRemotes/CreateEdit/CreateFlatpakRemoteModal.js +5 -3
  361. data/webpack/scenes/FlatpakRemotes/CreateEdit/EditFlatpakRemotesModal.js +1 -1
  362. data/webpack/scenes/FlatpakRemotes/CreateEdit/FlatpakRemoteform.js +35 -3
  363. data/webpack/scenes/FlatpakRemotes/Details/FlatpakRemoteDetails.js +1 -1
  364. data/webpack/scenes/FlatpakRemotes/Details/RemoteRepositories/RemoteRepositoriesTable.css +3 -0
  365. data/webpack/scenes/FlatpakRemotes/Details/RemoteRepositories/RemoteRepositoriesTable.js +63 -132
  366. data/webpack/scenes/FlatpakRemotes/FlatpakRemotesPage.js +67 -143
  367. data/webpack/scenes/SmartProxy/ExpandableCvDetails.js +10 -2
  368. data/webpack/scenes/SmartProxy/SmartProxyContentActions.js +13 -2
  369. data/webpack/scenes/SmartProxy/SmartProxyContentConstants.js +1 -0
  370. data/webpack/scenes/SmartProxy/SmartProxyExpandableTable.js +8 -2
  371. data/webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js +67 -1
  372. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +2 -2
  373. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +0 -2
  374. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +15 -5
  375. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +22 -5
  376. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +141 -0
  377. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsActions.test.js.snap +2 -2
  378. metadata +82 -56
  379. data/app/lib/actions/katello/host/attach_subscriptions.rb +0 -59
  380. data/app/lib/actions/katello/host/auto_attach_subscriptions.rb +0 -22
  381. data/app/lib/actions/katello/host/remove_subscriptions.rb +0 -50
  382. data/app/lib/actions/katello/organization/simple_content_access/disable.rb +0 -25
  383. data/app/lib/actions/katello/organization/simple_content_access/enable.rb +0 -25
  384. data/app/lib/actions/katello/organization/simple_content_access/toggle.rb +0 -42
  385. data/lib/katello/tasks/migrate_structure_content_for_deb.rake +0 -105
  386. data/lib/katello/tasks/upgrades/4.2/remove_checksum_values.rake +0 -17
  387. /data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/__tests__/bootedContainerImages.fixtures.js +0 -0
  388. /data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/index.js +0 -0
@@ -1,5 +1,6 @@
1
1
  module Katello
2
2
  # this is Katello's host bulk actions controller, not to be confused with Foreman's
3
+ # rubocop:disable Metrics/ClassLength
3
4
  class Api::V2::HostsBulkActionsController < Api::V2::ApiController
4
5
  include ::Api::V2::BulkHostsExtension
5
6
  include Katello::Concerns::Api::V2::ContentOverridesController
@@ -13,11 +14,8 @@ module Katello
13
14
  before_action :find_deletable_hosts, only: [:destroy_hosts]
14
15
  before_action :find_readable_hosts, only: [:applicable_errata, :installable_errata, :available_incremental_updates]
15
16
  before_action :find_errata, only: [:available_incremental_updates]
16
- before_action :find_organization, only: [:add_subscriptions]
17
17
  before_action :find_traces, only: [:resolve_traces]
18
18
 
19
- before_action :validate_organization, only: [:add_subscriptions]
20
-
21
19
  # disable *_count fields on erratum rabl, since they perform N+1 queries
22
20
  before_action :disable_erratum_hosts_count
23
21
 
@@ -51,8 +49,14 @@ module Katello
51
49
  host_collection.save!
52
50
 
53
51
  final_count = host_collection.host_ids.count - pre_host_collection_count
54
- display_messages << _("Successfully added %{count} content host(s) to host collection %{host_collection}.") %
55
- {:count => final_count, :host_collection => host_collection.name }
52
+ msg = if final_count == 0
53
+ _("All selected hosts were already members of host collection %{host_collection}.") %
54
+ {:host_collection => host_collection.name }
55
+ else
56
+ _("Added %{count} host(s) to host collection %{host_collection}.") %
57
+ {:count => final_count, :host_collection => host_collection.name }
58
+ end
59
+ display_messages << msg
56
60
  end
57
61
  end
58
62
 
@@ -74,7 +78,7 @@ module Katello
74
78
  host_collection.save!
75
79
 
76
80
  final_count = pre_host_collection_count - host_collection.host_ids.count
77
- display_messages << _("Successfully removed %{count} content host(s) from host collection %{host_collection}.") %
81
+ display_messages << _("Removed %{count} host(s) from host collection %{host_collection}.") %
78
82
  {:count => final_count, :host_collection => host_collection.name }
79
83
  end
80
84
  end
@@ -106,49 +110,6 @@ module Katello
106
110
  respond_for_async :resource => task
107
111
  end
108
112
 
109
- api :PUT, "/hosts/bulk/remove_subscriptions", N_("Remove subscriptions from one or more hosts"), deprecated: true
110
- param_group :bulk_params
111
- param :subscriptions, Array, :desc => N_("Array of subscriptions to remove") do
112
- param :id, String, :desc => N_("Subscription Pool id"), :required => true
113
- param :quantity, Integer, :desc => N_("Quantity of specified subscription to remove"), :required => false
114
- end
115
- def remove_subscriptions
116
- #combine the quantities for duplicate pools into PoolWithQuantities objects
117
- pool_id_quantities = params.require(:subscriptions).inject({}) do |new_hash, subscription|
118
- new_hash[subscription['id']] ||= PoolWithQuantities.new(Pool.find(subscription['id']))
119
- new_hash[subscription['id']].quantities << subscription['quantity']
120
- new_hash
121
- end
122
- task = async_task(::Actions::BulkAction, ::Actions::Katello::Host::RemoveSubscriptions, @hosts, pool_id_quantities.values)
123
- respond_for_async :resource => task
124
- end
125
-
126
- api :PUT, "/hosts/bulk/add_subscriptions", N_("Add subscriptions to one or more hosts"), deprecated: true
127
- param_group :bulk_params
128
- param :subscriptions, Array, :desc => N_("Array of subscriptions to add"), :required => true do
129
- param :id, String, :desc => N_("Subscription Pool id"), :required => true
130
- param :quantity, :number, :desc => N_("Quantity of this subscriptions to add"), :required => true
131
- end
132
- def add_subscriptions
133
- if @organization.simple_content_access?
134
- fail HttpErrors::BadRequest, _("The specified organization is in Simple Content Access mode. Attaching subscriptions is disabled")
135
- end
136
-
137
- pools_with_quantities = params.require(:subscriptions).map do |sub_params|
138
- PoolWithQuantities.new(Pool.find(sub_params['id']), sub_params['quantity'])
139
- end
140
-
141
- task = async_task(::Actions::BulkAction, ::Actions::Katello::Host::AttachSubscriptions, @hosts, pools_with_quantities)
142
- respond_for_async :resource => task
143
- end
144
-
145
- api :PUT, "/hosts/bulk/auto_attach", N_("Trigger an auto-attach of subscriptions on one or more hosts"), deprecated: true
146
- param_group :bulk_params
147
- def auto_attach
148
- task = async_task(::Actions::BulkAction, ::Actions::Katello::Host::AutoAttachSubscriptions, @hosts)
149
- respond_for_async :resource => task
150
- end
151
-
152
113
  api :PUT, "/hosts/bulk/content_overrides", N_("Set content overrides to one or more hosts")
153
114
  param_group :bulk_params
154
115
  param :content_overrides, Array, :desc => N_("Array of Content override parameters") do
@@ -310,10 +271,6 @@ module Katello
310
271
  find_bulk_hosts(:destroy_hosts, params)
311
272
  end
312
273
 
313
- def validate_organization
314
- fail HttpErrors::BadRequest, _("Organization ID is required") if @organization.blank?
315
- end
316
-
317
274
  def validate_host_collection_membership_limit
318
275
  max_hosts_exceeded = []
319
276
  host_ids = @hosts.map(&:id)
@@ -676,7 +676,6 @@ Alternatively, use the 'force' parameter to regenerate metadata locally. On the
676
676
  root.deb_releases = repo_params[:deb_releases] if repo_params[:deb_releases]
677
677
  root.deb_components = repo_params[:deb_components] if repo_params[:deb_components]
678
678
  root.deb_architectures = repo_params[:deb_architectures] if repo_params[:deb_architectures]
679
- root.content_id = 'INITIAL_DUMMY_VALUE' unless Setting['deb_enable_structured_apt']
680
679
  end
681
680
 
682
681
  if root.ansible_collection?
@@ -14,6 +14,16 @@ module Katello
14
14
  super
15
15
  end
16
16
  end
17
+
18
+ def resource_scope(options = {})
19
+ scope = super(options)
20
+ # Eager load host_collections for index action to avoid N+1 queries
21
+ # Using preload to force loading even if not accessed
22
+ if params[:action] == 'index' && scope.respond_to?(:preload)
23
+ scope = scope.preload(:host_collections)
24
+ end
25
+ scope
26
+ end
17
27
  end
18
28
 
19
29
  included do
@@ -24,6 +24,9 @@ module Katello
24
24
  if taxonomy_class == Organization
25
25
  begin
26
26
  @taxonomy = Organization.new(resource_params)
27
+ # Raise validation error early if invalid
28
+ @taxonomy.validate!
29
+
27
30
  ::Katello::OrganizationCreator.new(@taxonomy).create!
28
31
  @taxonomy.reload
29
32
  switch_taxonomy
@@ -3,7 +3,6 @@ module Actions
3
3
  class ActivationKey::Create < Candlepin::Abstract
4
4
  input_format do
5
5
  param :organization_label
6
- param :auto_attach
7
6
  param :service_level
8
7
  param :release_version
9
8
  param :purpose_role
@@ -13,7 +12,6 @@ module Actions
13
12
  def run
14
13
  output[:response] = ::Katello::Resources::Candlepin::ActivationKey.create(::Katello::Util::Model.uuid,
15
14
  input[:organization_label],
16
- input[:auto_attach],
17
15
  input[:service_level],
18
16
  input[:release_version],
19
17
  input[:purpose_role],
@@ -6,7 +6,6 @@ module Actions
6
6
  param :cp_id
7
7
  param :release_version
8
8
  param :service_level
9
- param :auto_attach
10
9
  param :purpose_role
11
10
  param :purpose_usage
12
11
  end
@@ -16,7 +15,6 @@ module Actions
16
15
  input[:cp_id],
17
16
  input[:release_version],
18
17
  input[:service_level],
19
- input[:auto_attach],
20
18
  input[:purpose_role],
21
19
  input[:purpose_usage])
22
20
  end
@@ -16,12 +16,10 @@ module Actions
16
16
  def run
17
17
  content_url = input[:content_url]
18
18
  if input[:type] == ::Katello::Repository::DEB_TYPE
19
- # We must retrieve the repository in the run phase, so the latest Pulp version_href is
20
- # already set. This is needed to retrieve the latest repository.deb_content_url_options!
19
+ # We must retrieve the deb? repository in the run phase, so the latest Pulp version_href
20
+ # is set. This is needed to retrieve the latest repository.deb_content_url_options!
21
21
  repository = ::Katello::Repository.find(input[:repository_id])
22
- if repository.deb_using_structured_apt?
23
- content_url += repository.deb_content_url_options
24
- end
22
+ content_url += repository.deb_content_url_options
25
23
  end
26
24
 
27
25
  output[:response] = ::Katello::Resources::Candlepin::Content.
@@ -16,11 +16,10 @@ module Actions
16
16
  end
17
17
 
18
18
  def finalize
19
+ # finalize, because Katello::Product::ContentCreate updates repository.content_id during finalize!
19
20
  content_url = input[:content_url]
20
- # We must retrieve the repository in the finalize phase, because Katello::Product::ContentCreate
21
- # only updates the repository.content_id in the finalize phase!
22
21
  repository = ::Katello::Repository.find(input[:repository_id])
23
- if repository.deb_using_structured_apt?
22
+ if repository.deb?
24
23
  content_url += repository.deb_content_url_options
25
24
  end
26
25
 
@@ -2,7 +2,7 @@ module Actions
2
2
  module Helpers
3
3
  module RollingCVRepos
4
4
  def find_related_rolling_repos(repo)
5
- repo.root.repositories.in_environment(repo.environment).where(
5
+ repo.root.repositories.where(
6
6
  content_view_version: ::Katello::ContentViewVersion.where(content_view: ::Katello::ContentView.rolling)
7
7
  )
8
8
  end
@@ -6,7 +6,6 @@ module Actions
6
6
  activation_key.save!
7
7
  cp_create = plan_action(Candlepin::ActivationKey::Create,
8
8
  organization_label: activation_key.organization.label,
9
- auto_attach: activation_key.auto_attach,
10
9
  service_level: params[:service_level],
11
10
  release_version: activation_key.release_version,
12
11
  purpose_role: activation_key.purpose_role,
@@ -12,14 +12,12 @@ module Actions
12
12
  cp_id: activation_key.cp_id,
13
13
  release_version: activation_key.release_version,
14
14
  service_level: activation_key.service_level,
15
- auto_attach: activation_key.auto_attach,
16
15
  purpose_role: activation_key.purpose_role,
17
16
  purpose_usage: activation_key.purpose_usage)
18
17
  end
19
18
  end
20
19
 
21
20
  def update_candlepin?(activation_key, activation_key_params)
22
- cp_changed?(activation_key.auto_attach, activation_key_params[:auto_attach]) ||
23
21
  cp_changed?(activation_key.service_level, activation_key_params[:service_level]) ||
24
22
  cp_changed?(activation_key.release_version, activation_key_params[:release_version]) ||
25
23
  cp_changed?(activation_key.purpose_role, activation_key_params[:purpose_role]) ||
@@ -2,7 +2,6 @@ module Actions
2
2
  module Katello
3
3
  module CapsuleContent
4
4
  class SyncCapsule < ::Actions::EntryAction
5
- include Helpers::RollingCVRepos
6
5
  # rubocop:disable Metrics/MethodLength
7
6
  execution_plan_hooks.use :update_content_counts, :on => :success
8
7
  def plan(smart_proxy, options = {})
@@ -59,11 +58,7 @@ module Actions
59
58
  smart_proxy_helper.lifecycle_environment_check(environment, repository)
60
59
  if repository
61
60
  if skip_metatadata_check || !repository.smart_proxy_sync_histories.where(:smart_proxy_id => smart_proxy).any? { |sph| !sph.finished_at.nil? }
62
- if repository.library_instance?
63
- [repository] + find_related_rolling_repos(repository)
64
- else
65
- [repository]
66
- end
61
+ [repository]
67
62
  end
68
63
  else
69
64
  repositories = smart_proxy_helper.repositories_available_to_capsule(environment, content_view).by_rpm_count
@@ -6,7 +6,7 @@ module Actions
6
6
  action_subject gpg_key
7
7
  gpg_key.update!(gpg_key_params)
8
8
  gpg_key.repositories.each do |repository|
9
- if repository.content_type == ::Katello::Repository::DEB_TYPE
9
+ if repository.deb?
10
10
  plan_action(::Actions::Katello::Repository::RefreshRepository, repository)
11
11
  end
12
12
  end
@@ -2,36 +2,30 @@ module Actions
2
2
  module Katello
3
3
  module ContentView
4
4
  class AddRollingRepoClone < Actions::EntryAction
5
- include Helpers::SmartProxySyncHelper
6
-
7
- def plan(content_view, repository_ids)
8
- library = content_view.organization.library
5
+ def plan(content_view, repository_ids, environment_ids)
9
6
  clone_ids = []
7
+ environments = ::Katello::KTEnvironment.where(id: environment_ids)
8
+ repositories = ::Katello::Repository.where(id: repository_ids)
10
9
 
11
- concurrence do
12
- ::Katello::Repository.where(id: repository_ids).each do |repository|
13
- sequence do
14
- clone = content_view.get_repo_clone(library, repository).first
15
- if clone.nil?
16
- clone = repository.build_clone(content_view: content_view, environment: library)
17
- clone.save!
18
- end
19
- plan_action(RefreshRollingRepo, clone, false)
10
+ environments.each do |environment|
11
+ concurrence do
12
+ repositories.each do |repository|
13
+ sequence do
14
+ clone = content_view.get_repo_clone(environment, repository).first
15
+ if clone.nil?
16
+ clone = repository.build_clone(content_view: content_view, environment: environment)
17
+ clone.save!
18
+ end
19
+ plan_action(RefreshRollingRepo, clone, false)
20
20
 
21
- view_env_cp_id = content_view.content_view_environment(library).cp_id
22
- content_id = repository.content_id
23
- plan_action(Actions::Candlepin::Environment::AddContentToEnvironment, :view_env_cp_id => view_env_cp_id, :content_id => content_id)
24
- clone_ids << clone.id
21
+ view_env_cp_id = content_view.content_view_environment(environment).cp_id
22
+ content_id = repository.content_id
23
+ plan_action(Actions::Candlepin::Environment::AddContentToEnvironment, :view_env_cp_id => view_env_cp_id, :content_id => content_id)
24
+ clone_ids << clone.id
25
+ end
25
26
  end
26
27
  end
27
28
  end
28
- plan_self(repository_ids: clone_ids)
29
- end
30
-
31
- def run
32
- ::Katello::Repository.where(id: input[:repository_ids]).each do |repository|
33
- schedule_async_repository_proxy_sync(repository)
34
- end
35
29
  end
36
30
  end
37
31
  end
@@ -2,20 +2,25 @@ module Actions
2
2
  module Katello
3
3
  module ContentView
4
4
  class Create < Actions::Base
5
- def plan(content_view)
5
+ def plan(content_view, environment_ids = [])
6
6
  content_view.save!
7
7
  if content_view.rolling?
8
- plan_action(AddToEnvironment, content_view.create_new_version, content_view.organization.library)
8
+ new_version = content_view.create_new_version
9
+ if environment_ids&.any?
10
+ ::Katello::KTEnvironment.where(id: environment_ids).each do |environment|
11
+ plan_action(AddToEnvironment, new_version, environment)
12
+ end
13
+ end
9
14
  repository_ids = content_view.repository_ids
10
15
  if repository_ids.any?
11
16
  content_view.reload
12
- plan_action(AddRollingRepoClone, content_view, repository_ids)
17
+ plan_action(AddRollingRepoClone, content_view, repository_ids, environment_ids)
13
18
  end
14
19
  end
15
20
  end
16
21
 
17
22
  def humanized_name
18
- _("Create")
23
+ _("Create content view")
19
24
  end
20
25
  end
21
26
  end
@@ -2,6 +2,8 @@ module Actions
2
2
  module Katello
3
3
  module ContentView
4
4
  class RefreshRollingRepo < Actions::EntryAction
5
+ include Helpers::SmartProxySyncHelper
6
+
5
7
  def plan(repository, contents_changed)
6
8
  action_subject repository
7
9
  sequence do
@@ -23,8 +25,10 @@ module Actions
23
25
  repository.last_contents_changed = DateTime.now if repository.version_href != library_instance.version_href
24
26
 
25
27
  repository.version_href = library_instance.version_href
28
+ repository.version_prn = library_instance.version_prn
26
29
  repository.publication_href = library_instance.publication_href
27
- if repository.deb_using_structured_apt?
30
+ repository.publication_prn = library_instance.publication_prn
31
+ if repository.deb?
28
32
  repository.content_id = library_instance.content_id
29
33
  end
30
34
  repository.save!
@@ -33,6 +37,7 @@ module Actions
33
37
  def finalize
34
38
  repository = ::Katello::Repository.find(input[:repository_id])
35
39
  repository.clear_smart_proxy_sync_histories if input[:contents_changed]
40
+ schedule_async_repository_proxy_sync(repository)
36
41
  end
37
42
  end
38
43
  end
@@ -2,21 +2,26 @@ module Actions
2
2
  module Katello
3
3
  module ContentView
4
4
  class RemoveRollingRepoClone < Actions::EntryAction
5
- def plan(content_view, repository_ids)
6
- library = content_view.organization.library
5
+ def plan(content_view, repository_ids, environment_ids)
6
+ clone_ids = []
7
+ environments = ::Katello::KTEnvironment.where(id: environment_ids)
8
+ repositories = ::Katello::Repository.where(id: repository_ids)
7
9
 
8
- clone_repo_ids = []
9
- concurrence do
10
- ::Katello::Repository.where(id: repository_ids).each do |repository|
11
- clone_repo = content_view.get_repo_clone(library, repository).first
12
- next if clone_repo.nil?
10
+ sequence do
11
+ environments.each do |environment|
12
+ concurrence do
13
+ repositories.each do |repository|
14
+ clone_repo = content_view.get_repo_clone(environment, repository).first
15
+ next if clone_repo.nil?
13
16
 
14
- clone_repo_ids << clone_repo.id
15
- plan_action(Actions::Pulp3::Repository::DeleteDistributions, clone_repo.id, SmartProxy.pulp_primary)
17
+ clone_ids << clone_repo.id
18
+ plan_action(Actions::Pulp3::Repository::DeleteDistributions, clone_repo.id, SmartProxy.pulp_primary)
19
+ end
20
+ plan_action(Candlepin::Environment::SetContent, content_view, environment, content_view.content_view_environment(environment))
21
+ end
16
22
  end
17
- plan_action(Candlepin::Environment::SetContent, content_view, library, content_view.content_view_environment(library))
23
+ plan_self(repository_ids: clone_ids)
18
24
  end
19
- plan_self(repository_ids: clone_repo_ids)
20
25
  end
21
26
 
22
27
  def run
@@ -2,7 +2,7 @@ module Actions
2
2
  module Katello
3
3
  module ContentView
4
4
  class Update < Actions::EntryAction
5
- def plan(content_view, content_view_params)
5
+ def plan(content_view, content_view_params, environment_ids)
6
6
  action_subject content_view
7
7
  content_view_params = content_view_params.with_indifferent_access
8
8
 
@@ -28,15 +28,42 @@ module Actions
28
28
  end
29
29
  end
30
30
 
31
- if content_view.rolling? && content_view_params.key?(:repository_ids)
32
- repo_ids_to_add = content_view_params[:repository_ids] - content_view.repository_ids
33
- repo_ids_to_remove = content_view.repository_ids - content_view_params[:repository_ids]
31
+ handle_rolling_content_view(content_view, content_view_params[:repository_ids], environment_ids)
32
+ content_view.update!(content_view_params)
33
+ end
34
34
 
35
- plan_action(AddRollingRepoClone, content_view, repo_ids_to_add) if repo_ids_to_add.any?
36
- plan_action(RemoveRollingRepoClone, content_view, repo_ids_to_remove) if repo_ids_to_remove.any?
35
+ def handle_rolling_content_view(content_view, target_repo_ids, target_env_ids)
36
+ return unless content_view.rolling?
37
+
38
+ add_repo_ids, remove_repo_ids, retain_repo_ids = translate_id_lists(content_view.repository_ids, target_repo_ids)
39
+
40
+ if target_env_ids.nil?
41
+ target_env_ids = retain_env_ids = content_view.environment_ids
42
+ else
43
+ add_env_ids, remove_env_ids, retain_env_ids = translate_id_lists(content_view.environment_ids, target_env_ids)
44
+ ::Katello::KTEnvironment.where(id: add_env_ids).each do |environment|
45
+ plan_action(AddToEnvironment, content_view.versions[0], environment)
46
+ end
47
+ plan_action(AddRollingRepoClone, content_view, retain_repo_ids, add_env_ids) if retain_repo_ids.any? && add_env_ids.any?
48
+ ::Katello::KTEnvironment.where(id: remove_env_ids).each do |environment|
49
+ plan_action(RemoveFromEnvironment, content_view, environment)
50
+ end
37
51
  end
38
52
 
39
- content_view.update!(content_view_params)
53
+ plan_action(AddRollingRepoClone, content_view, add_repo_ids, target_env_ids) if add_repo_ids.any?
54
+ plan_action(RemoveRollingRepoClone, content_view, remove_repo_ids, retain_env_ids) if remove_repo_ids.any?
55
+ end
56
+
57
+ def translate_id_lists(current_ids, target_ids)
58
+ if target_ids.nil?
59
+ add_ids = remove_ids = []
60
+ retain_ids = current_ids
61
+ else
62
+ add_ids = target_ids - current_ids
63
+ remove_ids = current_ids - target_ids
64
+ retain_ids = current_ids - remove_ids
65
+ end
66
+ return add_ids, remove_ids, retain_ids
40
67
  end
41
68
  end
42
69
  end
@@ -7,7 +7,7 @@ module Actions
7
7
  def plan(repository)
8
8
  root = repository.root
9
9
  sequence do
10
- if repository.content_id.nil? || repository.content_id == 'INITIAL_DUMMY_VALUE'
10
+ if repository.content_id.nil?
11
11
  content_create = plan_action(Candlepin::Product::ContentCreate,
12
12
  repository_id: repository.id,
13
13
  owner: root.organization.label,
@@ -45,7 +45,7 @@ module Actions
45
45
  def finalize
46
46
  root = ::Katello::RootRepository.find(input[:root_repository_id])
47
47
  content_url = root.custom_content_path
48
- if root.deb_using_structured_apt?
48
+ if root.deb?
49
49
  repository = ::Katello::Repository.find(input[:repository_id])
50
50
  content_url += repository.deb_content_url_options
51
51
  repository.update(:content_id => input[:content_id])
@@ -15,7 +15,7 @@ module Actions
15
15
  ::Katello::ProductContent.where(product_id: root_repository.product_id,
16
16
  content_id: katello_content_id).destroy_all
17
17
 
18
- if root_repository.repositories.count <= 1 || repository.deb_using_structured_apt?
18
+ if root_repository.repositories.count <= 1 || repository.deb?
19
19
  plan_action(Candlepin::Product::ContentDestroy,
20
20
  owner: root_repository.product.organization.label,
21
21
  content_id: repository.content_id)
@@ -27,7 +27,7 @@ module Actions
27
27
  output[:matching_content] = srpms_match && rpms && errata && package_groups && distributions && target_repo_published && checksum_match
28
28
  end
29
29
 
30
- if source_repo.content_type == ::Katello::Repository::DEB_TYPE
30
+ if source_repo.deb?
31
31
  debs = debs_match?(source_repo, target_repo)
32
32
 
33
33
  output[:matching_content] = debs && target_repo_published
@@ -26,7 +26,7 @@ module Actions
26
26
  index_options = {id: new_repository.id, force_index: true}
27
27
  index_options[:source_repository_id] = source_repositories.first.id if source_repositories.count == 1 && filters.empty? && rpm_filenames.nil?
28
28
 
29
- if new_repository.deb_using_structured_apt? && generate_metadata
29
+ if new_repository.deb? && generate_metadata
30
30
  plan_action(Candlepin::Product::ContentUpdate,
31
31
  owner: new_repository.organization.label,
32
32
  repository_id: new_repository.id,
@@ -64,7 +64,7 @@ module Actions
64
64
  end
65
65
 
66
66
  def create_content?(repository, clone)
67
- if repository.deb_using_structured_apt?
67
+ if repository.deb?
68
68
  return true
69
69
  elsif clone || repository.content
70
70
  return false
@@ -86,10 +86,10 @@ module Actions
86
86
  end
87
87
 
88
88
  def handle_custom_content(repository, remove_from_content_view_versions)
89
- #if this is the last instance of a custom repo or a deb repo using structured APT, destroy the content
90
- if remove_from_content_view_versions || repository.root.repositories.where.not(id: repository.id).empty? || repository.deb_using_structured_apt?
91
- # Never destroy content for structured apt rolling repo clones, because it belongs to the library instance
92
- return if repository.deb_using_structured_apt? && repository.content_view.rolling?
89
+ # If this is the last instance of a custom repo or a deb repo, then destroy the content
90
+ if remove_from_content_view_versions || repository.root.repositories.where.not(id: repository.id).empty? || repository.deb?
91
+ # Never destroy content for deb rolling repo clones, it belongs to the library instance!
92
+ return if repository.deb? && repository.content_view.rolling?
93
93
 
94
94
  plan_action(::Actions::Katello::Product::ContentDestroy, repository)
95
95
  end
@@ -15,7 +15,7 @@ module Actions
15
15
  generate_metadata = options.fetch(:generate_metadata, true)
16
16
  plan_action(Katello::Repository::MetadataGenerate, repository, :dependency => import_upload_task, :force_publication => true) if generate_metadata
17
17
 
18
- if repository.deb_using_structured_apt? && generate_metadata
18
+ if repository.deb? && generate_metadata
19
19
  plan_action(::Actions::Candlepin::Product::ContentUpdate,
20
20
  owner: repository.organization.label,
21
21
  repository_id: repository.id,
@@ -101,7 +101,7 @@ module Actions
101
101
  end
102
102
 
103
103
  def update_deb_content(repo)
104
- return unless repo.deb_using_structured_apt?
104
+ return unless repo.deb?
105
105
 
106
106
  plan_action(::Actions::Candlepin::Product::ContentUpdate,
107
107
  owner: repo.organization.label,
@@ -39,7 +39,7 @@ module Actions
39
39
  else
40
40
  plan_self(source_version_repo_id: source_repositories.first.id,
41
41
  target_repo_id: target_repo.id)
42
- target_repo.update!(version_href: source_repositories.first.version_href)
42
+ target_repo.update!(version_href: source_repositories.first.version_href, version_prn: source_repositories.first.version_prn)
43
43
  end
44
44
  end
45
45
 
@@ -47,7 +47,7 @@ module Actions
47
47
  #this is a 'simple' copy, so just reference version_href
48
48
  target_repo = ::Katello::Repository.find(input[:target_repo_id])
49
49
  source_repo = ::Katello::Repository.find(input[:source_version_repo_id])
50
- target_repo.update!(version_href: source_repo.version_href)
50
+ target_repo.update!(version_href: source_repo.version_href, version_prn: source_repo.version_prn)
51
51
  end
52
52
  end
53
53
  end
@@ -33,7 +33,7 @@ module Actions
33
33
  if (target_repo.publication_href != source_repo.publication_href && smart_proxy.pulp_primary?)
34
34
  target_repo.clear_smart_proxy_sync_histories
35
35
  end
36
- target_repo.update!(publication_href: source_repo.publication_href)
36
+ target_repo.update!(publication_href: source_repo.publication_href, publication_prn: source_repo.publication_prn)
37
37
  end
38
38
  end
39
39
  end
@@ -31,7 +31,7 @@ module Actions
31
31
  input[:repo_id_map].each do |source_repo_id, dest_repo_id|
32
32
  dest_repo = ::Katello::Repository.find(dest_repo_id)
33
33
  source_repo = ::Katello::Repository.find(source_repo_id)
34
- dest_repo.update!(version_href: source_repo.version_href)
34
+ dest_repo.update!(version_href: source_repo.version_href, version_prn: source_repo.version_prn)
35
35
  end
36
36
  end
37
37
  end
@@ -12,7 +12,9 @@ module Actions
12
12
  publication_href = input[:tasks][:pulp_tasks].first[:created_resources].first
13
13
  if publication_href
14
14
  repo = ::Katello::Repository.find(input[:repository_id])
15
- repo.update(:publication_href => publication_href)
15
+ repo_backend_service = repo.backend_service(SmartProxy.pulp_primary)
16
+ publication = repo_backend_service.api.publications_api.read(publication_href, {fields: 'prn'})
17
+ repo.update(:publication_href => publication_href, :publication_prn => publication.prn)
16
18
  end
17
19
  end
18
20
  end