katello 4.7.6 → 4.8.0.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


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

Files changed (365) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +6 -4
  3. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +15 -12
  4. data/app/controllers/katello/api/v2/capsule_content_controller.rb +0 -4
  5. data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +22 -81
  6. data/app/controllers/katello/api/v2/content_exports_controller.rb +11 -80
  7. data/app/controllers/katello/api/v2/content_imports_controller.rb +1 -0
  8. data/app/controllers/katello/api/v2/exports_controller.rb +130 -0
  9. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +7 -8
  10. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +8 -4
  11. data/app/controllers/katello/api/v2/organizations_controller.rb +3 -0
  12. data/app/controllers/katello/api/v2/package_groups_controller.rb +0 -52
  13. data/app/controllers/katello/api/v2/simple_content_access_controller.rb +1 -3
  14. data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +4 -6
  15. data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +1 -2
  16. data/app/controllers/katello/concerns/authorization/api/v2/content_views_controller.rb +4 -1
  17. data/app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb +24 -0
  18. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +3 -3
  19. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +55 -24
  20. data/app/helpers/katello/katello_urls_helper.rb +0 -15
  21. data/app/helpers/katello/sync_management_helper.rb +0 -4
  22. data/app/lib/actions/candlepin/owner/destroy_imports.rb +1 -1
  23. data/app/lib/actions/katello/capsule_content/sync.rb +0 -4
  24. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +1 -2
  25. data/app/lib/actions/katello/content_view/publish.rb +6 -2
  26. data/app/lib/actions/katello/content_view/remove.rb +8 -2
  27. data/app/lib/actions/katello/content_view_version/destroy.rb +1 -1
  28. data/app/lib/actions/katello/environment/destroy.rb +8 -2
  29. data/app/lib/actions/katello/host/reassign.rb +4 -2
  30. data/app/lib/actions/katello/organization/simple_content_access/enable.rb +0 -10
  31. data/app/lib/actions/katello/organization/simple_content_access/toggle.rb +2 -12
  32. data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +0 -1
  33. data/app/lib/actions/katello/product/destroy.rb +2 -1
  34. data/app/lib/actions/katello/repository/filtered_index_content.rb +2 -10
  35. data/app/lib/actions/katello/repository/import_upload.rb +0 -1
  36. data/app/lib/actions/katello/repository/sync.rb +0 -1
  37. data/app/lib/actions/katello/repository/update.rb +5 -3
  38. data/app/lib/actions/katello/repository/upload_files.rb +0 -1
  39. data/app/lib/actions/pulp3/abstract.rb +0 -6
  40. data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -2
  41. data/app/lib/actions/pulp3/content_view_version/create_syncable_export_history.rb +4 -0
  42. data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +1 -0
  43. data/app/lib/actions/pulp3/orchestration/content_view_version/export_repository.rb +7 -2
  44. data/app/lib/actions/pulp3/orchestration/content_view_version/syncable_export.rb +7 -2
  45. data/app/lib/actions/pulp3/repository/refresh_distribution.rb +1 -2
  46. data/app/lib/actions/pulp3/repository/save_distribution_references.rb +2 -2
  47. data/app/lib/katello/concerns/base_template_scope_extensions.rb +1 -1
  48. data/app/lib/katello/concerns/renderer_extensions.rb +1 -1
  49. data/app/lib/katello/event_daemon/runner.rb +12 -9
  50. data/app/lib/katello/resources/candlepin/consumer.rb +6 -6
  51. data/app/lib/katello/resources/candlepin/owner.rb +1 -1
  52. data/app/lib/katello/resources/candlepin/upstream_consumer.rb +3 -4
  53. data/app/lib/katello/resources/candlepin.rb +4 -4
  54. data/app/lib/katello/util/errata.rb +12 -10
  55. data/app/lib/katello/util/search.rb +0 -1
  56. data/app/lib/katello/validators/content_view_environment_org_validator.rb +5 -2
  57. data/app/lib/katello/validators/content_view_environment_validator.rb +1 -2
  58. data/app/lib/katello/validators/generated_content_view_validator.rb +16 -0
  59. data/app/mailers/katello/errata_mailer.rb +4 -2
  60. data/app/models/katello/alternate_content_source.rb +5 -1
  61. data/app/models/katello/concerns/content_facet_host_extensions.rb +25 -14
  62. data/app/models/katello/concerns/host_managed_extensions.rb +17 -8
  63. data/app/models/katello/concerns/redhat_extensions.rb +16 -6
  64. data/app/models/katello/concerns/smart_proxy_extensions.rb +0 -12
  65. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +1 -0
  66. data/app/models/katello/content_view.rb +22 -5
  67. data/app/models/katello/content_view_environment.rb +11 -2
  68. data/app/models/katello/content_view_environment_content_facet.rb +9 -0
  69. data/app/models/katello/content_view_version.rb +10 -5
  70. data/app/models/katello/erratum.rb +6 -1
  71. data/app/models/katello/glue/candlepin/pool.rb +6 -0
  72. data/app/models/katello/glue/candlepin/product.rb +7 -1
  73. data/app/models/katello/glue/candlepin/subscription.rb +5 -0
  74. data/app/models/katello/glue/provider.rb +26 -26
  75. data/app/models/katello/host/content_facet.rb +106 -18
  76. data/app/models/katello/host/info_provider.rb +25 -21
  77. data/app/models/katello/host/subscription_facet.rb +18 -14
  78. data/app/models/katello/kt_environment.rb +12 -7
  79. data/app/models/katello/package_group.rb +0 -12
  80. data/app/models/katello/pool.rb +4 -1
  81. data/app/models/katello/product.rb +11 -1
  82. data/app/models/katello/product_content.rb +0 -4
  83. data/app/models/katello/repository.rb +11 -11
  84. data/app/models/katello/root_repository.rb +4 -3
  85. data/app/models/katello/task_status.rb +0 -18
  86. data/app/services/katello/candlepin/consumer.rb +2 -2
  87. data/app/services/katello/host/package_profile_uploader.rb +1 -1
  88. data/app/services/katello/product_content_finder.rb +11 -12
  89. data/app/services/katello/pulp3/content_view_version/export.rb +8 -65
  90. data/app/services/katello/pulp3/content_view_version/export_validation_error.rb +7 -0
  91. data/app/services/katello/pulp3/content_view_version/export_validator.rb +105 -0
  92. data/app/services/katello/pulp3/content_view_version/importable_products.rb +1 -1
  93. data/app/services/katello/pulp3/content_view_version/syncable_format_export.rb +7 -1
  94. data/app/services/katello/pulp3/erratum.rb +1 -0
  95. data/app/services/katello/pulp3/module_stream.rb +26 -11
  96. data/app/services/katello/pulp3/repository/yum.rb +2 -1
  97. data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +2 -1
  98. data/app/services/katello/registration_manager.rb +46 -26
  99. data/app/services/katello/repository_type.rb +3 -9
  100. data/app/services/katello/simple_package.rb +22 -0
  101. data/app/views/foreman/smart_proxies/_content_sync.html.erb +1 -0
  102. data/app/views/foreman/smart_proxies/_reclaim_space.html.erb +1 -0
  103. data/app/views/katello/api/v2/content_facet/base.json.rabl +23 -2
  104. data/app/views/katello/api/v2/content_facet/show.json.rabl +11 -8
  105. data/app/views/katello/api/v2/content_views/base.json.rabl +1 -1
  106. data/app/views/katello/api/v2/hosts/base.json.rabl +22 -2
  107. data/app/views/overrides/activation_keys/_host_environment_select.html.erb +2 -2
  108. data/config/initializers/monkeys.rb +0 -2
  109. data/config/routes/api/registry.rb +8 -7
  110. data/config/routes/api/v2.rb +0 -2
  111. data/config/routes.rb +3 -0
  112. data/db/migrate/20200429153103_installed_package_bad_nvrea.rb +1 -1
  113. data/db/migrate/20220110223754_update_disconnected_settings.rb +4 -8
  114. data/db/migrate/20220228173251_remove_drpm_from_ignorable_content.rb +7 -3
  115. data/db/migrate/20220419193414_content_settings_to_dsl_category.rb +1 -1
  116. data/db/migrate/20220929204746_add_content_view_environment_content_facet.rb +52 -0
  117. data/db/migrate/20221123212341_remove_pulp_docker_registry_port_setting.rb +5 -0
  118. data/db/migrate/20230119003859_ensure_repo_username_password_nil_not_blank.rb +1 -1
  119. data/db/seeds.d/111-upgrade_tasks.rb +2 -1
  120. data/engines/bastion/app/assets/stylesheets/bastion/bastion.scss +4 -0
  121. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details.controller.js +2 -4
  122. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +0 -1
  123. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +2 -4
  124. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +2 -1
  125. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +11 -3
  126. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-hosts-list.html +1 -1
  127. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +8 -4
  128. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +5485 -0
  129. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +5397 -0
  130. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +5658 -0
  131. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +5284 -0
  132. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ka.po +5231 -0
  133. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +5275 -0
  134. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +5389 -0
  135. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +5212 -0
  136. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +5145 -0
  137. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +9 -0
  138. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +2 -2
  139. data/lib/katello/engine.rb +2 -1
  140. data/lib/katello/permission_creator.rb +2 -4
  141. data/lib/katello/permissions/registry_permissions.rb +5 -5
  142. data/lib/katello/plugin.rb +22 -14
  143. data/lib/katello/repository_types/README.md +136 -19
  144. data/lib/katello/repository_types/deb.rb +0 -1
  145. data/lib/katello/repository_types/docker.rb +0 -1
  146. data/lib/katello/repository_types/file.rb +0 -1
  147. data/lib/katello/repository_types/yum.rb +0 -4
  148. data/lib/katello/tasks/clean_candlepin_orphaned_products.rake +38 -0
  149. data/lib/katello/tasks/clean_orphaned_facets.rb +20 -0
  150. data/lib/katello/tasks/reimport.rake +1 -2
  151. data/lib/katello/tasks/repository.rake +1 -22
  152. data/lib/katello/tasks/reset.rake +1 -0
  153. data/lib/katello/tasks/upgrades/4.8/fix_incorrect_providers.rake +29 -0
  154. data/lib/katello/version.rb +1 -1
  155. data/lib/katello.rb +0 -5
  156. data/locale/bn/katello.po +69 -27
  157. data/locale/cs/katello.po +69 -27
  158. data/locale/de/katello.po +78 -36
  159. data/locale/en/katello.po +69 -27
  160. data/locale/es/katello.po +70 -28
  161. data/locale/fr/katello.po +73 -31
  162. data/locale/gu/katello.po +69 -27
  163. data/locale/hi/katello.po +69 -27
  164. data/locale/it/katello.po +69 -27
  165. data/locale/ja/katello.po +73 -31
  166. data/locale/ka/katello.po +73 -31
  167. data/locale/katello.pot +335 -262
  168. data/locale/kn/katello.po +69 -27
  169. data/locale/ko/katello.po +69 -27
  170. data/locale/mr/katello.po +69 -27
  171. data/locale/or/katello.po +69 -27
  172. data/locale/pa/katello.po +69 -27
  173. data/locale/pt/katello.po +69 -27
  174. data/locale/pt_BR/katello.po +70 -28
  175. data/locale/ru/katello.po +70 -28
  176. data/locale/ta/katello.po +69 -27
  177. data/locale/te/katello.po +69 -27
  178. data/locale/zh_CN/katello.po +73 -31
  179. data/locale/zh_TW/katello.po +70 -28
  180. data/webpack/components/Content/ContentPage.js +51 -35
  181. data/webpack/components/Content/__tests__/ContentPage.test.js +2 -4
  182. data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +22 -3
  183. data/webpack/components/Table/EmptyStateMessage.js +14 -11
  184. data/webpack/components/Table/MainTable.js +36 -15
  185. data/webpack/components/Table/TableWrapper.js +25 -25
  186. data/webpack/components/Table/__test__/emptyStateMessage.test.js +51 -0
  187. data/webpack/components/extensions/HostDetails/Cards/ErrataOverviewCard.js +5 -4
  188. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/HostCollectionsModal.js +1 -1
  189. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/__tests__/hostCollectionsModal.test.js +1 -17
  190. data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js +18 -9
  191. data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsTab.js +1 -2
  192. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackageInstallModal.js +1 -2
  193. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js +1 -2
  194. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +47 -27
  195. data/webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesTab.js +1 -2
  196. data/webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js +2 -21
  197. data/webpack/components/extensions/HostDetails/Tabs/__tests__/moduleStreamsTab.test.js +1 -28
  198. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js +1 -10
  199. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js +1 -18
  200. data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +1 -17
  201. data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +1 -15
  202. data/webpack/global_test_setup.js +1 -1
  203. data/webpack/scenes/AlternateContentSources/Create/ACSCreateWizard.js +12 -10
  204. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSCredentials.js +6 -0
  205. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSSmartProxies.js +1 -0
  206. data/webpack/scenes/AlternateContentSources/Create/Steps/AcsUrlPaths.js +3 -10
  207. data/webpack/scenes/AlternateContentSources/Create/Steps/NameACS.js +1 -0
  208. data/webpack/scenes/AlternateContentSources/Create/__tests__/acsCreate.test.js +3 -3
  209. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditDetails.js +1 -0
  210. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditURLPaths.js +12 -4
  211. data/webpack/scenes/AlternateContentSources/MainTable/ACSTable.js +7 -4
  212. data/webpack/scenes/AlternateContentSources/MainTable/__tests__/acsTable.test.js +4 -8
  213. data/webpack/scenes/AlternateContentSources/helpers.js +1 -1
  214. data/webpack/scenes/Content/Details/ContentRepositories.js +5 -4
  215. data/webpack/scenes/Content/Details/__tests__/contentDetail.test.js +1 -12
  216. data/webpack/scenes/Content/Table/ContentTable.js +2 -1
  217. data/webpack/scenes/Content/__tests__/contentTable.test.js +1 -14
  218. data/webpack/scenes/ContentViews/Delete/__tests__/contentViewDelete.test.js +1 -25
  219. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +2 -1
  220. data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +44 -31
  221. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -0
  222. data/webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositoryTable.js +6 -1
  223. data/webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js +2 -1
  224. data/webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js +2 -1
  225. data/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js +3 -1
  226. data/webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js +3 -1
  227. data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +3 -1
  228. data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +2 -1
  229. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetailsHeader.js +2 -0
  230. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +2 -1
  231. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/CVDebMatchContentModal.js +1 -1
  232. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/CVRpmMatchContentModal.js +1 -1
  233. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentModal.test.js +35 -33
  234. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js +48 -45
  235. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +58 -24
  236. data/webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js +64 -0
  237. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +36 -20
  238. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js +40 -23
  239. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js +0 -13
  240. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js +0 -13
  241. data/webpack/scenes/ContentViews/Details/Histories/ContentViewHistories.js +2 -1
  242. data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.test.js +1 -10
  243. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +2 -1
  244. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +1 -10
  245. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js +21 -9
  246. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareTable.js +4 -0
  247. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js +1 -32
  248. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +3 -1
  249. data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemove.test.js +1 -15
  250. data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedActivationKeys.js +1 -1
  251. data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedHosts.js +1 -2
  252. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js +31 -9
  253. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsTable.js +4 -0
  254. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js +30 -14
  255. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +1 -1
  256. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +55 -120
  257. data/webpack/scenes/ContentViews/components/WizardHeader.js +1 -1
  258. data/webpack/scenes/ContentViews/expansions/RelatedContentViewComponentsModal.js +1 -1
  259. data/webpack/scenes/ContentViews/expansions/__tests__/contentViewComponentsModal.test.js +8 -1
  260. data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +3 -9
  261. data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +7 -1
  262. data/webpack/scenes/RedHatRepositories/components/Search.js +22 -16
  263. data/webpack/scenes/RedHatRepositories/index.scss +20 -1
  264. data/webpack/scenes/SmartProxy/SmartProxyContentTable.js +12 -1
  265. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CdnTypeForm.js +1 -1
  266. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CustomCdnTypeForm.js +1 -1
  267. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +21 -19
  268. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +34 -1
  269. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +20 -7
  270. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.test.js +0 -1
  271. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +65 -15
  272. metadata +49 -146
  273. data/app/lib/actions/katello/organization/simple_content_access/prepare_content_overrides.rb +0 -36
  274. data/app/lib/actions/katello/pulp_selector.rb +0 -24
  275. data/app/lib/actions/katello/repository/correct_checksum.rb +0 -24
  276. data/app/lib/actions/katello/repository/destroy_package_group.rb +0 -26
  277. data/app/lib/actions/katello/repository/upload_package_group.rb +0 -24
  278. data/app/lib/actions/pulp/abstract.rb +0 -37
  279. data/app/lib/actions/pulp/abstract_async_task.rb +0 -154
  280. data/app/lib/actions/pulp/abstract_async_task_group.rb +0 -94
  281. data/app/lib/actions/pulp/consumer/sync_capsule.rb +0 -45
  282. data/app/lib/actions/pulp/consumer/unassociate_units.rb +0 -20
  283. data/app/lib/actions/pulp/expect_one_task.rb +0 -11
  284. data/app/lib/actions/pulp/orchestration/orphan_cleanup/remove_orphans.rb +0 -16
  285. data/app/lib/actions/pulp/orchestration/repository/copy_all_units.rb +0 -19
  286. data/app/lib/actions/pulp/orchestration/repository/delete.rb +0 -15
  287. data/app/lib/actions/pulp/orchestration/repository/refresh.rb +0 -14
  288. data/app/lib/actions/pulp/orchestration/repository/refresh_if_needed.rb +0 -13
  289. data/app/lib/actions/pulp/orchestration/repository/refresh_repos.rb +0 -19
  290. data/app/lib/actions/pulp/orchestration/repository/remove_units.rb +0 -14
  291. data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +0 -34
  292. data/app/lib/actions/pulp/orchestration/repository/sync.rb +0 -18
  293. data/app/lib/actions/pulp/orchestration/repository/upload_content.rb +0 -37
  294. data/app/lib/actions/pulp/orphan_cleanup/remove_orphans.rb +0 -15
  295. data/app/lib/actions/pulp/orphan_cleanup/remove_unneeded_repos.rb +0 -16
  296. data/app/lib/actions/pulp/repository/abstract_copy_content.rb +0 -45
  297. data/app/lib/actions/pulp/repository/abstract_remove_content.rb +0 -32
  298. data/app/lib/actions/pulp/repository/clear.rb +0 -18
  299. data/app/lib/actions/pulp/repository/copy_all_units.rb +0 -30
  300. data/app/lib/actions/pulp/repository/copy_units.rb +0 -25
  301. data/app/lib/actions/pulp/repository/create.rb +0 -28
  302. data/app/lib/actions/pulp/repository/create_in_plan.rb +0 -15
  303. data/app/lib/actions/pulp/repository/create_upload_request.rb +0 -20
  304. data/app/lib/actions/pulp/repository/delete_upload_request.rb +0 -19
  305. data/app/lib/actions/pulp/repository/destroy.rb +0 -28
  306. data/app/lib/actions/pulp/repository/distributor_publish.rb +0 -25
  307. data/app/lib/actions/pulp/repository/download.rb +0 -16
  308. data/app/lib/actions/pulp/repository/import_upload.rb +0 -19
  309. data/app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb +0 -47
  310. data/app/lib/actions/pulp/repository/presenters/deb_presenter.rb +0 -95
  311. data/app/lib/actions/pulp/repository/presenters/docker_presenter.rb +0 -103
  312. data/app/lib/actions/pulp/repository/presenters/file_unit_presenter.rb +0 -42
  313. data/app/lib/actions/pulp/repository/presenters/yum_presenter.rb +0 -131
  314. data/app/lib/actions/pulp/repository/refresh.rb +0 -21
  315. data/app/lib/actions/pulp/repository/regenerate_applicability.rb +0 -21
  316. data/app/lib/actions/pulp/repository/remove_distribution.rb +0 -11
  317. data/app/lib/actions/pulp/repository/remove_units.rb +0 -44
  318. data/app/lib/actions/pulp/repository/sync.rb +0 -99
  319. data/app/lib/actions/pulp/repository/upload_file.rb +0 -28
  320. data/app/lib/actions/pulp/repository_group/create.rb +0 -31
  321. data/app/lib/actions/pulp/repository_group/delete.rb +0 -17
  322. data/app/lib/actions/pulp/repository_group/export.rb +0 -51
  323. data/app/lib/katello/util/content_overrides_migrator.rb +0 -98
  324. data/app/lib/katello/util/package_clause_generator.rb +0 -77
  325. data/app/models/katello/glue/pulp/pulp_errors.rb +0 -9
  326. data/app/models/katello/glue/pulp/repo.rb +0 -353
  327. data/app/models/katello/pulp_sync_status.rb +0 -165
  328. data/app/models/katello/pulp_task_status.rb +0 -63
  329. data/app/services/katello/pulp/content.rb +0 -24
  330. data/app/services/katello/pulp/importer_comparison.rb +0 -28
  331. data/app/services/katello/pulp/repository/deb.rb +0 -61
  332. data/app/services/katello/pulp/repository/docker.rb +0 -82
  333. data/app/services/katello/pulp/repository/file.rb +0 -52
  334. data/app/services/katello/pulp/repository/yum.rb +0 -205
  335. data/app/services/katello/pulp/repository.rb +0 -327
  336. data/app/services/katello/pulp/server.rb +0 -35
  337. data/app/services/katello/pulp/simple_package.rb +0 -24
  338. data/app/services/katello/pulp/smart_proxy_repository.rb +0 -52
  339. data/lib/monkeys/fix_deb_optimized_sync.rb +0 -35
  340. data/lib/monkeys/fix_pulp_container_path.rb +0 -35
  341. data/locale/bn/LC_MESSAGES/katello.mo +0 -0
  342. data/locale/cs/LC_MESSAGES/katello.mo +0 -0
  343. data/locale/de/LC_MESSAGES/katello.mo +0 -0
  344. data/locale/en/LC_MESSAGES/katello.mo +0 -0
  345. data/locale/es/LC_MESSAGES/katello.mo +0 -0
  346. data/locale/fr/LC_MESSAGES/katello.mo +0 -0
  347. data/locale/gu/LC_MESSAGES/katello.mo +0 -0
  348. data/locale/hi/LC_MESSAGES/katello.mo +0 -0
  349. data/locale/it/LC_MESSAGES/katello.mo +0 -0
  350. data/locale/ja/LC_MESSAGES/katello.mo +0 -0
  351. data/locale/ka/LC_MESSAGES/katello.mo +0 -0
  352. data/locale/kn/LC_MESSAGES/katello.mo +0 -0
  353. data/locale/ko/LC_MESSAGES/katello.mo +0 -0
  354. data/locale/mr/LC_MESSAGES/katello.mo +0 -0
  355. data/locale/or/LC_MESSAGES/katello.mo +0 -0
  356. data/locale/pa/LC_MESSAGES/katello.mo +0 -0
  357. data/locale/pt/LC_MESSAGES/katello.mo +0 -0
  358. data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
  359. data/locale/ru/LC_MESSAGES/katello.mo +0 -0
  360. data/locale/ta/LC_MESSAGES/katello.mo +0 -0
  361. data/locale/te/LC_MESSAGES/katello.mo +0 -0
  362. data/locale/zanata.xml +0 -30
  363. data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
  364. data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
  365. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentSearch.fixtures.json +0 -33
