katello 4.18.0 → 4.19.0.rc1

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 (345) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/katello/locale/bn/katello.js +52 -349
  3. data/app/assets/javascripts/katello/locale/bn_IN/katello.js +52 -349
  4. data/app/assets/javascripts/katello/locale/ca/katello.js +52 -349
  5. data/app/assets/javascripts/katello/locale/cs/katello.js +53 -350
  6. data/app/assets/javascripts/katello/locale/cs_CZ/katello.js +54 -351
  7. data/app/assets/javascripts/katello/locale/de/katello.js +56 -353
  8. data/app/assets/javascripts/katello/locale/de_AT/katello.js +52 -349
  9. data/app/assets/javascripts/katello/locale/de_DE/katello.js +52 -349
  10. data/app/assets/javascripts/katello/locale/el/katello.js +54 -351
  11. data/app/assets/javascripts/katello/locale/en/katello.js +53 -350
  12. data/app/assets/javascripts/katello/locale/en_GB/katello.js +53 -350
  13. data/app/assets/javascripts/katello/locale/en_US/katello.js +52 -349
  14. data/app/assets/javascripts/katello/locale/es/katello.js +56 -353
  15. data/app/assets/javascripts/katello/locale/et_EE/katello.js +52 -349
  16. data/app/assets/javascripts/katello/locale/fr/katello.js +138 -435
  17. data/app/assets/javascripts/katello/locale/gl/katello.js +52 -349
  18. data/app/assets/javascripts/katello/locale/gu/katello.js +52 -349
  19. data/app/assets/javascripts/katello/locale/he_IL/katello.js +52 -349
  20. data/app/assets/javascripts/katello/locale/hi/katello.js +52 -349
  21. data/app/assets/javascripts/katello/locale/id/katello.js +52 -349
  22. data/app/assets/javascripts/katello/locale/it/katello.js +53 -350
  23. data/app/assets/javascripts/katello/locale/ja/katello.js +142 -439
  24. data/app/assets/javascripts/katello/locale/ka/katello.js +56 -353
  25. data/app/assets/javascripts/katello/locale/kn/katello.js +52 -349
  26. data/app/assets/javascripts/katello/locale/ko/katello.js +135 -432
  27. data/app/assets/javascripts/katello/locale/ml_IN/katello.js +52 -349
  28. data/app/assets/javascripts/katello/locale/mr/katello.js +52 -349
  29. data/app/assets/javascripts/katello/locale/nl_NL/katello.js +52 -349
  30. data/app/assets/javascripts/katello/locale/or/katello.js +52 -349
  31. data/app/assets/javascripts/katello/locale/pa/katello.js +52 -349
  32. data/app/assets/javascripts/katello/locale/pl/katello.js +52 -349
  33. data/app/assets/javascripts/katello/locale/pl_PL/katello.js +52 -349
  34. data/app/assets/javascripts/katello/locale/pt/katello.js +52 -349
  35. data/app/assets/javascripts/katello/locale/pt_BR/katello.js +56 -353
  36. data/app/assets/javascripts/katello/locale/ro/katello.js +52 -349
  37. data/app/assets/javascripts/katello/locale/ro_RO/katello.js +52 -349
  38. data/app/assets/javascripts/katello/locale/ru/katello.js +54 -351
  39. data/app/assets/javascripts/katello/locale/sl/katello.js +52 -349
  40. data/app/assets/javascripts/katello/locale/sv_SE/katello.js +52 -349
  41. data/app/assets/javascripts/katello/locale/ta/katello.js +52 -349
  42. data/app/assets/javascripts/katello/locale/ta_IN/katello.js +52 -349
  43. data/app/assets/javascripts/katello/locale/te/katello.js +52 -349
  44. data/app/assets/javascripts/katello/locale/tr/katello.js +52 -349
  45. data/app/assets/javascripts/katello/locale/vi/katello.js +52 -349
  46. data/app/assets/javascripts/katello/locale/vi_VN/katello.js +52 -349
  47. data/app/assets/javascripts/katello/locale/zh/katello.js +52 -349
  48. data/app/assets/javascripts/katello/locale/zh_CN/katello.js +135 -432
  49. data/app/assets/javascripts/katello/locale/zh_TW/katello.js +54 -351
  50. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +46 -13
  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_export_incrementals_controller.rb +56 -34
  54. data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +1 -1
  55. data/app/controllers/katello/api/v2/content_views_controller.rb +18 -3
  56. data/app/controllers/katello/api/v2/debs_controller.rb +21 -11
  57. data/app/controllers/katello/api/v2/docker_tags_controller.rb +7 -0
  58. data/app/controllers/katello/api/v2/errata_controller.rb +4 -4
  59. data/app/controllers/katello/api/v2/flatpak_remote_repositories_controller.rb +21 -19
  60. data/app/controllers/katello/api/v2/host_debs_controller.rb +16 -1
  61. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +3 -60
  62. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +10 -53
  63. data/app/controllers/katello/api/v2/repositories_controller.rb +0 -1
  64. data/app/controllers/katello/concerns/organizations_controller_extensions.rb +3 -0
  65. data/app/lib/actions/candlepin/activation_key/create.rb +0 -2
  66. data/app/lib/actions/candlepin/activation_key/update.rb +0 -2
  67. data/app/lib/actions/candlepin/product/content_create.rb +3 -5
  68. data/app/lib/actions/candlepin/product/content_update.rb +2 -3
  69. data/app/lib/actions/helpers/rolling_cv_repos.rb +1 -1
  70. data/app/lib/actions/katello/activation_key/create.rb +0 -1
  71. data/app/lib/actions/katello/activation_key/update.rb +0 -2
  72. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +1 -6
  73. data/app/lib/actions/katello/content_credential/update.rb +1 -1
  74. data/app/lib/actions/katello/content_view/add_rolling_repo_clone.rb +18 -24
  75. data/app/lib/actions/katello/content_view/create.rb +9 -4
  76. data/app/lib/actions/katello/content_view/publish.rb +7 -7
  77. data/app/lib/actions/katello/content_view/refresh_rolling_repo.rb +6 -1
  78. data/app/lib/actions/katello/content_view/remove_rolling_repo_clone.rb +16 -11
  79. data/app/lib/actions/katello/content_view/update.rb +34 -7
  80. data/app/lib/actions/katello/product/content_create.rb +2 -2
  81. data/app/lib/actions/katello/product/content_destroy.rb +1 -1
  82. data/app/lib/actions/katello/repository/check_matching_content.rb +1 -1
  83. data/app/lib/actions/katello/repository/clone_contents.rb +1 -1
  84. data/app/lib/actions/katello/repository/create.rb +1 -1
  85. data/app/lib/actions/katello/repository/destroy.rb +4 -4
  86. data/app/lib/actions/katello/repository/finish_upload.rb +1 -1
  87. data/app/lib/actions/katello/repository/sync.rb +1 -1
  88. data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +2 -2
  89. data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +1 -1
  90. data/app/lib/actions/pulp3/orchestration/repository/multi_copy_all_units.rb +1 -1
  91. data/app/lib/actions/pulp3/repository/save_publication.rb +3 -1
  92. data/app/lib/actions/pulp3/repository/save_version.rb +45 -24
  93. data/app/lib/actions/pulp3/repository/save_versions.rb +2 -1
  94. data/app/lib/katello/resources/candlepin/activation_key.rb +3 -4
  95. data/app/lib/katello/resources/candlepin/upstream_job.rb +9 -1
  96. data/app/lib/katello/resources/candlepin.rb +4 -0
  97. data/app/models/katello/authorization/repository.rb +17 -4
  98. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +0 -7
  99. data/app/models/katello/content_view_deb_filter.rb +10 -0
  100. data/app/models/katello/content_view_deb_filter_rule.rb +7 -0
  101. data/app/models/katello/deb.rb +10 -12
  102. data/app/models/katello/erratum.rb +1 -1
  103. data/app/models/katello/glue/provider.rb +14 -3
  104. data/app/models/katello/host/content_facet.rb +1 -1
  105. data/app/models/katello/host/subscription_facet.rb +1 -7
  106. data/app/models/katello/product_content.rb +2 -2
  107. data/app/models/katello/repository.rb +4 -23
  108. data/app/models/katello/root_repository.rb +2 -5
  109. data/app/services/katello/candlepin/event_handler.rb +0 -33
  110. data/app/services/katello/candlepin/message_handler.rb +0 -41
  111. data/app/services/katello/content_unit_indexer.rb +59 -13
  112. data/app/services/katello/product_content_finder.rb +16 -7
  113. data/app/services/katello/pulp3/alternate_content_source.rb +2 -2
  114. data/app/services/katello/pulp3/ansible_collection.rb +1 -0
  115. data/app/services/katello/pulp3/api/content_guard.rb +5 -5
  116. data/app/services/katello/pulp3/api/core.rb +10 -0
  117. data/app/services/katello/pulp3/content_view_version/export.rb +25 -10
  118. data/app/services/katello/pulp3/deb.rb +1 -0
  119. data/app/services/katello/pulp3/docker_manifest.rb +1 -0
  120. data/app/services/katello/pulp3/docker_manifest_list.rb +1 -0
  121. data/app/services/katello/pulp3/docker_tag.rb +1 -0
  122. data/app/services/katello/pulp3/file_unit.rb +1 -0
  123. data/app/services/katello/pulp3/generic_content_unit.rb +1 -0
  124. data/app/services/katello/pulp3/module_stream.rb +1 -0
  125. data/app/services/katello/pulp3/package_group.rb +1 -0
  126. data/app/services/katello/pulp3/repository/apt.rb +30 -13
  127. data/app/services/katello/pulp3/repository.rb +59 -10
  128. data/app/services/katello/pulp3/rpm.rb +3 -2
  129. data/app/services/katello/pulp3/srpm.rb +3 -2
  130. data/app/services/katello/pulp3/task_group.rb +1 -1
  131. data/app/services/katello/registration_manager.rb +19 -17
  132. data/app/services/katello/repository_type_manager.rb +7 -5
  133. data/app/services/katello/smart_proxy_helper.rb +1 -6
  134. data/app/views/foreman/job_templates/upload_profile.erb +5 -0
  135. data/app/views/katello/api/v2/activation_keys/base.json.rabl +1 -1
  136. data/app/views/katello/api/v2/content_views/base.json.rabl +1 -0
  137. data/app/views/katello/api/v2/debs/thindex.json.rabl +6 -0
  138. data/app/views/katello/api/v2/docker_tags/_base.json.rabl +32 -0
  139. data/app/views/katello/api/v2/docker_tags/show.json.rabl +0 -5
  140. data/app/views/katello/api/v2/flatpak_remotes/index.json.rabl +6 -0
  141. data/app/views/katello/api/v2/host_debs/installed_debs.json.rabl +6 -0
  142. data/app/views/katello/api/v2/hosts_bulk_actions/applicable_errata.json.rabl +1 -1
  143. data/app/views/katello/api/v2/hosts_bulk_actions/applicable_erratum.json.rabl +9 -0
  144. data/app/views/katello/api/v2/hosts_bulk_actions/installable_errata.json.rabl +1 -1
  145. data/app/views/katello/api/v2/hosts_bulk_actions/{erratum.json.rabl → installable_erratum.json.rabl} +3 -3
  146. data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
  147. data/config/initializers/monkeys.rb +1 -0
  148. data/config/routes/api/v2.rb +2 -2
  149. data/config/routes/overrides.rb +2 -7
  150. data/config/routes.rb +2 -0
  151. data/db/migrate/20211019192121_create_cdn_configuration.katello.rb +1 -1
  152. data/db/migrate/20250912000000_add_pulp_prn_fields.rb +73 -0
  153. data/db/migrate/20250912000001_populate_pulp_prn_fields.rb +403 -0
  154. data/db/migrate/20251009142516_remove_auto_attach_from_activation_keys.rb +5 -0
  155. data/db/migrate/20251009142517_remove_autoheal_from_subscription_facets.rb +5 -0
  156. data/db/seeds.d/111-upgrade_tasks.rb +2 -0
  157. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/el.po +2 -2
  158. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +6 -1
  159. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +5 -2
  160. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +5 -2
  161. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +5 -2
  162. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +4 -4
  163. data/lib/katello/permission_creator.rb +2 -2
  164. data/lib/katello/permissions/host_permissions.rb +0 -6
  165. data/lib/katello/plugin.rb +16 -8
  166. data/lib/katello/tasks/jenkins.rake +1 -1
  167. data/lib/katello/tasks/upgrades/4.19/enable_structured_apt_for_deb.rake +87 -0
  168. data/lib/katello/tasks/upgrades/4.19/populate_repository_version_prns.rake +32 -0
  169. data/lib/katello/version.rb +1 -1
  170. data/lib/monkeys/fix_rpm_repository_gpgcheck.rb +38 -0
  171. data/locale/bn/LC_MESSAGES/katello.mo +0 -0
  172. data/locale/bn/katello.po +52 -349
  173. data/locale/bn_IN/LC_MESSAGES/katello.mo +0 -0
  174. data/locale/bn_IN/katello.po +52 -349
  175. data/locale/ca/LC_MESSAGES/katello.mo +0 -0
  176. data/locale/ca/katello.po +52 -349
  177. data/locale/cs/LC_MESSAGES/katello.mo +0 -0
  178. data/locale/cs/katello.po +54 -350
  179. data/locale/cs_CZ/LC_MESSAGES/katello.mo +0 -0
  180. data/locale/cs_CZ/katello.po +54 -351
  181. data/locale/de/LC_MESSAGES/katello.mo +0 -0
  182. data/locale/de/katello.po +56 -353
  183. data/locale/de_AT/LC_MESSAGES/katello.mo +0 -0
  184. data/locale/de_AT/katello.po +52 -349
  185. data/locale/de_DE/LC_MESSAGES/katello.mo +0 -0
  186. data/locale/de_DE/katello.po +52 -349
  187. data/locale/el/LC_MESSAGES/katello.mo +0 -0
  188. data/locale/el/katello.po +55 -352
  189. data/locale/en/LC_MESSAGES/katello.mo +0 -0
  190. data/locale/en/katello.po +54 -350
  191. data/locale/en_GB/LC_MESSAGES/katello.mo +0 -0
  192. data/locale/en_GB/katello.po +53 -350
  193. data/locale/en_US/LC_MESSAGES/katello.mo +0 -0
  194. data/locale/en_US/katello.po +52 -349
  195. data/locale/es/LC_MESSAGES/katello.mo +0 -0
  196. data/locale/es/katello.po +56 -353
  197. data/locale/et_EE/LC_MESSAGES/katello.mo +0 -0
  198. data/locale/et_EE/katello.po +52 -349
  199. data/locale/fr/LC_MESSAGES/katello.mo +0 -0
  200. data/locale/fr/katello.po +139 -435
  201. data/locale/gl/LC_MESSAGES/katello.mo +0 -0
  202. data/locale/gl/katello.po +52 -349
  203. data/locale/gu/LC_MESSAGES/katello.mo +0 -0
  204. data/locale/gu/katello.po +52 -349
  205. data/locale/he_IL/LC_MESSAGES/katello.mo +0 -0
  206. data/locale/he_IL/katello.po +52 -349
  207. data/locale/hi/LC_MESSAGES/katello.mo +0 -0
  208. data/locale/hi/katello.po +52 -349
  209. data/locale/id/LC_MESSAGES/katello.mo +0 -0
  210. data/locale/id/katello.po +52 -349
  211. data/locale/it/LC_MESSAGES/katello.mo +0 -0
  212. data/locale/it/katello.po +53 -350
  213. data/locale/ja/LC_MESSAGES/katello.mo +0 -0
  214. data/locale/ja/katello.po +143 -439
  215. data/locale/ka/LC_MESSAGES/katello.mo +0 -0
  216. data/locale/ka/katello.po +56 -353
  217. data/locale/katello.pot +695 -1152
  218. data/locale/kn/LC_MESSAGES/katello.mo +0 -0
  219. data/locale/kn/katello.po +52 -349
  220. data/locale/ko/LC_MESSAGES/katello.mo +0 -0
  221. data/locale/ko/katello.po +136 -432
  222. data/locale/ml_IN/LC_MESSAGES/katello.mo +0 -0
  223. data/locale/ml_IN/katello.po +52 -349
  224. data/locale/mr/LC_MESSAGES/katello.mo +0 -0
  225. data/locale/mr/katello.po +52 -349
  226. data/locale/nl_NL/LC_MESSAGES/katello.mo +0 -0
  227. data/locale/nl_NL/katello.po +52 -349
  228. data/locale/or/LC_MESSAGES/katello.mo +0 -0
  229. data/locale/or/katello.po +52 -349
  230. data/locale/pa/LC_MESSAGES/katello.mo +0 -0
  231. data/locale/pa/katello.po +52 -349
  232. data/locale/pl/LC_MESSAGES/katello.mo +0 -0
  233. data/locale/pl/katello.po +52 -349
  234. data/locale/pl_PL/LC_MESSAGES/katello.mo +0 -0
  235. data/locale/pl_PL/katello.po +52 -349
  236. data/locale/pt/LC_MESSAGES/katello.mo +0 -0
  237. data/locale/pt/katello.po +52 -349
  238. data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
  239. data/locale/pt_BR/katello.po +56 -353
  240. data/locale/ro/LC_MESSAGES/katello.mo +0 -0
  241. data/locale/ro/katello.po +52 -349
  242. data/locale/ro_RO/LC_MESSAGES/katello.mo +0 -0
  243. data/locale/ro_RO/katello.po +52 -349
  244. data/locale/ru/LC_MESSAGES/katello.mo +0 -0
  245. data/locale/ru/katello.po +54 -351
  246. data/locale/sl/LC_MESSAGES/katello.mo +0 -0
  247. data/locale/sl/katello.po +52 -349
  248. data/locale/sv_SE/LC_MESSAGES/katello.mo +0 -0
  249. data/locale/sv_SE/katello.po +52 -349
  250. data/locale/ta/LC_MESSAGES/katello.mo +0 -0
  251. data/locale/ta/katello.po +52 -349
  252. data/locale/ta_IN/LC_MESSAGES/katello.mo +0 -0
  253. data/locale/ta_IN/katello.po +52 -349
  254. data/locale/te/LC_MESSAGES/katello.mo +0 -0
  255. data/locale/te/katello.po +52 -349
  256. data/locale/tr/LC_MESSAGES/katello.mo +0 -0
  257. data/locale/tr/katello.po +52 -349
  258. data/locale/vi/LC_MESSAGES/katello.mo +0 -0
  259. data/locale/vi/katello.po +52 -349
  260. data/locale/vi_VN/LC_MESSAGES/katello.mo +0 -0
  261. data/locale/vi_VN/katello.po +52 -349
  262. data/locale/zh/LC_MESSAGES/katello.mo +0 -0
  263. data/locale/zh/katello.po +52 -349
  264. data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
  265. data/locale/zh_CN/katello.po +136 -432
  266. data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
  267. data/locale/zh_TW/katello.po +54 -351
  268. data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetails.test.js.snap +2 -2
  269. data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js +0 -2
  270. data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/__tests__/SystemPurposeEditModal.test.js +0 -2
  271. data/webpack/components/extensions/Hosts/ActionsBar/index.js +1 -0
  272. data/webpack/components/extensions/Hosts/BulkActions/BulkActionsConstants.js +7 -0
  273. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/BulkChangeHostCollectionsModal.js +388 -0
  274. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/__tests__/BulkChangeHostCollectionsModal.test.js +640 -0
  275. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/actions.js +28 -0
  276. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/index.js +71 -0
  277. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/BulkErrataWizard.js +1 -1
  278. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/02_BulkPackagesTable.js +10 -3
  279. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js +51 -24
  280. data/webpack/components/extensions/Hosts/BulkActions/HostReview.js +7 -0
  281. data/webpack/containers/Application/config.js +11 -1
  282. data/webpack/global_index.js +3 -0
  283. data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/BootedContainerImagesConstants.js +1 -1
  284. data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/BootedContainerImagesPage.js +7 -43
  285. data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/__tests__/bootedContainerImagesPage.test.js +1 -1
  286. data/webpack/scenes/ContainerImages/ContainerImagesPage.js +86 -0
  287. data/webpack/scenes/ContainerImages/LabelsAnnotationsModal.js +105 -0
  288. data/webpack/scenes/ContainerImages/Synced/Details/ManifestDetails.js +218 -0
  289. data/webpack/scenes/ContainerImages/Synced/Details/ManifestDetailsActions.js +15 -0
  290. data/webpack/scenes/ContainerImages/Synced/Details/ManifestDetailsSelectors.js +16 -0
  291. data/webpack/scenes/ContainerImages/Synced/Details/__tests__/ManifestDetails.test.js +395 -0
  292. data/webpack/scenes/ContainerImages/Synced/Details/__tests__/manifestDetails.fixtures.json +43 -0
  293. data/webpack/scenes/ContainerImages/Synced/Details/__tests__/manifestList.fixtures.json +58 -0
  294. data/webpack/scenes/ContainerImages/Synced/Details/index.js +4 -0
  295. data/webpack/scenes/ContainerImages/Synced/SyncedContainerImagesPage.js +359 -0
  296. data/webpack/scenes/ContainerImages/Synced/SyncedContainerImagesPage.scss +21 -0
  297. data/webpack/scenes/ContainerImages/Synced/__tests__/LabelsAnnotationsModal.test.js +69 -0
  298. data/webpack/scenes/ContainerImages/Synced/__tests__/SyncedContainerImagesPage.test.js +335 -0
  299. data/webpack/scenes/ContainerImages/Synced/__tests__/syncedContainerImages.fixtures.json +105 -0
  300. data/webpack/scenes/ContainerImages/TableEmptyState.js +67 -0
  301. data/webpack/scenes/ContainerImages/containerImagesHelpers.js +48 -0
  302. data/webpack/scenes/ContainerImages/index.js +4 -0
  303. data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +29 -3
  304. data/webpack/scenes/ContentViews/Create/__tests__/contentViewCreateResult.fixtures.json +1 -0
  305. data/webpack/scenes/ContentViews/Create/__tests__/createContentView.test.js +45 -1
  306. data/webpack/scenes/ContentViews/Delete/__tests__/affectedHosts.fixtures.json +0 -1
  307. data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +59 -1
  308. data/webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js +1 -0
  309. data/webpack/scenes/ContentViews/Details/Filters/Rules/DebPackage/AddEditDebPackageRuleModal.js +164 -24
  310. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVDebFilterContent.test.js +268 -0
  311. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvDebFilterDetail.fixtures.json +95 -0
  312. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvDebFilterRules.fixtures.json +31 -0
  313. data/webpack/scenes/ContentViews/Details/Filters/__tests__/emptyCVDebFilterRules.fixtures.json +10 -0
  314. data/webpack/scenes/ContentViews/Details/Versions/BulkDelete/__tests__/hosts.fixtures.json +0 -1
  315. data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvAffectedHosts.fixture.json +0 -1
  316. data/webpack/scenes/ContentViews/Details/__tests__/contentViewRollingDetail.test.js +15 -0
  317. data/webpack/scenes/ContentViews/Details/__tests__/contentViewRollingDetails.fixtures.json +1 -0
  318. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +9 -0
  319. data/webpack/scenes/FlatpakRemotes/CreateEdit/CreateFlatpakRemoteModal.js +5 -3
  320. data/webpack/scenes/FlatpakRemotes/CreateEdit/EditFlatpakRemotesModal.js +1 -1
  321. data/webpack/scenes/FlatpakRemotes/CreateEdit/FlatpakRemoteform.js +35 -3
  322. data/webpack/scenes/FlatpakRemotes/Details/FlatpakRemoteDetails.js +1 -1
  323. data/webpack/scenes/FlatpakRemotes/Details/RemoteRepositories/RemoteRepositoriesTable.css +3 -0
  324. data/webpack/scenes/FlatpakRemotes/Details/RemoteRepositories/RemoteRepositoriesTable.js +63 -132
  325. data/webpack/scenes/FlatpakRemotes/FlatpakRemotesPage.js +67 -143
  326. data/webpack/scenes/SmartProxy/ExpandableCvDetails.js +10 -2
  327. data/webpack/scenes/SmartProxy/SmartProxyContentActions.js +13 -2
  328. data/webpack/scenes/SmartProxy/SmartProxyContentConstants.js +1 -0
  329. data/webpack/scenes/SmartProxy/SmartProxyExpandableTable.js +8 -2
  330. data/webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js +67 -1
  331. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +2 -2
  332. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +0 -2
  333. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsActions.test.js.snap +2 -2
  334. metadata +83 -55
  335. data/app/lib/actions/katello/host/attach_subscriptions.rb +0 -59
  336. data/app/lib/actions/katello/host/auto_attach_subscriptions.rb +0 -22
  337. data/app/lib/actions/katello/host/remove_subscriptions.rb +0 -50
  338. data/app/lib/actions/katello/organization/simple_content_access/disable.rb +0 -25
  339. data/app/lib/actions/katello/organization/simple_content_access/enable.rb +0 -25
  340. data/app/lib/actions/katello/organization/simple_content_access/toggle.rb +0 -42
  341. data/lib/katello/tasks/migrate_structure_content_for_deb.rake +0 -105
  342. data/lib/katello/tasks/upgrades/4.2/remove_checksum_values.rake +0 -17
  343. data/locale/action_names.rb +0 -186
  344. /data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/__tests__/bootedContainerImages.fixtures.js +0 -0
  345. /data/webpack/scenes/{BootedContainerImages → ContainerImages/Booted}/index.js +0 -0