@@ -3,8 +3,8 @@
3
3
  This organization has Simple Content Access enabled. Hosts are not required to have subscriptions attached to access repositories.
4
4
  </span>
5
5
  </div>
6
- <div id="non-sca-banner" bst-alert="warning" ng-if="isManifestImported && !simpleContentAccessEnabled">
6
+ <div id="non-sca-banner" bst-alert="warning" ng-if="!simpleContentAccessEnabled">
7
7
  <span translate>
8
- This organization is not using <a target="_blank" href="https://access.redhat.com/articles/simple-content-access">Simple Content Access.</a> Legacy subscription management is deprecated and will be removed in a future version.
8
+ This organization is not using <a target="_blank" href="https://access.redhat.com/articles/simple-content-access">Simple Content Access.</a> Entitlement-based subscription management is deprecated and will be removed in a future version.
9
9
  </span>
10
10
  </div>
@@ -146,7 +146,6 @@ module Katello
146
146
  )
147
147
  end
148
148
 
149
- Katello::EventDaemon::Runner.initialize
150
149
  Katello::EventDaemon::Runner.register_service(:candlepin_events, Katello::CandlepinEventListener)
151
150
  Katello::EventDaemon::Runner.register_service(:katello_events, Katello::EventMonitor::PollerThread)
152
151
  Katello::EventDaemon::Runner.register_service(:katello_agent_events, Katello::EventDaemon::Services::AgentEventReceiver) if ::Katello.with_katello_agent?
@@ -175,6 +174,7 @@ module Katello
175
174
 
176
175
  #Controller extensions
177
176
  ::HostsController.include Katello::Concerns::HostsControllerExtensions
177
+ ::HostsController.include Katello::Concerns::ContentFacetHostsControllerExtensions
178
178
  ::SmartProxiesController.include Katello::Concerns::SmartProxiesControllerExtensions
179
179
  ::RegistrationCommandsController.prepend Katello::Concerns::RegistrationCommandsControllerExtensions
180
180
 
@@ -212,6 +212,7 @@ module Katello
212
212
 
213
213
  #Api controller extensions
214
214
  ::Api::V2::HostsController.include Katello::Concerns::Api::V2::HostsControllerExtensions
215
+ ::Api::V2::HostsController.include Katello::Concerns::ContentFacetHostsControllerExtensions
215
216
  ::Api::V2::HostgroupsController.include Katello::Concerns::Api::V2::HostgroupsControllerExtensions
216
217
  ::Api::V2::SmartProxiesController.include Katello::Concerns::Api::V2::SmartProxiesControllerExtensions