@@ -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
@@ -9,35 +9,56 @@ module Actions
9
9
 
10
10
  def run
11
11
  repo = ::Katello::Repository.find(input[:repository_id])
12
- if input[:force_fetch_version]
13
- version_href = fetch_version_href(repo)
14
- elsif input[:repository_details].present?
15
- version_href = input[:repository_details][:latest_version_href]
16
- elsif input[:tasks].present?
17
- version_href = ::Katello::Pulp3::Task.version_href(input[:tasks])
18
- else
19
- version_href = fetch_version_href(repo)
20
- end
12
+ version_href = determine_version_href(repo)
13
+
14
+ save_publication_if_present(repo)
15
+ save_version_if_changed(repo, version_href)
16
+ end
17
+
18
+ def determine_version_href(repo)
19
+ return fetch_version_href(repo) if input[:force_fetch_version]
20
+ return input[:repository_details][:latest_version_href] if input[:repository_details].present?
21
+ return ::Katello::Pulp3::Task.version_href(input[:tasks]) if input[:tasks].present?
22
+ fetch_version_href(repo)
23
+ end
21
24
 
25
+ def save_publication_if_present(repo)
22
26
  output[:publication_provided] = false
23
- if input[:tasks].present? && (publication_href = ::Katello::Pulp3::Task.publication_href(input[:tasks]))
24
- repo.update(:publication_href => publication_href)
25
- output[:publication_provided] = true
26
- end
27
+ return if input[:tasks].blank?
28
+
29
+ publication_href = ::Katello::Pulp3::Task.publication_href(input[:tasks])
30
+ return unless publication_href
27
31
 