217
218
  ::Api::V2::RegistrationController.include ::Foreman::Controller::SmartProxyAuth
@@ -284,8 +284,7 @@ module Katello
284
284
  :finder_scope => :readable
285
285
  @plugin.permission :create_products,
286
286
  {
287
- 'katello/api/v2/products' => [:create],
288
- 'katello/api/v2/package_groups' => [:create]
287
+ 'katello/api/v2/products' => [:create]
289
288
  },
290
289
  :resource_type => 'Katello::Product',
291
290
  :finder_scope => :editable
@@ -305,8 +304,7 @@ module Katello
305
304
  'katello/api/v2/products' => [:destroy],
306
305
  'katello/api/v2/repositories' => [:destroy],
307
306
  'katello/api/v2/products_bulk_actions' => [:destroy_products],
308
- 'katello/api/v2/repositories_bulk_actions' => [:destroy_repositories],
309
- 'katello/api/v2/package_groups' => [:destroy]
307
+ 'katello/api/v2/repositories_bulk_actions' => [:destroy_repositories]
310
308
  },
311
309
  :resource_type => 'Katello::Product',
312
310
  :finder_scope => :deletable
@@ -8,13 +8,13 @@ Foreman::AccessControl.permission(:create_personal_access_tokens).actions.concat
8
8
  'katello/api/registry/registry_proxies/catalog',
9
9
  'katello/api/registry/registry_proxies/tags_list',
10
10
  'katello/api/registry/registry_proxies/pull_manifest',
11
- 'katello/api/registry/registry_proxies/push_manifest',
11
+ #'katello/api/registry/registry_proxies/push_manifest',
12
12
  'katello/api/registry/registry_proxies/pull_blob',
13
13
  'katello/api/registry/registry_proxies/check_blob',
14
- 'katello/api/registry/registry_proxies/start_upload_blob',
15
- 'katello/api/registry/registry_proxies/upload_blob',
16
- 'katello/api/registry/registry_proxies/chunk_upload_blob',
17
- 'katello/api/registry/registry_proxies/finish_upload_blob',
14
+ #'katello/api/registry/registry_proxies/start_upload_blob',
15
+ #'katello/api/registry/registry_proxies/upload_blob',
16
+ #'katello/api/registry/registry_proxies/chunk_upload_blob',
17
+ #'katello/api/registry/registry_proxies/finish_upload_blob',
18
18
  'katello/api/registry/registry_proxies/status_upload_blob',
19
19
  'katello/api/registry/registry_proxies/cancel_upload_blob'
20
20
  ]
@@ -278,9 +278,9 @@ Foreman::Plugin.register :katello do
278
278
  use_pagelet :hosts_table_column_header, :os_title
279
279
  use_pagelet :hosts_table_column_content, :os_title
280
280
  add_pagelet :hosts_table_column_header, key: :lifecycle_environment, label: _('Lifecycle environment'), sortable: true, class: common_th_class, width: '10%'
281
- add_pagelet :hosts_table_column_content, key: :lifecycle_environment, class: common_td_class, callback: ->(host) { host.content_facet_attributes&.lifecycle_environment&.name }
281
+ add_pagelet :hosts_table_column_content, key: :lifecycle_environment, class: common_td_class, callback: ->(host) { host.content_facet&.single_lifecycle_environment&.name }
282
282
  add_pagelet :hosts_table_column_header, key: :content_view, label: _('Content view'), sortable: true, class: common_th_class, width: '10%'
283
- add_pagelet :hosts_table_column_content, key: :content_view, class: common_td_class, callback: ->(host) { host.content_facet_attributes&.content_view&.name }
283
+ add_pagelet :hosts_table_column_content, key: :content_view, class: common_td_class, callback: ->(host) { host.content_facet&.single_content_view&.name }
284
284
  add_pagelet :hosts_table_column_header, key: :registered_at, label: _('Registered'), sortable: true, class: common_th_class, width: '10%'
285
285
  add_pagelet :hosts_table_column_content, key: :registered_at, class: common_td_class, callback: ->(host) { host_registered_time(host) }
286
286
  add_pagelet :hosts_table_column_header, key: :last_checkin, label: _('Last checkin'), sortable: true, class: common_th_class, width: '10%'
@@ -346,6 +346,7 @@ Foreman::Plugin.register :katello do
346
346
  }]
347
347
  download_policies = proc { hashify_parameters(::Katello::RootRepository::DOWNLOAD_POLICIES) }
348
348
  proxy_download_policies = proc { hashify_parameters(::SmartProxy::DOWNLOAD_POLICIES) }
349
+ export_formats = proc { hashify_parameters(::Katello::Pulp3::ContentViewVersion::Export::FORMATS) }
349
350
 
350
351
  def hashify_parameters(parameters)
351
352
  Hash[parameters.map { |p| [p, p] }]
@@ -356,6 +357,12 @@ Foreman::Plugin.register :katello do
356
357
  templates.each_with_object({}) { |tmpl, hash| hash[tmpl.name] = tmpl.name }
357
358
  end
358
359
 
360
+ setting 'allow_multiple_content_views',
361
+ type: :boolean,
362
+ default: false,
363
+ full_name: N_('Allow multiple content views'),
364
+ description: N_("Allow a host to be registered to multiple content view environments with 'subscription-manager register --environments'.") # TODO: update this description when AKs support this setting as well
365
+
359
366
  setting 'content_default_http_proxy',
360
367
  type: :string,
361
368
  default: nil,
@@ -468,8 +475,8 @@ Foreman::Plugin.register :katello do
468
475
  setting 'errata_status_installable',
469
476
  type: :boolean,
470
477
  default: false,
471
- full_name: N_('Installable errata from content view'),
472
- description: N_("Calculate errata host status based only on errata in a host's content view and lifecycle environment")
478
+ full_name: N_('Generate errata status from directly-installable content'),
479
+ description: N_("If true, only errata that can be installed without an incremental update will affect the host's errata status.")
473
480
 
474
481
  setting 'restrict_composite_view',
475
482
  type: :boolean,
@@ -522,12 +529,6 @@ Foreman::Plugin.register :katello do
522
529
  description: N_("Default download policy for Smart Proxy syncs (either 'inherit', immediate', or 'on_demand')"),
523
530
  collection: proxy_download_policies
524
531
 
525
- setting 'pulp_docker_registry_port',
526
- type: :integer,
527
- default: 5000,
528
- full_name: N_('Pulp Docker registry port'),
529
- description: N_("The port used by Pulp Crane to provide Docker Registries")
530
-
531
532
  setting 'pulp_export_destination',
532
533
  type: :string,
533
534
  default: "/var/lib/pulp/katello-export",
@@ -540,6 +541,13 @@ Foreman::Plugin.register :katello do
540
541
  full_name: N_('Pulp 3 export destination filepath'),
541
542
  description: N_("On-disk location for pulp 3 exported repositories")
542
543
 
544
+ setting 'default_export_format',
545
+ type: :string,
546
+ default: ::Katello::Pulp3::ContentViewVersion::Export::IMPORTABLE,
547
+ full_name: N_('Default export format'),
548
+ description: N_("Default export format for content-exports(either 'syncable' or 'importable')"),
549
+ collection: export_formats
550
+
543
551
  setting 'sync_total_timeout',
544
552
  type: :integer,
545
553
  default: 3600,
@@ -723,14 +731,14 @@ Foreman::Plugin.register :katello do
723
731
 
724
732
  add_controller_action_scope('HostsController', :index) do |base_scope|
725
733
  base_scope
726
- .preload(:content_view, :lifecycle_environment, :subscription_facet)
727
- .preload(content_facet: [:bound_repositories, :content_view, :lifecycle_environment])
734
+ .preload(:subscription_facet)
735
+ .preload(content_facet: [:bound_repositories])
728
736
  end
729
737
 
730
738
  add_controller_action_scope('Api::V2::HostsController', :index) do |base_scope|
731
739
  base_scope
732
- .preload(:content_view, :lifecycle_environment, :subscription_facet)
733
- .preload(content_facet: [:bound_repositories, :content_view, :lifecycle_environment])
740
+ .preload(:subscription_facet)
741
+ .preload(content_facet: [:bound_repositories])
734
742
  end
735
743
 
736
744
  register_info_provider Katello::Host::InfoProvider
@@ -1,23 +1,52 @@
1
1
  # Registering a new repository type
2
2
 
3
- Full example:
3
+ # Full example:
4
4
 