32
+ repo_backend_service = repo.backend_service(SmartProxy.pulp_primary)
33
+ publication = repo_backend_service.api.publications_api.read(publication_href, {fields: 'prn'})
34
+ repo.update(:publication_href => publication_href, :publication_prn => publication.prn)
35
+ output[:publication_provided] = true
36
+ end
37
+
38
+ def save_version_if_changed(repo, version_href)
28
39
  if version_href
29
- if repo.version_href != version_href || input[:force_fetch_version]
30
- output[:contents_changed] = true
31
- repo.update(:last_contents_changed => DateTime.now)
32
- repo.update(:version_href => version_href)
33
- end
40
+ update_version_if_changed(repo, version_href)
41
+ else
42
+ check_publication_version_match(repo)
43
+ end
44
+ end
45
+
46
+ def update_version_if_changed(repo, version_href)
47
+ return unless repo.version_href != version_href || input[:force_fetch_version]
48
+
49
+ output[:contents_changed] = true
50
+ repo.update(:last_contents_changed => DateTime.now)
51
+ repo_backend_service = repo.backend_service(SmartProxy.pulp_primary)
52
+ version = repo_backend_service.api.repository_versions_api.read(version_href, {fields: 'prn'})
53
+ repo.update(:version_href => version_href, :version_prn => version.prn)
54
+ end
55
+
56
+ def check_publication_version_match(repo)
57
+ # get publication and check if repo-version and publication match. Otherwise, contents_changed: false
58
+ if !repo.repository_type.pulp3_skip_publication && fetch_current_published_version_href(repo) != repo.version_href
59
+ output[:contents_changed] = true
34
60
  else