5
5
  ```ruby
6
-
7
6
  Katello::RepositoryTypeManager.register(::Katello::Repository::YUM_TYPE) do
8
- service_class Katello::Pulp::Repository::Yum
7
+ pulp3_service_class Katello::Pulp3::Repository::Yum
8
+ pulp3_api_class Katello::Pulp3::Api::Yum
9
+ pulp3_plugin 'rpm'
9
10
  prevent_unneeded_metadata_publish
10
11
 
11
- content_type Katello::Rpm, :priority => 1, :pulp2_service_class => ::Katello::Pulp::Rpm
12
- content_type Katello::Erratum, :priority => 2, :pulp2_service_class => ::Katello::Pulp::Erratum
13
- content_type Katello::ModuleStream, :priority => 3, :pulp2_service_class => ::Katello::Pulp::ModuleStream
14
- content_type Katello::PackageGroup, :pulp2_service_class => ::Katello::Pulp::PackageGroup
15
- content_type Katello::YumMetadataFile, :pulp2_service_class => ::Katello::Pulp::YumMetadataFile
16
- content_type Katello::Srpm, :pulp2_service_class => ::Katello::Pulp::Srpm
12
+ client_module_class PulpRpmClient
13
+ api_class PulpRpmClient::ApiClient
14
+ remote_class PulpRpmClient::RpmRpmRemote
15
+ remotes_api_class PulpRpmClient::RemotesRpmApi
16
+ repository_versions_api_class PulpRpmClient::RepositoriesRpmVersionsApi
17
+ repositories_api_class PulpRpmClient::RepositoriesRpmApi
18
+ configuration_class PulpRpmClient::Configuration
19
+ distributions_api_class PulpRpmClient::DistributionsRpmApi
20
+ distribution_class PulpRpmClient::RpmRpmDistribution
21
+ publication_class PulpRpmClient::RpmRpmPublication
22
+ publications_api_class PulpRpmClient::PublicationsRpmApi
23
+ repo_sync_url_class PulpRpmClient::RpmRepositorySyncURL
24
+
25
+ default_managed_content_type Katello::Rpm::CONTENT_TYPE
26
+ content_type Katello::Rpm,
27
+ priority: 1,
28
+ pulp3_service_class: ::Katello::Pulp3::Rpm,
29
+ primary_content: true,
30
+ removable: true,
31
+ uploadable: true
32
+ content_type Katello::ModuleStream,
33
+ priority: 2,
34
+ pulp3_service_class: ::Katello::Pulp3::ModuleStream
35
+ content_type Katello::Erratum, priority: 3,
36
+ pulp3_service_class: ::Katello::Pulp3::Erratum,
37
+ primary_content: true, mutable: true
38
+ content_type Katello::PackageGroup,
39
+ pulp3_service_class: ::Katello::Pulp3::PackageGroup
40
+ content_type Katello::Srpm,
41
+ pulp3_service_class: ::Katello::Pulp3::Srpm,
42
+ removable: true, uploadable: true
43
+ content_type Katello::Distribution, priority: 4,
44
+ pulp3_service_class: ::Katello::Pulp3::Distribution,
45
+ index: false
46
+ content_type Katello::PackageCategory, priority: 4, index: false
17
47
 
18
48
  index_additional_data { |repo, target_repo = nil| repo.import_distribution_data(target_repo) }
19
49
  end
20
-
21
50
  ```
22
51
 
23
52
  ## DSL breakdown
@@ -28,24 +57,44 @@ Katello::RepositoryTypeManager.register(::Katello::Repository::YUM_TYPE) do
28
57
  ```
29
58
  This declares the the repository type, specifying a type identifier (e.g. 'yum')
30
59
 
31
- ### Service class
60
+ ### Service class and friends
32
61
 
33
62
  ```ruby
34
- service_class Katello::Pulp::Repository::Yum
63
+ pulp3_service_class Katello::Pulp3::Repository::Yum
64
+ pulp3_api_class Katello::Pulp3::Api::Yum
65
+ pulp3_plugin 'rpm'
66
+ ...
35
67
  ```
36
68
 
37
- Identifies the service class that is used to interface with pulp 2 and includes methods for creating and updating the type of repository
38
-
69
+ Identifies the service class that is used to interface with Pulp and includes methods for creating and updating the type of repository. Also notes the location of the main API class and the name of the corresponding Pulp plugin.
70
+ There are a number of other classes that need to be defined, so follow the [full example](full-example) above to ensure that the new type has
71
+ all the neccessary information.
72
+
39
73
  ### Content Type
40
-
74
+
41
75
  ```ruby
42
- content_type Katello::Rpm, :priority => 1, :pulp2_service_class => ::Katello::Pulp::Rpm
76
+ default_managed_content_type Katello::Rpm::CONTENT_TYPE
77
+ content_type Katello::Rpm,
78
+ priority: 1,
79
+ pulp3_service_class: ::Katello::Pulp3::Rpm,
80
+ primary_content: true,
81
+ removable: true,
82
+ uploadable: true
43
83
  ```
44
84
 
45
- Defines a content type to be used by the repository. The first argument is the Active Record model class representing the content type. This should extend the `Katello::Concerns::PulpDatabaseUnit` class.
85
+ The `default_managed_content_type` method sets the Rpm content type as the default content type, which
86
+ the repository type will act upon when another content type is not explicitly declared. For example, a yum upload
87
+ will assume that the uploaded content is of Rpm type unless otherwise specified.
88
+
89
+ The `content_type` method defines a content type to be used by the repository. The first argument is the Active Record model class representing the content type. This should extend the `Katello::Concerns::PulpDatabaseUnit` class.
46
90
  The second argument is an options hash that includes:
47
91
  * priority - The ordering used when indexing or performing other operations (1 is highest, defaults to 99)
48
- * pulp2_service_class - The service class representing this content type in pulp 2
92
+ * pulp3_service_class - The service class representing this content type
93
+ * primary_content - The indexing of this content type is recorded for display after syncing
94
+ * removable - Content units of this type can be deleted from a repository
95
+ * uploadable - Content units of this type can be uploaded to a repository
96
+ * index - Content units of this type will be indexed
97
+
49
98
 
50
99
  ### Additional custom indexing
51
100
 
@@ -61,4 +110,72 @@ Provides a block that will be executed after other repository indexing completes
61
110
  prevent_unneeded_metadata_publish
62
111
  ```
63
112
 
64
- This option declares that this content type supports the CheckMatchingContent middleware where by repositories are not actually republished in pulp if no content changes.
113
+ This option declares that this content type supports the CheckMatchingContent middleware, which removes the need to republish repositories in Pulp when content doesn't change.
114
+
115
+ ### Generic content types
116
+
117
+ For content types that are simple enough to support it, the "generic content type" framework can be used.
118
+ If no special models are required to support the new content type, the only information that needs to be added
119
+ about the type would be what exists in the repository type definition.
120
+ The `generic_content_type` and `generic_remote_option` methods exist to define all other attributes that are needed to
121
+ create a generic type.
122
+ To create a generic content type, follow the Python type as an example:
123
+
124
+ ```ruby
125
+ Katello::RepositoryTypeManager.register('python') do
126
+ allow_creation_by_user true
127
+ pulp3_service_class Katello::Pulp3::Repository::Generic
128
+ pulp3_api_class Katello::Pulp3::Api::Generic
129
+ pulp3_plugin 'python'
130
+
131
+ client_module_class PulpPythonClient
132
+ api_class PulpPythonClient::ApiClient
133
+ configuration_class PulpPythonClient::Configuration
134
+ remote_class PulpPythonClient::PythonPythonRemote
135
+ remotes_api_class PulpPythonClient::RemotesPythonApi
136
+ repositories_api_class PulpPythonClient::RepositoriesPythonApi
137
+ repository_versions_api_class PulpPythonClient::RepositoriesPythonVersionsApi
138
+ distributions_api_class PulpPythonClient::DistributionsPypiApi
139
+ distribution_class PulpPythonClient::PythonPythonDistribution
140
+ publication_class PulpPythonClient::PythonPythonPublication
141
+ publications_api_class PulpPythonClient::PublicationsPypiApi
142
+ repo_sync_url_class PulpPythonClient::RepositorySyncURL
143
+
144
+ generic_remote_option :includes, title: N_("Includes"), type: Array, input_type: "textarea", delimiter: "\\n", default: [],
145
+ description: N_("Python packages to include from the upstream URL, names separated by newline. You may also specify versions, for example: django~=2.0. Leave empty to include every package.")
146
+
147
+ generic_remote_option :excludes, title: N_("Excludes"), type: Array, input_type: "textarea", delimiter: "\\n", default: [],
148
+ description: N_("Python packages to exclude from the upstream URL, names separated by newline. You may also specify versions, for example: django~=2.0.")
149
+
150
+ generic_remote_option :package_types, title: N_("Package Types"), type: Array, input_type: "text", delimiter: ",", default: [],
151
+ description: N_("Package types to sync for Python content, separated by comma. Leave empty to get every package type. Package types are: bdist_dmg, bdist_dumb, bdist_egg, bdist_msi, bdist_rpm, bdist_wheel, bdist_wininst, sdist.")
152
+
153
+ url_description N_("URL of a PyPI content source such as https://pypi.org.")
154
+
155
+ generic_content_type 'python_package',
156
+ pluralized_name: "Python Packages",
157
+ model_class: Katello::GenericContentUnit,
158
+ pulp3_api: PulpPythonClient::ContentPackagesApi,
159
+ pulp3_model: PulpPythonClient::PythonPythonPackageContent,
160
+ pulp3_service_class: Katello::Pulp3::GenericContentUnit,
161
+ model_name: lambda { |pulp_unit| pulp_unit["name"] },
162
+ model_version: lambda { |pulp_unit| pulp_unit["version"] },
163
+ model_filename: lambda { |pulp_unit| pulp_unit["filename"] },
164
+ model_additional_metadata: lambda { |pulp_unit|
165
+ {
166
+ "package_type": pulp_unit["packagetype"],
167
+ "sha256": pulp_unit["sha256"]
168
+ }
169
+ },
170
+ removable: true,
171
+ uploadable: true,
172
+ duplicates_allowed: false,
173
+ filename_key: :filename,
174
+ generic_browser: true,
175
+ test_upload_path: 'test/fixtures/files/shelf_reader-0.1-py2-none-any.whl'
176
+ default_managed_content_type :python_package
177
+
178
+ test_url 'https://fixtures.pulpproject.org/python-pypi/'
179
+ test_url_root_options generic_remote_options: {includes: ['celery']}.to_json
180
+ end
181
+ ```
@@ -1,5 +1,4 @@
1
1
  Katello::RepositoryTypeManager.register(::Katello::Repository::DEB_TYPE) do
2
- service_class Katello::Pulp::Repository::Deb
3
2
  pulp3_service_class Katello::Pulp3::Repository::Apt
4
3
  pulp3_api_class Katello::Pulp3::Api::Apt
5
4
  pulp3_plugin 'deb'
@@ -1,5 +1,4 @@
1
1
  Katello::RepositoryTypeManager.register(::Katello::Repository::DOCKER_TYPE) do
2
- service_class Katello::Pulp::Repository::Docker
3
2
  default_managed_content_type Katello::DockerManifest::CONTENT_TYPE
4
3
  pulp3_service_class Katello::Pulp3::Repository::Docker
5
4
  pulp3_api_class Katello::Pulp3::Api::Docker
@@ -1,6 +1,5 @@
1
1
  Katello::RepositoryTypeManager.register(::Katello::Repository::FILE_TYPE) do
2
2
  allow_creation_by_user true
3
- service_class Katello::Pulp::Repository::File
4
3
  pulp3_service_class Katello::Pulp3::Repository::File
5
4
  pulp3_api_class Katello::Pulp3::Api::File
6
5
  pulp3_plugin 'file'
@@ -1,5 +1,4 @@
1
1
  Katello::RepositoryTypeManager.register(::Katello::Repository::YUM_TYPE) do
2
- service_class Katello::Pulp::Repository::Yum
3
2
  pulp3_service_class Katello::Pulp3::Repository::Yum
4
3
  pulp3_api_class Katello::Pulp3::Api::Yum
5
4
  pulp3_plugin 'rpm'
@@ -33,9 +32,6 @@ Katello::RepositoryTypeManager.register(::Katello::Repository::YUM_TYPE) do
33
32
  :primary_content => true, :mutable => true
34
33
  content_type Katello::PackageGroup,
35
34
  :pulp3_service_class => ::Katello::Pulp3::PackageGroup
36
- content_type Katello::YumMetadataFile,
37
- :pulp3_service_class => ::Katello::Pulp3::YumMetadataFile,
38
- :index_on_pulp3 => false
39
35
  content_type Katello::Srpm,
40
36
  :pulp3_service_class => ::Katello::Pulp3::Srpm,
41
37
  :removable => true, :uploadable => true