35
- # get publication and check if repo-version and publication match. Otherwise, contents_changed: false
36
- if !repo.repository_type.pulp3_skip_publication && fetch_current_published_version_href(repo) != repo.version_href
37
- output[:contents_changed] = true
38
- else
39
- output[:contents_changed] = false
40
- end
61
+ output[:contents_changed] = false
41
62
  end
42
63
  end
43
64
 
@@ -37,7 +37,8 @@ module Actions
37
37
  end
38
38
 
39
39
  unless new_version_href == repo.version_href
40
- repo.update(version_href: new_version_href)
40
+ version = repo_backend_service.api.repository_versions_api.read(new_version_href, {fields: 'prn'})
41
+ repo.update(version_href: new_version_href, version_prn: version.prn)
41
42
  repo.index_content
42
43
  output[:contents_changed] = true
43
44
  output[:updated_repositories] << repo.id
@@ -10,11 +10,10 @@ module Katello
10
10
  ::Katello::Util::Data.array_with_indifferent_access akeys
11
11
  end
12
12
 
13
- def create(name, owner_key, auto_attach, service_level, release_version, purpose_role, purpose_usage)
13
+ def create(name, owner_key, service_level, release_version, purpose_role, purpose_usage)
14
14
  url = "/candlepin/owners/#{owner_key}/activation_keys"