@@ -0,0 +1,38 @@
1
+ namespace :katello do
2
+ desc "Removes custom products (and their associated pools and subscriptions) from Candlepin that are not in Katello"
3
+ task :clean_candlepin_orphaned_products => ["dynflow:client", "environment"] do
4
+ User.current = User.anonymous_admin #set a user for orchestration
5
+
6
+ deleted_products_counts = {}
7
+ Organization.all.each do |org|
8
+ print "Cleaning Candlepin orphaned custom products for organization #{org.name}\n"
9
+
10
+ cp_products = Katello::Resources::Candlepin::Product.all(org.label)
11
+ cp_products = cp_products.select { |prod| Katello::Glue::Candlepin::Product.engineering_product_id?(prod['id']) }
12
+ cp_product_ids = cp_products.map { |cp_product| cp_product['id'] }
13
+
14
+ katello_product_ids = Katello::Product.where(:organization_id => org.id).pluck(:cp_id)
15
+ orphaned_cp_product_ids = cp_product_ids - katello_product_ids
16
+ orphaned_cp_product_ids.each do |cp_product_id|
17
+ print "Deleting Candlepin orphaned custom product #{cp_product_id} (and its associated pools and subscriptions)\n"
18
+ ForemanTasks.sync_task(
19
+ ::Actions::Candlepin::Product::DeletePools,
20
+ cp_id: cp_product_id, organization_label: org.label)
21
+
22
+ ForemanTasks.sync_task(
23
+ ::Actions::Candlepin::Product::DeleteSubscriptions,
24
+ cp_id: cp_product_id, organization_label: org.label)
25
+
26
+ ForemanTasks.sync_task(
27
+ ::Actions::Candlepin::Product::Destroy,
28
+ owner: org.label, cp_id: cp_product_id)
29
+ end
30
+
31
+ deleted_products_counts[org.name] = orphaned_cp_product_ids.length
32
+ end
33
+
34
+ deleted_products_counts.each do |org_name, deleted_products_count|
35
+ print "Deleted #{deleted_products_count} Candlepin orphaned custom products for organization #{org_name}\n"
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,20 @@
1
+ namespace :katello do
2
+ desc "Remove orphaned and unneeded content/subscription facets."
3
+ task :clean_orphaned_facets => ["environment"] do
4
+ User.current = User.anonymous_admin
5
+ remove_orphan_facets
6
+ end
7
+
8
+ def remove_orphan_facets
9
+ ::Katello::Host::ContentFacet.select { |c| c.host.nil? }&.each do |content_facet|
10
+ Rails.logger.info "Deleting content facet with id: #{content_facet.id}\n"
11
+ content_facet.destroy
12
+ end
13
+ Katello::Host::SubscriptionFacet.select { |s| s.host.nil? }&.each do |subscription_facet|
14
+ Rails.logger.info "Deleting subscription facet with id: #{subscription_facet.id}\n"
15
+ subscription_facet.destroy
16
+ end
17
+ rescue RuntimeError => e
18
+ Rails.logger.error "Task failed: #{e}"
19
+ end
20
+ end
@@ -14,7 +14,6 @@ namespace :katello do
14
14
  desc "Reimports information from backend systems"
15
15
  task :reimport => ["dynflow:client", "katello:check_ping"] do
16
16
  User.current = User.anonymous_admin #set a user for orchestration
17
- Dir.glob(Katello::Engine.root.to_s + '/app/models/katello/*.rb').each { |file| require file }
18
17
 
19
18
  models = [
20
19
  Katello::Subscription,
@@ -32,7 +31,7 @@ namespace :katello do
32
31
  ack_key.import_pools
33
32
  end
34
33
 
35
- print "Importing Linked Repositories"
34
+ print "Importing Linked Repositories\n"
36
35
  Katello::Repository.linked_repositories.each(&:index_content)
37
36
  end
38
37
  end
@@ -3,27 +3,6 @@ namespace :katello do
3
3
  ENV['COMMIT'] == 'true' || ENV['FOREMAN_UPGRADE'] == '1'
4
4
  end
5
5
 
6
- desc "Check for repositories that have not been published since their last sync, and republish if they have."
7
- task :publish_unpublished_repositories => ["dynflow:client", "check_ping"] do
8
- needing_publish = []
9
- Organization.find_each do |org|
10
- if org.default_content_view && !org.default_content_view.versions.empty?
11
- org.default_content_view.versions.first.repositories.joins(:root)
12
- .where.not(katello_root_repositories: { url: nil }).find_each do |repo|
13
- if repo.needs_metadata_publish?
14
- Rails.logger.error("Repository metadata for #{repo.name} (#{repo.id}) is out of date, regenerating.")
15
- needing_publish << repo.id
16
- end
17
- rescue => e
18
- puts "Failed to check repository #{repo.id}: #{e}"
19
- end
20
- end
21
- end
22
- if needing_publish.any?
23
- ForemanTasks.async_task(::Actions::Katello::Repository::BulkMetadataGenerate, Katello::Repository.where(:id => needing_publish))
24
- end
25
- end
26
-
27
6
  desc "Regnerate metadata for all repositories. Specify CONTENT_VIEW=name and LIFECYCLE_ENVIRONMENT=name to narrow repositories."
28
7
  task :regenerate_repo_metadata => ["dynflow:client", "check_ping"] do
29
8
  User.current = User.anonymous_api_admin
@@ -108,7 +87,7 @@ namespace :katello do
108
87
  return false unless backend_service&.repository_reference&.repository_href
109
88
  backend_service.api.repositories_api.read(backend_service.repository_reference.repository_href)
110
89
  else
111
- Katello.pulp_server.extensions.repository.retrieve(repo.pulp_id)
90
+ false
112
91
  end
113
92
  true
114
93
  rescue StandardError => e
@@ -13,6 +13,7 @@ namespace :katello do
13
13
  system("sudo systemctl stop 'pulpcore-worker@*' --all")
14
14
  system("sudo runuser - postgres -c 'dropdb pulpcore'")
15
15
  system("sudo runuser - postgres -c 'createdb pulpcore'")
16
+ system("sudo runuser - postgres -c \"psql -d pulpcore -c 'create extension hstore'\"")
16
17
 
17
18
  Dir.chdir("/tmp") do
18
19
  fail "\e[31mCannot migrate Pulp3 database\e[0m\n\n" unless system("sudo -u pulp PULP_SETTINGS='/etc/pulp/settings.py' DJANGO_SETTINGS_MODULE='pulpcore.app.settings' pulpcore-manager migrate --no-input")
@@ -0,0 +1,29 @@
1
+ namespace :katello do
2
+ namespace :upgrades do
3
+ namespace '4.8' do
4
+ desc "Fix custom products incorrectly assigned a Red Hat provider"
5
+ task :fix_incorrect_providers => ["dynflow:client", "environment"] do
6
+ User.current = User.anonymous_admin #set a user for orchestration
7
+
8
+ print "Fixing incorrect providers\n"
9
+ incorrect_provider_count = 0
10
+ error_msgs = []
11
+ Katello::Product.redhat.includes(:organization).each do |product|
12
+ if ::Katello::Glue::Candlepin::Product.custom_product_id?(product.cp_id)
13
+ print "Fixing provider for #{product.name}\n"
14
+ incorrect_provider_count += 1
15
+ product.provider = product.organization.anonymous_provider
16
+ product.save!
17
+ end
18
+ end
19
+
20
+ print "Fixed #{incorrect_provider_count} incorrect providers\n"
21
+ if error_msgs.any?
22
+ print "Errors while fixing providers: #{error_msgs.join("\n")}\n"
23
+ end
24
+
25
+ Rake::Task['katello:clean_candlepin_orphaned_products'].invoke
26
+ end
27
+ end
28
+ end
29
+ end
@@ -1,3 +1,3 @@
1
1
  module Katello
2
- VERSION = "4.7.6".freeze
2
+ VERSION = "4.8.0.rc1".freeze
3
3
  end
data/lib/katello.rb CHANGED
@@ -10,7 +10,6 @@ require "rest_client"
10
10
  require "anemone"
11
11
  require "securerandom"
12
12
 
13
- require "runcible"
14
13
  require "deface"
15
14
 
16
15
  require "securerandom"
@@ -26,8 +25,4 @@ require "monkeys/anemone"
26
25
  module Katello
27
26
  require "katello/version"
28
27
  require "katello/engine"
29
-
30
- def self.pulp_server
31
- Katello::Pulp::Server.config(::SmartProxy.pulp_primary.url + '/pulp/api/v2/', User.remote_user)
32
- end
33
28
  end