15
15
  params = {
16
16
  name: name,
17
- autoAttach: auto_attach,
18
17
  serviceLevel: service_level,
19
18
  releaseVer: release_version,
20
19
  role: purpose_role,
@@ -24,8 +23,8 @@ module Katello
24
23
  JSON.parse(response.body).with_indifferent_access
25
24
  end
26
25
 
27
- def update(id, release_version, service_level, auto_attach, purpose_role, purpose_usage)
28
- attrs = { :releaseVer => release_version, :serviceLevel => service_level, :autoAttach => auto_attach, :role => purpose_role, :usage => purpose_usage }.delete_if { |_k, v| v.nil? }
26
+ def update(id, release_version, service_level, purpose_role, purpose_usage)
27
+ attrs = { :releaseVer => release_version, :serviceLevel => service_level, :role => purpose_role, :usage => purpose_usage }.delete_if { |_k, v| v.nil? }
29
28
  JSON.parse(self.put(path(id), attrs.to_json, self.default_headers).body).with_indifferent_access
30
29
  end
31
30
 
@@ -5,13 +5,14 @@ module Katello
5
5
  class << self
6
6
  NOT_FINISHED_STATES = %w(CREATED WAITING PENDING RUNNING).freeze unless defined? NOT_FINISHED_STATES
7
7
  API_URL = 'https://subscription.rhsm.redhat.com/subscription'.freeze
8
+ SUBSCRIPTION_PATH = '/subscription'.freeze
8
9
 
9
10
  def not_finished?(job)
10
11
  NOT_FINISHED_STATES.include?(job[:state])
11
12
  end
12
13
 
13
14
  def get(id, upstream)
14
- url = ENV['REDHAT_RHSM_API_URL'] || API_URL
15
+ url = subscription_path(ENV['REDHAT_RHSM_API_URL']) || subscription_path(upstream['apiUrl']) || API_URL
15
16
  response = Resources::Candlepin::UpstreamConsumer.start_upstream_export("#{url}#{path(id)}", upstream['idCert']['cert'],
16
17
  upstream['idCert']['key'], nil)
17
18
  job = JSON.parse(response)
@@ -21,6 +22,13 @@ module Katello
21
22
  def path(id = nil)
22
23
  "/jobs/#{id}"
23
24
  end
25
+
26
+ def subscription_path(upstream_api_url)
27
+ return if upstream_api_url.blank?
28
+ uri = URI.parse(upstream_api_url) # https://subscription.rhsm.redhat.com/subscription/consumers/
29
+ uri.path = SUBSCRIPTION_PATH # https://subscription.rhsm.redhat.com/subscription
30
+ uri.to_s
31
+ end
24
32
  end
25
33
  end
26
34
  end
@@ -88,6 +88,10 @@ module Katello
88
88
  class << self
89
89
  delegate :[], to: :json_resource
90
90
 
91
+ def default_headers(uuid = nil)
92
+ super(uuid).except('cp-user', 'cp-consumer')
93
+ end
94
+
91
95
  def resource(options = {}, url: self.site + self.path, client_cert: self.client_cert, client_key: self.client_key, ca_file: nil)
92
96
  cert_store = OpenSSL::X509::Store.new
93
97
  cert_store.add_file(ca_file) if ca_file
@@ -39,14 +39,27 @@ module Katello
39
39
 
40
40
  def readable_docker_catalog(host = nil)
41
41
  if host
42
- repo_ids = nil
42
+ repo_ids = []
43
43
  if host&.content_view_environments&.any?
44
44
  repo_ids = host.content_view_environments.flat_map do |cve|
45
- cve&.content_view_version&.repositories&.where(environment_id: cve.environment)&.non_archived&.docker_type&.pluck(:id)
45
+ cve&.content_view_version&.repositories&.where(environment_id: cve.environment)&.pluck(:id)
46
46
  end
47
+ repo_ids = repo_ids.compact.uniq
48
+ end
49
+
50
+ base_scope = Katello::Repository.non_archived.docker_type
51
+ host_repos = base_scope.where(id: repo_ids)
52
+
53
+ table_name = Repository.table_name
54
+ in_unauth_environments = Repository.joins(:environment)
55
+ .where("#{Katello::KTEnvironment.table_name}.registry_unauthenticated_pull" => true)
56
+ .select(:id)
57
+
58
+ if in_unauth_environments.exists?
59
+ return host_repos.or(base_scope.joins(:root).where("#{table_name}.id in (?)", in_unauth_environments))
60
+ else
61
+ return host_repos
47
62
  end
48
- repos = Katello::Repository.where(id: repo_ids)
49
- return repos
50
63
  end
51
64
  readable_docker_catalog_as(User.current)
52
65
  end
@@ -21,7 +21,6 @@ module Katello
21
21
  scoped_search on: :status, relation: :rhel_lifecycle_status_object, rename: :rhel_lifecycle_status, complete_value: rhel_lifecycle_status_map
22
22
 
23
23
  scoped_search :on => :release_version, :relation => :subscription_facet, :complete_value => true, :only_explicit => true
24
- scoped_search :on => :autoheal, :relation => :subscription_facet, :complete_value => true, :only_explicit => true
25
24
  scoped_search :on => :service_level, :relation => :subscription_facet, :complete_value => true, :only_explicit => true
26
25
  scoped_search :on => :last_checkin, :relation => :subscription_facet, :complete_value => true, :only_explicit => true
27
26
  scoped_search :on => :registered_through, :relation => :subscription_facet, :complete_value => true, :only_explicit => true
@@ -45,8 +44,6 @@ module Katello
45
44
  content_facet.cves_changed = false if content_facet
46
45
  content_facet&.save!
47
46
 
48
- auto_attach_enabled_via_checkin = consumer_params.try(:[], 'autoheal')
49
-
50
47
  if subscription_facet
51
48
  consumer_params ||= subscription_facet.consumer_attributes
52
49
 
@@ -59,10 +56,6 @@ module Katello
59
56
  end
60
57
  ::Katello::Resources::Candlepin::Consumer.update(subscription_facet.uuid, consumer_params)
61
58
 
62
- if auto_attach_enabled_via_checkin
63
- ::Katello::Resources::Candlepin::Consumer.refresh_entitlements(subscription_facet.uuid)
64
- end
65
-
66
59
  if consumer_params.try(:[], :facts)
67
60
  ::Katello::Host::SubscriptionFacet.update_facts(self, consumer_params[:facts])
68
61
  end
@@ -13,6 +13,8 @@ module Katello
13
13
  package_filenames.concat(query_debs(repo, rule))
14
14
  end
15
15
 
16
+ package_filenames = package_filenames.uniq.sort
17
+
16
18
  ContentViewDebFilter.generate_deb_clauses(package_filenames)
17
19
  end
18
20
 
@@ -21,6 +23,9 @@ module Katello
21
23
  self.deb_rules.each do |rule|
22
24
  deb_filenames.concat(query_debs(repo, rule))
23
25
  end
26
+
27
+ deb_filenames = deb_filenames.uniq
28
+
24
29
  debs = Deb.in_repositories(repo)
25
30
  debs.where(filename: deb_filenames).pluck(:pulp_id).flatten.uniq
26
31
  end
@@ -45,6 +50,11 @@ module Katello
45
50
  query_arch = rule.architecture.tr("*", "%")
46
51
  query = query.where("#{Deb.table_name}.architecture ilike ?", query_arch)
47
52
  end
53
+ if rule.version.present?
54
+ query = query.search_version_equal(rule.version)
55
+ elsif rule.min_version.present? || rule.max_version.present?
56
+ query = query.search_version_range(rule.min_version, rule.max_version)
57
+ end
48
58
  query.default_sort
49
59
  end
50
60
  end
@@ -10,10 +10,17 @@ module Katello
10
10
  validates :name, :presence => true
11
11
  validate :ensure_unique_attributes
12
12
  validates_with Validators::ContentViewFilterVersionValidator
13
+ scoped_search :on => :version, :complete_value => true
14
+ scoped_search :on => :min_version, :complete_value => true
15
+ scoped_search :on => :max_version, :complete_value => true
16
+ scoped_search :on => :architecture, :complete_value => true
13
17
 
14
18
  def ensure_unique_attributes
15
19
  other = self.class.where(:name => self.name,
20
+ :version => self.version,
16
21
  :content_view_filter_id => self.content_view_filter_id,
22
+ :min_version => self.min_version,
23
+ :max_version => self.max_version,
17
24
  :architecture => self.architecture)
18
25
  other = other.where.not(:id => self.id) if self.id
19
26
  if other.exists?
@@ -4,8 +4,6 @@ module Katello
4
4
 
5
5
  CONTENT_TYPE = 'deb'.freeze
6
6
 
7
- has_many :repository_debs, :class_name => "Katello::RepositoryDeb", :dependent => :destroy, :inverse_of => :deb
8
- has_many :repositories, :through => :repository_debs, :class_name => "Katello::Repository"
9
7
  has_many :content_facet_applicable_debs, :class_name => "Katello::ContentFacetApplicableDeb",
10
8
  :dependent => :destroy, :inverse_of => :deb
11
9
  has_many :content_facets, :through => :content_facet_applicable_debs, :class_name => "Katello::Host::ContentFacet"
@@ -29,16 +27,16 @@ module Katello
29
27
  ContentFacetApplicableDeb
30
28
  end
31
29
 
32
- def self.search_version_range(min = nil, max = nil)
33
- query = self.all
34
- query = Katello::Util::PackageFilter.new(query, min, Katello::Util::PackageFilter::GREATER_THAN).results if min
35
- query = Katello::Util::PackageFilter.new(query, max, Katello::Util::PackageFilter::LESS_THAN).results if max
36
- query
37
- end
30
+ scope :search_version_equal, ->(ver) {
31
+ where("deb_version_cmp(#{::Katello::Deb.table_name}.version, ?) = 0", ver)
32
+ }
38
33
 
39
- def self.search_version_equal(version)
40
- Katello::Util::PackageFilter.new(self, version, Katello::Util::PackageFilter::EQUAL).results
41
- end
34
+ scope :search_version_range, ->(min_ver, max_ver) {
35
+ query = all
36
+ query = query.where("deb_version_cmp(#{::Katello::Deb.table_name}.version, ?) >= 0", min_ver) if min_ver.present?
37
+ query = query.where("deb_version_cmp(#{::Katello::Deb.table_name}.version, ?) <= 0", max_ver) if max_ver.present?
38
+ query
39
+ }
42
40
 
43
41
  def self.total_for_repositories(repos)
44
42
  self.in_repositories(repos).count
@@ -98,7 +96,7 @@ module Katello
98
96
 
99
97
  # Return deb packages that are not installed on a host, but could be installed
100
98
  # the word 'installable' has a different meaning here than elsewhere
101
- def self.apt_installable_for_host(host)
99
+ def self.deb_installable_for_host(host)
102
100
  repos = host.content_facet.bound_repositories.pluck(:id)
103
101
  Katello::Deb.in_repositories(repos).where.not(name: host.installed_debs.pluck(:name)).order(:name)
104
102
  end
@@ -227,7 +227,7 @@ module Katello
227
227
  property :summary, String, desc: 'Returns the errata summary, the length can very, it is usually in range of 60 to 1000 characters. It can include empty line characters.'
228
228
  end
229
229
  class Jail < ::Safemode::Jail
230
- allow :errata_id, :errata_type, :issued, :created_at, :severity, :package_names, :cves, :reboot_suggested, :title, :summary
230
+ allow :errata_id, :errata_type, :issued, :updated, :created_at, :severity, :package_names, :cves, :reboot_suggested, :title, :summary
231
231
  end
232
232
  end
233
233
  end
@@ -31,10 +31,21 @@ module Katello
31
31
  end
32
32
 
33
33
  module InstanceMethods
34
- API_URL = 'https://subscription.rhsm.redhat.com/subscription/consumers/'.freeze
34
+ API_BASE_URL = 'https://subscription.rhsm.redhat.com'.freeze
35
+ SUBSCRIPTION_PATH = '/subscription'.freeze
36
+ CONSUMERS_PATH = '/consumers/'.freeze
37
+ API_URL = API_BASE_URL + SUBSCRIPTION_PATH + CONSUMERS_PATH # https://subscription.rhsm.redhat.com/subscription/consumers/
38
+
39
+ def normalize_api_url(api_url)
40
+ return nil if api_url.blank?
41
+ uri = URI.parse(api_url)
42
+ # only take base url; we will overwrite the path to ensure it's correct
43
+ uri.path = SUBSCRIPTION_PATH + CONSUMERS_PATH # https://subscription.rhsm.redhat.com/subscription/consumers/
44
+ uri.to_s
45
+ end
46
+
35
47
  def api_url(upstream = {})
36
- # Default to Red Hat
37
- ENV['REDHAT_RHSM_API_URL'] || upstream['apiUrl'] || API_URL
48
+ ENV['REDHAT_RHSM_API_URL'] || normalize_api_url(upstream['apiUrl']) || API_URL
38
49
  end
39
50
 
40
51
  def sync
@@ -202,7 +202,7 @@ module Katello
202
202
  # "/pulp/content/Org/Library/custom/Test_product/test2/%3Fcomp%3Dmain%26rel%3Dstable"]
203
203
  paths.each do |path|
204
204
  if (prefix = prefixes.find { |pre| path.start_with?(pre) })
205
- # strip prefix and structured_apt postfix before adding to relative_paths
205
+ # strip prefix and deb? content postfix before adding to relative_paths
206
206
  relative_paths << path.sub(prefix, '').sub(%r{/?(%3F|\?).*}, '')
207
207
  else
208
208
  Rails.logger.warn("System #{self.host.name} (#{self.host.id}) requested binding to repo with unknown prefix. #{path}")
@@ -51,7 +51,6 @@ module Katello
51
51
  self.dmi_uuid = consumer_params['facts']['dmi.system.uuid']
52
52
  end
53
53
 
54
- self.autoheal = consumer_params['autoheal'] unless consumer_params['autoheal'].nil?
55
54
  self.service_level = consumer_params['serviceLevel'] unless consumer_params['serviceLevel'].nil?
56
55
  self.registered_at = consumer_params['created'] unless consumer_params['created'].blank?
57
56
  self.last_checkin = consumer_params['lastCheckin'] unless consumer_params['lastCheckin'].blank?
@@ -130,7 +129,6 @@ module Katello
130
129
 
131
130
  def consumer_attributes
132
131
  attrs = {
133
- :autoheal => autoheal,
134
132
  :usage => purpose_usage,
135
133
  :role => purpose_role,
136
134
  :serviceLevel => service_level,
@@ -257,10 +255,6 @@ module Katello
257
255
  Katello::Product.joins(:subscriptions => {:pools => :subscription_facets}).where("#{Katello::Host::SubscriptionFacet.table_name}.id" => self.id).enabled.uniq
258
256
  end
259
257
 
260
- def remove_subscriptions(pools_with_quantities)
261
- ForemanTasks.sync_task(Actions::Katello::Host::RemoveSubscriptions, self.host, pools_with_quantities)
262
- end
263
-
264
258
  def self.sanitize_name(name)
265
259
  name.gsub('_', '-').chomp('.').downcase
266
260
  end
@@ -274,7 +268,7 @@ module Katello
274
268
  end
275
269
 
276
270
  def backend_update_needed?
277
- %w(release_version service_level autoheal purpose_role purpose_usage).each do |method|
271
+ %w(release_version service_level purpose_role purpose_usage).each do |method|
278
272
  if self.send("#{method}_changed?")
279
273
  Rails.logger.debug("backend_update_needed: subscription facet #{method} changed")
280
274
  return true
@@ -46,8 +46,8 @@ module Katello
46
46
 
47
47
  def self.enabled(organization)
48
48
  content_ids = Katello::RootRepository.in_organization(organization).where.not(content_id: nil).pluck(:content_id)
49
- structured_apt_content_ids = Katello::Repository.in_organization(organization).library.pluck(:content_id)
50
- joins(:content).where("#{self.content_table_name}.cp_content_id" => content_ids + structured_apt_content_ids)
49
+ deb_content_ids = Katello::Repository.in_organization(organization).library.deb_type.pluck(:content_id)
50
+ joins(:content).where("#{self.content_table_name}.cp_content_id" => content_ids + deb_content_ids)
51
51
  end
52
52
 
53
53
  def self.with_valid_subscription(organization)
@@ -170,7 +170,7 @@ module Katello
170
170
  scoped_search :on => :label, :relation => :root, :complete_value => true, :only_explicit => true
171
171
  scoped_search :on => :content_label, :ext_method => :search_by_content_label, :default_operator => :like
172
172
 
173
- delegate :product, :redhat?, :custom?, :deb_using_structured_apt?, :to => :root
173
+ delegate :product, :redhat?, :custom?, :to => :root
174
174
  delegate :yum?, :docker?, :deb?, :file?, :ostree?, :ansible_collection?, :generic?, :to => :root
175
175
  delegate :name, :label, :docker_upstream_name, :url, :download_concurrency, :to => :root
176
176
 
@@ -1046,32 +1046,13 @@ module Katello
1046
1046
 
1047
1047
  def deb_content_url_options
1048
1048
  return '' unless version_href
1049
- return '' if backend_service(SmartProxy.pulp_primary).version_missing_structure_content?
1050
1049
 
1051
- components = deb_pulp_components.join(',')
1052
- distributions = deb_pulp_distributions.join(',')
1050
+ backend_service = self.backend_service(SmartProxy.pulp_primary)
1051
+ components = backend_service.pulp_components.join(',')
1052
+ distributions = backend_service.pulp_distributions.join(',')
1053
1053
  "/?comp=#{components}&rel=#{distributions}"
1054
1054
  end
1055
1055
 
1056
- def deb_pulp_components(version_href = self.version_href)
1057
- return [] if version_href.blank?
1058
-
1059
- pulp_api = Katello::Pulp3::Repository.instance_for_type(self, SmartProxy.pulp_primary).api.content_release_components_api
1060
- pulp_api.list({:repository_version => version_href}).results.map { |x| x.plain_component }.uniq
1061
- end
1062
-
1063
- def deb_sanitize_pulp_distribution(distribution)
1064
- return "flat-repo" if distribution == "/"
1065
- return distribution.chomp("/") if distribution&.end_with?("/")
1066
- distribution
1067
- end
1068
-
1069
- def deb_pulp_distributions(version_href = self.version_href)
1070
- return [] if version_href.blank?
1071
- pulp_api = Katello::Pulp3::Repository.instance_for_type(self, SmartProxy.pulp_primary).api.content_release_components_api
1072
- pulp_api.list({:repository_version => version_href}).results.map { |x| deb_sanitize_pulp_distribution(x.distribution) }.uniq
1073
- end
1074
-
1075
1056
  def sync_status
1076
1057
  return latest_dynflow_sync
1077
1058
  end
@@ -389,10 +389,6 @@ module Katello
389
389
  self.content_type == Repository::DEB_TYPE
390
390
  end
391
391
 
392
- def deb_using_structured_apt?
393
- self.deb? && !self.content_id
394
- end
395
-
396
392
  def ansible_collection?
397
393
  self.content_type == Repository::ANSIBLE_COLLECTION_TYPE
398
394
  end
@@ -446,7 +442,8 @@ module Katello
446
442
  end
447
443
 
448
444
  def format_arches
449
- if content_type == ::Katello::Repository::DEB_TYPE
445
+ if self.deb?
446
+ # Pulp 2 needed a "," separated string-list, but Pulp 3 needs " " separated!
450
447
  self.deb_architectures&.gsub(" ", ",")
451
448
  else
452
449
  self.arch == "noarch" ? nil : self.arch
@@ -15,46 +15,13 @@ module Katello
15
15
  @message_handler = ::Katello::Candlepin::MessageHandler.new(message)
16
16
  data[:entity_id] = @message_handler.entity_id
17
17
  case message_handler.subject
18
- when /entitlement\.created/
19
- message_handler.import_pool
20
- message_handler.create_pool_on_host
21
- when /entitlement\.deleted/
22
- message_handler.import_pool
23
- message_handler.remove_pool_from_host
24
18
  when /pool\.created/
25
19
  message_handler.import_pool
26
20
  when /pool\.deleted/
27
21
  message_handler.delete_pool
28
- when /^compliance\.created/
29
- event_no_longer_handled
30
- when /system_purpose_compliance\.created/
31
- event_no_longer_handled
32
- when /owner_content_access_mode\.modified/
33
- message_handler.handle_content_access_mode_modified
34
22
  end
35
23
  end
36
24
  end
37
-
38
- private
39
-
40
- def event_no_longer_handled
41
- @logger.error "Received #{message_handler.subject} event from Candlepin. Handling of this event is no longer supported."
42
- end
43
-
44
- def subscription_facet
45
- message_handler.subscription_facet
46
- end
47
-
48
- def reindex_consumer
49
- if subscription_facet.nil?
50
- @logger.debug "skip re-indexing of non-existent content host #{message_handler.consumer_uuid}"
51
- return
52
- end
53
-
54
- @logger.debug "re-indexing content host #{subscription_facet.host.name}"
55
-
56
- yield
57
- end
58
25
  end
59
26
  end
60
27
  end