katello 4.6.2.1 → 4.7.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 (333) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/katello/common/vendor.js +0 -1
  3. data/app/controllers/katello/api/v2/activation_keys_controller.rb +1 -0
  4. data/app/controllers/katello/api/v2/alternate_content_sources_controller.rb +4 -4
  5. data/app/controllers/katello/api/v2/capsule_content_controller.rb +5 -0
  6. data/app/controllers/katello/api/v2/content_imports_controller.rb +1 -0
  7. data/app/controllers/katello/api/v2/content_view_components_controller.rb +1 -1
  8. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +2 -1
  9. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +1 -1
  10. data/app/controllers/katello/api/v2/organizations_controller.rb +1 -0
  11. data/app/controllers/katello/api/v2/repositories_controller.rb +78 -12
  12. data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +1 -1
  13. data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +7 -1
  14. data/app/controllers/katello/concerns/api/v2/smart_proxies_controller_extensions.rb +1 -0
  15. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +11 -9
  16. data/app/helpers/katello/content_source_helper.rb +9 -0
  17. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +31 -0
  18. data/app/lib/actions/katello/activation_key/destroy.rb +1 -0
  19. data/app/lib/actions/katello/agent_action.rb +1 -0
  20. data/app/lib/actions/katello/alternate_content_source/create.rb +1 -1
  21. data/app/lib/actions/katello/alternate_content_source/update.rb +2 -2
  22. data/app/lib/actions/katello/capsule_content/sync.rb +10 -2
  23. data/app/lib/actions/katello/cdn_configuration/update.rb +1 -1
  24. data/app/lib/actions/katello/content_view/promote.rb +1 -0
  25. data/app/lib/actions/katello/content_view/publish.rb +5 -2
  26. data/app/lib/actions/katello/content_view_version/auto_create_redhat_repositories.rb +7 -3
  27. data/app/lib/actions/katello/content_view_version/auto_create_repositories.rb +4 -2
  28. data/app/lib/actions/katello/content_view_version/import.rb +22 -10
  29. data/app/lib/actions/katello/product/destroy.rb +1 -1
  30. data/app/lib/actions/katello/repository/destroy.rb +3 -3
  31. data/app/lib/actions/katello/repository/errata_mail.rb +9 -6
  32. data/app/lib/actions/katello/repository/refresh_repository.rb +1 -1
  33. data/app/lib/actions/katello/repository/sync.rb +13 -6
  34. data/app/lib/actions/katello/repository_set/enable_repository.rb +6 -2
  35. data/app/lib/actions/pulp3/alternate_content_source/refresh_remote.rb +16 -0
  36. data/app/lib/actions/pulp3/orchestration/alternate_content_source/refresh.rb +1 -0
  37. data/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb +1 -1
  38. data/app/lib/actions/pulp3/orchestration/content_view_version/export_repository.rb +10 -2
  39. data/app/lib/katello/concerns/renderer_extensions.rb +2 -1
  40. data/app/lib/katello/errors.rb +2 -2
  41. data/app/lib/katello/resources/candlepin.rb +7 -1
  42. data/app/lib/katello/resources/cdn/katello_cdn.rb +3 -13
  43. data/app/lib/katello/resources/cdn.rb +14 -9
  44. data/app/lib/katello/util/candlepin_repository_checker.rb +73 -0
  45. data/app/models/katello/activation_key.rb +12 -1
  46. data/app/models/katello/alternate_content_source.rb +15 -4
  47. data/app/models/katello/alternate_content_source_product.rb +1 -1
  48. data/app/models/katello/authorization/repository.rb +2 -2
  49. data/app/models/katello/cdn_configuration.rb +12 -3
  50. data/app/models/katello/concerns/host_managed_extensions.rb +15 -2
  51. data/app/models/katello/concerns/http_proxy_extensions.rb +5 -10
  52. data/app/models/katello/concerns/smart_proxy_extensions.rb +30 -15
  53. data/app/models/katello/content.rb +15 -0
  54. data/app/models/katello/content_credential.rb +8 -9
  55. data/app/models/katello/content_view.rb +7 -3
  56. data/app/models/katello/content_view_component.rb +4 -0
  57. data/app/models/katello/content_view_version.rb +1 -1
  58. data/app/models/katello/erratum.rb +6 -2
  59. data/app/models/katello/host/content_facet.rb +13 -3
  60. data/app/models/katello/repository.rb +15 -1
  61. data/app/models/katello/root_repository.rb +0 -2
  62. data/app/overrides/add_smart_proxy_form.rb +5 -0
  63. data/app/presenters/katello/content_view_version_compare_presenter.rb +5 -0
  64. data/app/presenters/katello/host_package_presenter.rb +4 -4
  65. data/app/services/katello/pulp3/alternate_content_source.rb +23 -15
  66. data/app/services/katello/pulp3/ansible_collection.rb +7 -10
  67. data/app/services/katello/pulp3/content_view_version/export.rb +19 -6
  68. data/app/services/katello/pulp3/content_view_version/import.rb +2 -0
  69. data/app/services/katello/pulp3/content_view_version/import_validator.rb +21 -5
  70. data/app/services/katello/pulp3/content_view_version/importable_products.rb +11 -1
  71. data/app/services/katello/pulp3/content_view_version/importable_repositories.rb +38 -9
  72. data/app/services/katello/pulp3/content_view_version/metadata_generator.rb +12 -5
  73. data/app/services/katello/pulp3/content_view_version/metadata_map.rb +13 -2
  74. data/app/services/katello/pulp3/content_view_version/syncable_format_export.rb +5 -1
  75. data/app/services/katello/pulp3/pulp_content_unit.rb +3 -0
  76. data/app/services/katello/pulp3/repository.rb +18 -6
  77. data/app/services/katello/pulp3/repository_mirror.rb +0 -1
  78. data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +2 -2
  79. data/app/services/katello/pulp3/task_group.rb +18 -1
  80. data/app/services/katello/repository_type.rb +5 -2
  81. data/app/services/katello/repository_type_manager.rb +4 -3
  82. data/app/views/dashboard/_content_views_widget.html.erb +1 -1
  83. data/app/views/foreman/job_templates/change_content_source.erb +6 -0
  84. data/app/views/foreman/job_templates/update_packages_by_search_query.erb +7 -1
  85. data/app/views/katello/api/v2/alternate_content_sources/base.json.rabl +4 -4
  86. data/app/views/katello/api/v2/alternate_content_sources/index.json.rabl +1 -0
  87. data/app/views/katello/api/v2/alternate_content_sources/permissions.rabl +11 -0
  88. data/app/views/katello/api/v2/content_credentials/show.json.rabl +12 -0
  89. data/app/views/katello/api/v2/content_views/permissions.rabl +1 -0
  90. data/app/views/katello/api/v2/host_packages/base.json.rabl +1 -1
  91. data/app/views/katello/api/v2/module_streams/show.json.rabl +7 -0
  92. data/app/views/katello/api/v2/repositories/compare.json.rabl +10 -0
  93. data/app/views/katello/api/v2/smart_proxies/pulp_info.json.rabl +1 -0
  94. data/app/views/katello/hosts/_errata_counts.html.erb +46 -0
  95. data/app/views/overrides/activation_keys/_host_synced_content_select.html.erb +1 -0
  96. data/app/views/overrides/smart_proxies/_acs_http_proxy.html.erb +6 -0
  97. data/config/initializers/monkeys.rb +1 -0
  98. data/config/routes/api/v2.rb +2 -0
  99. data/config/routes.rb +3 -0
  100. data/db/migrate/20220730033504_update_custom_cdn.rb +13 -0
  101. data/db/migrate/20220920173656_add_http_proxy_to_smart_proxy.rb +7 -0
  102. data/db/migrate/20220920180858_remove_http_proxy_from_katello_alternate_content_sources.rb +6 -0
  103. data/engines/bastion/app/assets/javascripts/bastion/components/notification.service.js +1 -1
  104. data/engines/bastion/app/views/bastion/layouts/assets.html.erb +5 -5
  105. data/engines/bastion/vendor/assets/javascripts/bastion/angular/angular.js +1 -1
  106. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credential.factory.js +17 -0
  107. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credentials.routes.js +10 -0
  108. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-acs.controller.js +36 -0
  109. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js +7 -1
  110. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-acs.html +38 -0
  111. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-details.html +3 -0
  112. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/views/content-credentials.html +7 -2
  113. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +4 -2
  114. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +1 -1
  115. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +4 -3
  116. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +14 -1392
  117. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/katello-features.run.js +1 -0
  118. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +7 -0
  119. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details.html +1 -1
  120. data/lib/katello/permission_creator.rb +1 -0
  121. data/lib/katello/plugin.rb +34 -11
  122. data/lib/katello/repository_types/deb.rb +1 -1
  123. data/lib/katello/repository_types/docker.rb +1 -1
  124. data/lib/katello/repository_types/python.rb +3 -3
  125. data/lib/katello/tasks/check_candlepin_content.rake +16 -0
  126. data/lib/katello/tasks/reset.rake +1 -1
  127. data/lib/katello/version.rb +1 -1
  128. data/lib/monkeys/try_pulp_container_path.rb +35 -0
  129. data/locale/action_names.rb +7 -7
  130. data/locale/bn/katello.po +395 -63
  131. data/locale/cs/katello.po +396 -64
  132. data/locale/de/katello.po +399 -67
  133. data/locale/en/katello.po +395 -63
  134. data/locale/es/katello.po +399 -67
  135. data/locale/fr/katello.po +400 -68
  136. data/locale/gu/katello.po +395 -63
  137. data/locale/hi/katello.po +395 -63
  138. data/locale/it/katello.po +396 -64
  139. data/locale/ja/katello.po +400 -68
  140. data/locale/katello.pot +1916 -1213
  141. data/locale/kn/katello.po +395 -63
  142. data/locale/ko/katello.po +396 -64
  143. data/locale/mr/katello.po +395 -63
  144. data/locale/or/katello.po +395 -63
  145. data/locale/pa/katello.po +395 -63
  146. data/locale/pt/katello.po +395 -63
  147. data/locale/pt_BR/katello.po +399 -67
  148. data/locale/ru/katello.po +396 -64
  149. data/locale/ta/katello.po +395 -63
  150. data/locale/te/katello.po +395 -63
  151. data/locale/zh_CN/katello.po +400 -68
  152. data/locale/zh_TW/katello.po +396 -64
  153. data/webpack/components/Bookmark/index.js +5 -1
  154. data/webpack/components/Content/Details/ContentDetails.js +1 -1
  155. data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetails.test.js.snap +6 -0
  156. data/webpack/components/EditableSwitch.js +1 -0
  157. data/webpack/components/EditableTextInput/EditableTextInput.js +3 -3
  158. data/webpack/components/Errata/errataHelpers.js +33 -0
  159. data/webpack/components/Errata/index.js +45 -12
  160. data/webpack/components/Loading.js +18 -8
  161. data/webpack/components/Packages/index.js +8 -24
  162. data/webpack/components/RoutedTabs/index.js +1 -0
  163. data/webpack/components/Search/Search.js +20 -2
  164. data/webpack/components/Search/__tests__/search.test.js +3 -3
  165. data/webpack/components/Table/EmptyStateMessage.js +1 -1
  166. data/webpack/components/Table/PageControls.js +1 -0
  167. data/webpack/components/Table/TableHooks.js +4 -0
  168. data/webpack/components/Table/TableWrapper.js +7 -7
  169. data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.js +1 -0
  170. data/webpack/components/TypeAhead/pf4Search/TypeAheadItems.js +2 -0
  171. data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.js +1 -1
  172. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ChangeHostCVModal.js +3 -1
  173. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ContentViewDetailsCard.js +2 -1
  174. data/webpack/components/extensions/HostDetails/Cards/ErrataOverviewCard.js +124 -68
  175. data/webpack/components/extensions/HostDetails/Cards/ErrataOverviewCard.scss +5 -0
  176. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/HostCollectionsCard.js +30 -4
  177. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/HostCollectionsCard.scss +23 -0
  178. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/HostCollectionsModal.js +5 -4
  179. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/__tests__/hostCollectionsCard.test.js +25 -10
  180. data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeCard.js +3 -3
  181. data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js +6 -0
  182. data/webpack/components/extensions/HostDetails/Cards/__tests__/errataOverviewCard.test.js +145 -32
  183. data/webpack/components/extensions/HostDetails/DetailsTabCards/RegistrationCard.js +3 -1
  184. data/webpack/components/extensions/HostDetails/Tabs/ContentTab/constants.js +2 -1
  185. data/webpack/components/extensions/HostDetails/Tabs/ContentTab/index.js +1 -0
  186. data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js +78 -26
  187. data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsTab.js +23 -10
  188. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/HostPackagesConstants.js +1 -0
  189. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackageInstallModal.js +9 -4
  190. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js +141 -23
  191. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.scss +6 -1
  192. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js +9 -8
  193. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +24 -3
  194. data/webpack/components/extensions/HostDetails/Tabs/TracesTab/EnableTracerModal.js +7 -2
  195. data/webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesEnabler.js +2 -1
  196. data/webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesTab.js +20 -4
  197. data/webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js +56 -38
  198. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packages.fixtures.json +3 -3
  199. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js +5 -4
  200. data/webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js +3 -3
  201. data/webpack/containers/Application/config.js +2 -2
  202. data/webpack/containers/Application/overrides.scss +12 -0
  203. data/webpack/global_test_setup.js +19 -1
  204. data/webpack/ouia_id_check.js +0 -2
  205. data/webpack/redux/actions/RedHatRepositories/helpers.js +4 -8
  206. data/webpack/scenes/AlternateContentSources/ACSActions.js +37 -6
  207. data/webpack/scenes/AlternateContentSources/ACSConstants.js +2 -0
  208. data/webpack/scenes/AlternateContentSources/ACSIndexPage.js +1 -1
  209. data/webpack/scenes/AlternateContentSources/ACSSelectors.js +6 -6
  210. data/webpack/scenes/AlternateContentSources/Acs.scss +3 -0
  211. data/webpack/scenes/AlternateContentSources/Create/ACSCreateWizard.js +24 -3
  212. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSCreateFinish.js +10 -8
  213. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSCredentials.js +25 -4
  214. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSReview.js +22 -11
  215. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSSmartProxies.js +27 -2
  216. data/webpack/scenes/AlternateContentSources/Create/Steps/AcsUrlPaths.js +49 -17
  217. data/webpack/scenes/AlternateContentSources/Create/Steps/SelectSource.js +76 -23
  218. data/webpack/scenes/AlternateContentSources/Create/__tests__/acsCreate.test.js +159 -11
  219. data/webpack/scenes/AlternateContentSources/Details/ACSExpandableDetails.js +83 -29
  220. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditCredentials.js +9 -8
  221. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditDetails.js +2 -2
  222. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditProducts.js +2 -2
  223. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditSmartProxies.js +39 -7
  224. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditURLPaths.js +27 -11
  225. data/webpack/scenes/AlternateContentSources/Details/__tests__/ACSEdits.test.js +58 -55
  226. data/webpack/scenes/AlternateContentSources/Details/__tests__/ACSExpandableDetails.test.js +35 -32
  227. data/webpack/scenes/AlternateContentSources/MainTable/ACSTable.js +323 -150
  228. data/webpack/scenes/AlternateContentSources/MainTable/__tests__/acsIndex.fixtures.json +5 -1
  229. data/webpack/scenes/AlternateContentSources/MainTable/__tests__/acsTable.test.js +10 -11
  230. data/webpack/scenes/AlternateContentSources/helpers.js +26 -0
  231. data/webpack/scenes/ContentViews/ContentViewsConstants.js +1 -0
  232. data/webpack/scenes/ContentViews/ContentViewsPage.js +1 -1
  233. data/webpack/scenes/ContentViews/Copy/CopyContentViewForm.js +1 -0
  234. data/webpack/scenes/ContentViews/Copy/CopyContentViewModal.js +1 -0
  235. data/webpack/scenes/ContentViews/Create/ContentViewFormComponents.js +10 -5
  236. data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +30 -7
  237. data/webpack/scenes/ContentViews/Create/CreateContentViewModal.js +1 -0
  238. data/webpack/scenes/ContentViews/Create/__tests__/createContentView.test.js +21 -6
  239. data/webpack/scenes/ContentViews/Delete/Steps/CVDeleteEnvironmentsSelection.js +3 -3
  240. data/webpack/scenes/ContentViews/Delete/Steps/CVDeletionReassignActivationKeysForm.js +1 -0
  241. data/webpack/scenes/ContentViews/Delete/Steps/CVDeletionReassignHostsForm.js +1 -0
  242. data/webpack/scenes/ContentViews/Delete/__tests__/CvData.fixtures.json +2 -0
  243. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewAddModal.js +3 -0
  244. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewBulkAddModal.js +4 -1
  245. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentVersion.js +1 -1
  246. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +2 -1
  247. data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +14 -0
  248. data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +11 -1
  249. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +1 -1
  250. data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +2 -0
  251. data/webpack/scenes/ContentViews/Details/Filters/Add/CVFilterAddModal.js +5 -0
  252. data/webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositorySelection.js +1 -0
  253. data/webpack/scenes/ContentViews/Details/Filters/ArtifactsWithNoErrata.js +1 -0
  254. data/webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js +8 -2
  255. data/webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js +5 -1
  256. data/webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js +22 -6
  257. data/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js +19 -9
  258. data/webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js +9 -2
  259. data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +9 -2
  260. data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +8 -2
  261. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetailsHeader.js +1 -1
  262. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +2 -1
  263. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/CVRpmMatchContentModal.js +3 -2
  264. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentModal.test.js +1 -1
  265. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js +2 -2
  266. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +1 -1
  267. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +1 -1
  268. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js +1 -1
  269. data/webpack/scenes/ContentViews/Details/Histories/ContentViewHistories.js +2 -2
  270. data/webpack/scenes/ContentViews/Details/Promote/ContentViewVersionPromote.js +2 -0
  271. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +2 -1
  272. data/webpack/scenes/ContentViews/Details/Versions/BulkDelete/Steps/ReviewEnvironments.js +3 -3
  273. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompare.js +9 -1
  274. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js +83 -0
  275. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareTable.js +32 -8
  276. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js +56 -3
  277. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/cvCompareRepositories.fixtures.json +175 -0
  278. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +6 -2
  279. data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVEnvironmentSelectionForm.js +3 -3
  280. data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVReassignActivationKeysForm.js +1 -0
  281. data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVReassignHostsForm.js +1 -0
  282. data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedActivationKeys.js +2 -2
  283. data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedHosts.js +2 -2
  284. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js +2 -2
  285. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetails.js +1 -0
  286. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsHeader.js +4 -1
  287. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsTable.js +5 -4
  288. data/webpack/scenes/ContentViews/Publish/CVPublishForm.js +5 -1
  289. data/webpack/scenes/ContentViews/Publish/CVPublishReview.js +3 -3
  290. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +10 -5
  291. data/webpack/scenes/ContentViews/__tests__/basicContentViews.fixtures.js +2 -0
  292. data/webpack/scenes/ContentViews/__tests__/contentViewList.fixtures.json +1 -0
  293. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +81 -19
  294. data/webpack/scenes/ContentViews/components/CVBreadCrumb.js +1 -1
  295. data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.js +1 -0
  296. data/webpack/scenes/ContentViews/components/InactiveText.js +9 -1
  297. data/webpack/scenes/ContentViews/expansions/RelatedCompositeContentViewsModal.js +4 -2
  298. data/webpack/scenes/ContentViews/expansions/RelatedContentViewComponentsModal.js +3 -2
  299. data/webpack/scenes/Hosts/ChangeContentSource/actions.js +18 -11
  300. data/webpack/scenes/Hosts/ChangeContentSource/components/ContentSourceForm.js +15 -8
  301. data/webpack/scenes/Hosts/ChangeContentSource/components/FormField.js +3 -4
  302. data/webpack/scenes/Hosts/ChangeContentSource/components/Hosts.js +55 -0
  303. data/webpack/scenes/Hosts/ChangeContentSource/components/HostsModal.js +59 -0
  304. data/webpack/scenes/Hosts/ChangeContentSource/constants.js +1 -0
  305. data/webpack/scenes/Hosts/ChangeContentSource/helpers.js +2 -5
  306. data/webpack/scenes/Hosts/ChangeContentSource/index.js +46 -41
  307. data/webpack/scenes/Hosts/ChangeContentSource/selectors.js +5 -5
  308. data/webpack/scenes/ModuleStreams/Details/ModuleDetailsSchema.js +10 -1
  309. data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetails.js +1 -1
  310. data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetails.test.js.snap +97 -2
  311. data/webpack/scenes/Organizations/OrganizationSelectors.js +1 -0
  312. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CdnConfigurationConstants.js +2 -1
  313. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CdnTypeForm.js +10 -25
  314. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CustomCdnTypeForm.js +154 -0
  315. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/ExportSyncForm.js +4 -4
  316. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/NetworkSyncForm.js +59 -44
  317. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/__tests__/CdnTypeForm.test.js +3 -28
  318. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/__tests__/CustomCdnTypeForm.test.js +97 -0
  319. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/__tests__/ExportSyncForm.test.js +1 -1
  320. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/__tests__/NetworkSyncForm.test.js +4 -4
  321. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/index.js +23 -10
  322. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +1 -1
  323. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +2 -1
  324. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +5 -5
  325. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +3 -3
  326. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +2 -2
  327. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +3 -3
  328. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +3 -3
  329. data/webpack/scenes/Tasks/helpers.js +14 -7
  330. metadata +54 -35
  331. data/app/lib/actions/pulp3/orchestration/alternate_content_source/refresh_remote.rb +0 -18
  332. data/db/migrate/20221206170122_update_ignore_srpm_to_false_for_mirror_complete.rb +0 -5
  333. data/vendor/assets/javascripts/katello/jquery.trunk8.js +0 -203
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2dd589cc9f10f642c5e8eac5dec7145c6e36eb35ba7ff39da34e295998277e0f
4
- data.tar.gz: 8e6e3b9674bc9c153cb54ff2408a6c504d61c9bb95e4dd45b30ecbaabc3c1cd3
3
+ metadata.gz: 366dabf3ddc6fab48cf353603f9ac49fb9ed3c87ac47e965eba48a63b4ce4847
4
+ data.tar.gz: a8307026cb41c314df92d6a89590ee38ba7547e215bbed82dd454e5fc135c68f
5
5
  SHA512:
6
- metadata.gz: 166848d61324a18d58a58708146b5525888788707ffac5c1d0899cb9f1663a42f075628d691289c54771db0dd769bfbbdd159df68c9249c4dc87fd11f265fef8
7
- data.tar.gz: 9a693e7711623e663ceadaea211a5aa2d2b4a0c658d36fd36f1705f0d5a799a763574c75415af9373caec26f41b34de227e2e70e7a3e4915279d7603fe8c39f2
6
+ metadata.gz: 0b167060d9d9795261b6262d47fbcca7fae09a587b170e173a7cbb9ceb382371c1b8414ef7b361ab51e96088d1485f2be2d35758f34cb8574257f81951d082a5
7
+ data.tar.gz: 06b29d35d28b57eb6484a34622b9fec4b4395dcb66f938440051bb9cec8323e1f808e1216e0500183f1f6f7e894abd882a30dcd0468207df7a08126bac3e3281
@@ -3,4 +3,3 @@
3
3
  //= require "jquery-ui/effect"
4
4
  //= require "jquery-ui/effect.all"
5
5
  //= require "katello/jquery.periodicalupdater"
6
- //= require "katello/jquery.trunk8"
@@ -230,6 +230,7 @@ module Katello
230
230
  param :id, String, :desc => N_("ID of the activation key"), :required => true
231
231
  param :content_access_mode_all, :bool, :desc => N_("Get all content available, not just that provided by subscriptions")
232
232
  param :content_access_mode_env, :bool, :desc => N_("Limit content to just that available in the activation key's content view version")
233
+ param_group :search, Api::V2::ApiController
233
234
  def product_content
234
235
  # note this is just there as a place holder for apipie.
235
236
  # The routing would automatically redirect it to repository_sets#index
@@ -21,8 +21,8 @@ module Katello
21
21
  param :ssl_ca_cert_id, :number, desc: N_("Identifier of the content credential containing the SSL CA Cert"), required: false
22
22
  param :ssl_client_cert_id, :number, desc: N_("Identifier of the content credential containing the SSL Client Cert"), required: false
23
23
  param :ssl_client_key_id, :number, desc: N_("Identifier of the content credential containing the SSL Client Key"), required: false
24
- param :http_proxy_id, :number, desc: N_("ID of a HTTP Proxy"), required: false
25
24
  param :verify_ssl, :bool, desc: N_("If SSL should be verified for the upstream URL"), required: false
25
+ param :use_http_proxies, :bool, desc: N_("If the smart proxies' assigned HTTP proxies should be used"), required: false
26
26
  param :product_ids, Array, desc: N_("IDs of products to copy repository information from into a Simplified Alternate Content Source. Products must include at least one repository of the chosen content type."), required: false
27
27
  end
28
28
 
@@ -34,7 +34,7 @@ module Katello
34
34
  format.csv do
35
35
  options[:csv] = true
36
36
  alternate_content_sources = scoped_search(index_relation, :name, :asc)
37
- if @acs.custom?
37
+ if @acs.custom? || @acs.rhui?
38
38
  csv_response(alternate_content_sources,
39
39
  [:id, :name, :description, :label, :base_url, :subpaths, :content_type, :alternate_content_source_type],
40
40
  ['Id', 'Name', 'Description', 'label', 'Base URL', 'Subpaths', 'Content Type', 'Alternate Content Source Type'])
@@ -114,8 +114,8 @@ module Katello
114
114
  protected
115
115
 
116
116
  def acs_params
117
- keys = [:name, :label, :description, {smart_proxy_ids: []}, {smart_proxy_names: []}, :content_type, :alternate_content_source_type]
118
- keys += [:base_url, {subpaths: []}, :upstream_username, :upstream_password, :ssl_ca_cert_id, :ssl_client_cert_id, :ssl_client_key_id, :http_proxy_id, :verify_ssl] if params[:action] == 'create' || @alternate_content_source&.custom?
117
+ keys = [:name, :label, :description, {smart_proxy_ids: []}, {smart_proxy_names: []}, :content_type, :alternate_content_source_type, :use_http_proxies]
118
+ keys += [:base_url, {subpaths: []}, :upstream_username, :upstream_password, :ssl_ca_cert_id, :ssl_client_cert_id, :ssl_client_key_id, :verify_ssl] if params[:action] == 'create' || @alternate_content_source&.custom? || @alternate_content_source&.rhui?
119
119
  keys += [{product_ids: []}] if params[:action] == 'create' || @alternate_content_source&.simplified?
120
120
  params.require(:alternate_content_source).permit(*keys).to_h.with_indifferent_access
121
121
  end
@@ -7,6 +7,7 @@ module Katello
7
7
  before_action :find_capsule, :except => [:sync, :cancel_sync, :add_lifecycle_environment, :remove_lifecycle_environment, :reclaim_space]
8
8
  before_action :find_editable_capsule, :only => [:sync, :cancel_sync, :add_lifecycle_environment, :remove_lifecycle_environment]
9
9
  before_action :find_environment, :only => [:add_lifecycle_environment, :remove_lifecycle_environment]
10
+ before_action :find_acs_http_proxy, :only => [:add_acs_http_proxy]
10
11
  before_action :find_optional_organization, :only => [:sync_status]
11
12
 
12
13
  def_param_group :lifecycle_environments do
@@ -123,6 +124,10 @@ module Katello
123
124
  @environment = Katello::KTEnvironment.readable.find(params[:environment_id])
124
125
  end
125
126
 
127
+ def find_acs_http_proxy
128
+ @acs_http_proxy = ::HttpProxy.readable.find(params[:alternate_content_source_http_proxy_id])
129
+ end
130
+
126
131
  def find_content_view
127
132
  @content_view = Katello::ContentView.readable.find(params[:content_view_id])
128
133
  end
@@ -66,6 +66,7 @@ module Katello
66
66
  :toc,
67
67
  :incremental,
68
68
  :destination_server,
69
+ :format,
69
70
  gpg_keys: {},
70
71
  content_view: [:name, :label, :description, :generated_for],
71
72
  content_view_version: [:major, :minor, :description],
@@ -47,7 +47,7 @@ module Katello
47
47
  CAST (#{kcc}.composite_content_view_id as BOOLEAN) ASC, #{kc}.name
48
48
  SQL
49
49
  query = Katello::ContentView.readable.in_organization(@organization)
50
- query = query&.non_composite&.non_default
50
+ query = query&.non_composite&.non_default&.generated_for_none
51
51
  component_cv_ids = Katello::ContentViewComponent.where(composite_content_view_id: @view.id).select(:content_view_id)
52
52
  query = case params[:status]
53
53
  when "Not added"
@@ -24,7 +24,7 @@ module Katello
24
24
  param :service_level, String, :desc => N_("Service level to be used for autoheal")
25
25
  param :hypervisor_guest_uuids, Array, :desc => N_("List of hypervisor guest uuids")
26
26
  param :installed_products_attributes, Array, :desc => N_("List of products installed on the host") do
27
- param_group :installed_products
27
+ param_group :installed_products, Api::V2::HostSubscriptionsController
28
28
  end
29
29
  end
30
30
 
@@ -152,6 +152,7 @@ module Katello
152
152
  param :host_id, String, :desc => N_("Id of the host"), :required => true
153
153
  param :content_access_mode_all, :bool, :desc => N_("Get all content available, not just that provided by subscriptions")
154
154
  param :content_access_mode_env, :bool, :desc => N_("Limit content to just that available in the host's content view version")
155
+ param_group :search, Api::V2::ApiController
155
156
  def product_content
156
157
  # note this is just there as a place holder for apipie.
157
158
  # The routing would automatically redirect it to repository_sets#index
@@ -319,7 +319,7 @@ module Katello
319
319
  lifecycle_environment = KTEnvironment.readable.find(params[:environment_id])
320
320
  content_view = Katello::ContentView.readable.find(params[:content_view_id])
321
321
  content_source = SmartProxy.authorized(:view_smart_proxies).find(params[:content_source_id])
322
- template = prepare_ssl_cert(foreman_server_ca_cert) + configure_subman(content_source)
322
+ template = prepare_ssl_cert(foreman_server_ca_cert) + configure_subman(content_source) + reconfigure_yggdrasild(hosts.first)
323
323
 
324
324
  hosts.each do |host|
325
325
  next unless host.content_facet
@@ -29,6 +29,7 @@ module Katello
29
29
  param :hostgroup_ids, Array, N_("Host group IDs"), :required => false
30
30
  param :environment_ids, Array, N_("Environment IDs"), :required => false
31
31
  param :subnet_ids, Array, N_("Subnet IDs"), :required => false
32
+ param :ignore_types, Array, N_("List of resources types that will be automatically associated"), :required => false
32
33
  param :location_ids, Array, N_("Associated location IDs"), :required => false
33
34
  end
34
35
  end
@@ -81,7 +81,7 @@ module Katello
81
81
  def_param_group :repo_create do
82
82
  param :label, String, :required => false
83
83
  param :product_id, :number, :required => true, :desc => N_("Product the repository belongs to")
84
- param :content_type, RepositoryTypeManager.creatable_repository_types(false).keys, :required => true, :desc => N_("type of repo")
84
+ param :content_type, String, :required => true, :desc => N_("Type of repository. Available types endpoint: /katello/api/repositories/repository_types")
85
85
  end
86
86
 
87
87
  api :GET, "/repositories", N_("List of enabled repositories")
@@ -102,18 +102,28 @@ module Katello
102
102
  param :ansible_collection_id, String, :desc => N_("Id of an ansible collection to find repositories that contain the ansible collection")
103
103
  param :library, :bool, :desc => N_("show repositories in Library and the default content view")
104
104
  param :archived, :bool, :desc => N_("show archived repositories")
105
- param :content_type, RepositoryTypeManager.defined_repository_types.keys, :desc => N_("limit to only repositories of this type")
105
+ param :content_type, String, :desc => N_("Limit the repository type. Available types endpoint: /katello/api/repositories/repository_types")
106
106
  param :name, String, :desc => N_("name of the repository"), :required => false
107
107
  param :label, String, :desc => N_("label of the repository"), :required => false
108
108
  param :description, String, :desc => N_("description of the repository")
109
109
  param :available_for, String, :desc => N_("interpret specified object to return only Repositories that can be associated with specified object. Only 'content_view' & 'content_view_version' are supported."),
110
110
  :required => false
111
- param :with_content, RepositoryTypeManager.enabled_content_types(false), :desc => N_("only repositories having at least one of the specified content type ex: rpm , erratum")
111
+ param :with_content, String, :desc => N_("Filter repositories by content unit type (erratum, docker_tag, etc.). Check the \"Indexed?\" types here: /katello/api/repositories/repository_types")
112
112
  param :download_policy, ::Katello::RootRepository::DOWNLOAD_POLICIES, :desc => N_("limit to only repositories with this download policy")
113
113
  param :username, String, :desc => N_("only show the repositories readable by this user with this username")
114
114
  param_group :search, Api::V2::ApiController
115
115
  add_scoped_search_description_for(Repository)
116
116
  def index
117
+ unless params[:content_type].empty? || RepositoryTypeManager.find(params[:content_type])
118
+ msg = _("Invalid params provided - content_type must be one of %s") %
119
+ RepositoryTypeManager.enabled_repository_types.keys.sort.join(",")
120
+ fail HttpErrors::UnprocessableEntity, msg
121
+ end
122
+ unless params[:with_content].empty? || RepositoryTypeManager.find_content_type(params[:with_content], true)
123
+ msg = _("Invalid params provided - with_content must be one of %s") %
124
+ RepositoryTypeManager.indexable_content_types.map(&:label).sort.join(",")
125
+ fail HttpErrors::UnprocessableEntity, msg
126
+ end
117
127
  base_args = [index_relation.distinct, :name, :asc]
118
128
  options = {:includes => [:environment, {:root => [:gpg_key, :product]}]}
119
129
 
@@ -224,6 +234,51 @@ module Katello
224
234
  query
225
235
  end
226
236
 
237
+ api :GET, "/repositories/compare/", N_("List :resource")
238
+ param :content_view_version_ids, Array, :desc => N_("content view versions to compare")
239
+ param :repository_id, :number, :desc => N_("Library repository id to restrict comparisons to")
240
+ param :restrict_comparison, String, :desc => N_("Return same, different or all results")
241
+
242
+ def compare
243
+ fail _("No content_view_version_ids provided") if params[:content_view_version_ids].empty?
244
+ @versions = ContentViewVersion.readable.where(:id => params[:content_view_version_ids])
245
+ if @versions.count != params[:content_view_version_ids].uniq.length
246
+ missing = params[:content_view_version_ids] - @versions.pluck(:id)
247
+ fail HttpErrors::NotFound, _("Couldn't find content view versions '%s'") % missing.join(',')
248
+ end
249
+
250
+ archived_version_repos = Katello::Repository.where(:content_view_version_id => @versions&.pluck(:id))&.archived
251
+ repos = Katello::Repository.where(id: archived_version_repos&.pluck(:library_instance_id))
252
+ repos = repos.where(:root_id => @repo.root_id) if @repo
253
+ repositories = restrict_comparison(repos, @versions, params[:restrict_comparison])
254
+ collection = scoped_search(repositories.distinct, :name, :asc)
255
+ collection[:results] = collection[:results].map { |item| ContentViewVersionComparePresenter.new(item, @versions, @repo) }
256
+ respond_for_index(:collection => collection)
257
+ end
258
+
259
+ def restrict_comparison(collection, content_view_versions = nil, compare = 'all')
260
+ case compare
261
+ when 'same'
262
+ same_repo_ids = compare_same(collection, content_view_versions)
263
+ collection.where(id: same_repo_ids)
264
+ when 'different'
265
+ same_repo_ids = compare_same(collection, content_view_versions)
266
+ collection.where.not(id: same_repo_ids)
267
+ else
268
+ collection
269
+ end
270
+ end
271
+
272
+ def compare_same(collection, content_view_versions = nil)
273
+ same_repo_ids = []
274
+ collection.each do |repo|
275
+ if (content_view_versions&.pluck(:id)&.- repo.published_in_versions&.pluck(:id))&.empty?
276
+ same_repo_ids << repo.id
277
+ end
278
+ end
279
+ same_repo_ids
280
+ end
281
+
227
282
  api :POST, "/repositories", N_("Create a custom repository")
228
283
  param :name, String, :desc => N_("Name of the repository"), :required => true
229
284
  param :description, String, :desc => N_("Description of the repository"), :required => false
@@ -233,7 +288,7 @@ module Katello
233
288
  repo_params = repository_params
234
289
  unless RepositoryTypeManager.creatable_by_user?(repo_params[:content_type], false)
235
290
  msg = _("Invalid params provided - content_type must be one of %s") %
236
- RepositoryTypeManager.creatable_repository_types(false).keys.join(",")
291
+ RepositoryTypeManager.creatable_repository_types.keys.sort.join(",")
237
292
  fail HttpErrors::UnprocessableEntity, msg
238
293
  end
239
294
 
@@ -374,9 +429,14 @@ module Katello
374
429
  desc "Remove content from a repository"
375
430
  param :id, :number, :required => true, :desc => "repository ID"
376
431
  param 'ids', Array, :required => true, :desc => "Array of content ids to remove"
377
- param :content_type, RepositoryTypeManager.removable_content_types(false).map(&:label), :required => false, :desc => N_("content type ('deb', 'docker_manifest', 'file', 'ostree', 'rpm', 'srpm')")
432
+ param :content_type, String, :required => false, :desc => N_("The type of content to remove (srpm, docker_manifest, etc.). Check removable types here: /katello/api/repositories/repository_types")
378
433
  param 'sync_capsule', :bool, :desc => N_("Whether or not to sync an external capsule after upload. Default: true")
379
434
  def remove_content
435
+ unless params[:content_type].empty? || RepositoryTypeManager.removable_content_types.map(&:label).include?(params[:content_type])
436
+ msg = _("Invalid params provided - content_type must be one of %s") %
437
+ RepositoryTypeManager.removable_content_types.map(&:label).sort.join(",")
438
+ fail HttpErrors::UnprocessableEntity, msg
439
+ end
380
440
  sync_capsule = ::Foreman::Cast.to_bool(params.fetch(:sync_capsule, true))
381
441
  fail _("No content ids provided") if @content.blank?
382
442
  respond_for_async :resource => sync_task(::Actions::Katello::Repository::RemoveContent, @repository, @content, content_type: params[:content_type], sync_capsule: sync_capsule)
@@ -385,7 +445,7 @@ module Katello
385
445
  api :POST, "/repositories/:id/upload_content", N_("Upload content into the repository")
386
446
  param :id, :number, :required => true, :desc => N_("repository ID")
387
447
  param :content, File, :required => true, :desc => N_("Content files to upload. Can be a single file or array of files.")
388
- param :content_type, RepositoryTypeManager.uploadable_content_types(false).map(&:label), :required => false, :desc => N_("content type ('deb', 'docker_manifest', 'file', 'ostree', 'rpm', 'srpm')")
448
+ param :content_type, String, :required => false, :desc => N_("The type of content to upload (srpm, file, etc.). Check uploadable types here: /katello/api/repositories/repository_types")
389
449
  def upload_content
390
450
  fail Katello::Errors::InvalidRepositoryContent, _("Cannot upload Container Image content.") if @repository.docker?
391
451
  fail Katello::Errors::InvalidRepositoryContent, _("Cannot upload Ansible collections.") if @repository.ansible_collection?
@@ -426,7 +486,7 @@ module Katello
426
486
  param 'content_unit_id', String
427
487
  param 'size', String
428
488
  param 'checksum', String
429
- param 'name', String, :desc => N_("Needs to only be set for file repositories or docker tags")
489
+ param 'name', String, :desc => N_("Needs to only be set for file repositories or docker tags"), :required => true
430
490
  param 'digest', String, :desc => N_("Needs to only be set for docker tags")
431
491
  end
432
492
  Katello::RepositoryTypeManager.generic_repository_types.each_pair do |_, repo_type|
@@ -447,6 +507,14 @@ module Katello
447
507
  upload.permit(:id, :content_unit_id, :size, :checksum, :name, :digest).to_h
448
508
  end
449
509
 
510
+ if @repository.content_type != 'docker' && uploads.first['checksum'].nil?
511
+ fail HttpErrors::BadRequest, _('Checksum is a required parameter.')
512
+ end
513
+
514
+ if uploads.first['name'].nil?
515
+ fail HttpErrors::BadRequest, _('Name is a required parameter.')
516
+ end
517
+
450
518
  begin
451
519
  upload_args = {
452
520
  content_type: params[:content_type],
@@ -598,7 +666,7 @@ module Katello
598
666
 
599
667
  def handle_mirror_on_sync(repo_params)
600
668
  if !repo_params.key?(:mirroring_policy) && repo_params.key?(:mirror_on_sync)
601
- ::Foreman::Deprecation.api_deprecation_warning("mirror_on_sync is deprecated in favor of mirroring_policy. It will be removed in Katello 4.6.")
669
+ ::Foreman::Deprecation.api_deprecation_warning("mirror_on_sync is deprecated in favor of mirroring_policy. It will be removed in Katello 4.8.")
602
670
  if ::Foreman::Cast.to_bool(repo_params[:mirror_on_sync])
603
671
  repo_params[:mirroring_policy] = Katello::RootRepository::MIRRORING_POLICY_CONTENT
604
672
  else
@@ -664,12 +732,10 @@ module Katello
664
732
  end
665
733
 
666
734
  def generic_remote_options_hash(repo_params)
667
- generic_remote_options = {}
668
735
  content_type = @repository&.content_type || repo_params[:content_type]
669
- RepositoryTypeManager.generic_remote_options(content_type: content_type).each do |option|
670
- generic_remote_options[option.name] = repo_params[option.name]
736
+ RepositoryTypeManager.generic_remote_options(content_type: content_type).to_h do |option|
737
+ [option.name, repo_params[option.name].nil? ? option&.default : repo_params[option.name]]
671
738
  end
672
- generic_remote_options
673
739
  end
674
740
 
675
741
  def generic_content_type_import_upload_args
@@ -48,7 +48,7 @@ module Katello
48
48
  end
49
49
 
50
50
  api :DELETE, "/organizations/:organization_id/upstream_subscriptions",
51
- N_("Remove one or more subscriptions from an upstream subscription allocation")
51
+ N_("Remove one or more subscriptions from an upstream manifest")
52
52
  param :organization_id, :number, :desc => N_("Organization ID"), :required => true
53
53
  param :pool_ids, Array, desc: N_("Array of local pool IDs. Only pools originating upstream are accepted."), required: true
54
54
  def destroy
@@ -2,6 +2,7 @@ module Katello
2
2
  module Concerns
3
3
  module Api::V2::RegistrationControllerExtensions
4
4
  extend ActiveSupport::Concern
5
+ include ::Foreman::Controller::SmartProxyAuth
5
6
 
6
7
  def prepare_host
7
8
  if params['uuid']
@@ -35,7 +36,7 @@ module Katello
35
36
 
36
37
  def smart_proxy
37
38
  @smart_proxy ||= begin
38
- proxy = params[:url] ? SmartProxy.unscoped.find_by(url: params[:url]) : SmartProxy.pulp_primary
39
+ proxy = params[:url] ? find_smart_proxy : SmartProxy.pulp_primary
39
40
 
40
41
  fail Foreman::Exception, _('Smart proxy content source not found!') unless proxy
41
42
  fail Foreman::Exception, _('Pulp 3 is not enabled on Smart proxy!') unless proxy.pulp3_enabled?
@@ -43,6 +44,11 @@ module Katello
43
44
  proxy
44
45
  end
45
46
  end
47
+
48
+ def find_smart_proxy
49
+ auth_smart_proxy
50
+ @detected_proxy
51
+ end
46
52
  end
47
53
  end
48
54
  end
@@ -8,6 +8,7 @@ module Katello
8
8
  param :smart_proxy, Hash do
9
9
  param :download_policy, String, :required => false, :desc => N_('Download Policy of the capsule, must be one of %s') %
10
10
  SmartProxy::DOWNLOAD_POLICIES.join(', ')
11
+ param :http_proxy_id, Integer, :required => false, :desc => N_('Id of the HTTP proxy to use with alternate content sources')
11
12
  end
12
13
  end
13
14
  end
@@ -72,30 +72,32 @@ module Katello
72
72
  end
73
73
 
74
74
  def change_content_source_data
75
- hosts = ::Host.where(id: params[:host_ids])
76
- content_hosts_ids = []
75
+ hosts = params[:search].presence ? ::Host.search_for(params[:search]) : ::Host.where(id: params[:host_ids])
76
+ content_hosts = []
77
77
  hosts_without_content = []
78
78
 
79
79
  hosts.each do |host|
80
80
  if host.content_facet
81
- content_hosts_ids << host.id
81
+ content_hosts << { id: host.id, name: host.name }
82
82
  else
83
- hosts_without_content << host.name
83
+ hosts_without_content << { id: host.id, name: host.name }
84
84
  end
85
85
  end
86
86
 
87
- environments = KTEnvironment.readable.where(organization: Organization.current).includes([:organization, :env_priors, :priors]).order(:name)
88
- content_sources = SmartProxy.authorized(:view_smart_proxies).with_content.includes([:smart_proxy_features])
87
+ content_sources = SmartProxy.authorized(:view_smart_proxies)
88
+ .with_content
89
+ .includes([:smart_proxy_features])
90
+ .joins(:lifecycle_environments)
91
+ .distinct
89
92
 
90
93
  if Katello.with_remote_execution?
91
94
  template_id = JobTemplate.find_by(name: 'Change content source')&.id
92
- job_invocation_path = new_job_invocation_path(template_id: template_id, host_ids: content_hosts_ids) if template_id
95
+ job_invocation_path = new_job_invocation_path(template_id: template_id, host_ids: content_hosts.map { |h| h[:id] }) if template_id
93
96
  end
94
97
 
95
98
  render json: {
96
- content_hosts_ids: content_hosts_ids,
99
+ content_hosts: content_hosts,
97
100
  hosts_without_content: hosts_without_content,
98
- environments: environments,
99
101
  content_sources: content_sources,
100
102
  job_invocation_path: job_invocation_path
101
103
  }
@@ -41,5 +41,14 @@ module Katello
41
41
  subscription-manager facts --update
42
42
  CMD
43
43
  end
44
+
45
+ def reconfigure_yggdrasild(host)
46
+ template = Template.find_by(name: 'remote_execution_pull_setup')
47
+ return '' unless template
48
+
49
+ source = Foreman::Renderer.get_source(template: template, host: host)
50
+ scope = Foreman::Renderer.get_scope(source: source, host: host)
51
+ Foreman::Renderer.render(source, scope)
52
+ end
44
53
  end
45
54
  end
@@ -269,6 +269,37 @@ module Katello
269
269
  [{ action: [_('Change Content Source'), '/change_host_content_source', false], priority: 100 }]
270
270
  end
271
271
 
272
+ def host_status_icon(status)
273
+ colours = [:green, :yellow, :red]
274
+
275
+ colour = colours[status] || :red
276
+
277
+ icons = {
278
+ green: "#{colour} host-status pficon pficon-ok status-ok",
279
+ yellow: "#{colour} host-status pficon pficon-info status-warn",
280
+ red: "#{colour} host-status pficon pficon-error-circle-o status-error"
281
+ }
282
+
283
+ "<span class=\"#{icons[colour]}\"></span>".html_safe
284
+ end
285
+
286
+ def errata_counts(host)
287
+ counts = host.content_facet_attributes&.errata_counts || {}
288
+ render partial: 'katello/hosts/errata_counts', locals: { counts: counts, host: host }
289
+ end
290
+
291
+ def host_registered_time(host)
292
+ return _('Never registered') unless host.subscription_facet_attributes&.registered_at
293
+
294
+ date_time_relative_value(host.subscription_facet_attributes.registered_at)
295
+ end
296
+
297
+ def host_checkin_time(host)
298
+ return _('Never checked in') unless host.subscription_facet_attributes&.last_checkin
299
+
300
+ date_time_relative_value(host.subscription_facet_attributes.last_checkin)
301
+ end
302
+
272
303
  private
273
304
 
274
305
  def hostgroup_content_facet(hostgroup, param_host)
@@ -3,6 +3,7 @@ module Actions
3
3
  module ActivationKey
4
4
  class Destroy < Actions::EntryAction
5
5
  def plan(activation_key, options = {})
6
+ activation_key.validate_destroyable!
6
7
  skip_candlepin = options.fetch(:skip_candlepin, false)
7
8
  action_subject(activation_key)
8
9
 
@@ -91,6 +91,7 @@ module Actions
91
91
  if finish_limit < DateTime.now
92
92
  fail _("Host did not finish content action in %s seconds. The task has been cancelled.") % finish_timeout
93
93
  end
94
+ suspend
94
95
  end
95
96
  end
96
97
 
@@ -11,7 +11,7 @@ module Actions
11
11
  smart_proxies = smart_proxies.present? ? smart_proxies.uniq : []
12
12
  concurrence do
13
13
  smart_proxies.each do |smart_proxy|
14
- if acs.custom?
14
+ if acs.custom? || acs.rhui?
15
15
  smart_proxy_acs = ::Katello::SmartProxyAlternateContentSource.create(alternate_content_source_id: acs.id, smart_proxy_id: smart_proxy.id)
16
16
  plan_action(Pulp3::Orchestration::AlternateContentSource::Create, smart_proxy_acs)
17
17
  elsif acs.simplified?
@@ -37,7 +37,7 @@ module Actions
37
37
 
38
38
  def create_acss(acs, smart_proxies_to_associate)
39
39
  smart_proxies_to_associate&.each do |smart_proxy|
40
- if acs.custom?
40
+ if acs.custom? || acs.rhui?
41
41
  smart_proxy_acs = ::Katello::SmartProxyAlternateContentSource.create(alternate_content_source_id: acs.id, smart_proxy_id: smart_proxy.id)
42
42
  plan_action(Pulp3::Orchestration::AlternateContentSource::Create, smart_proxy_acs)
43
43
  elsif acs.simplified?
@@ -56,7 +56,7 @@ module Actions
56
56
 
57
57
  def update_acss(acs, smart_proxies_to_update, products_to_associate, products_to_disassociate)
58
58
  smart_proxies_to_update&.each do |smart_proxy|
59
- if acs.custom?
59
+ if acs.custom? || acs.rhui?
60
60
  smart_proxy_acs = ::Katello::SmartProxyAlternateContentSource.find_by(alternate_content_source_id: acs.id, smart_proxy_id: smart_proxy.id, repository_id: nil)
61
61
  plan_action(Pulp3::Orchestration::AlternateContentSource::Update, smart_proxy_acs)
62
62
  elsif acs.simplified?
@@ -31,8 +31,8 @@ module Actions
31
31
  fail _("Action not allowed for the default smart proxy.") if smart_proxy.pulp_primary?
32
32
 
33
33
  refresh_options = options.merge(content_view: content_view,
34
- environment: environment,
35
- repository: repository)
34
+ environment: environment,
35
+ repository: repository)
36
36
  sequence do
37
37
  if smart_proxy.has_feature?(SmartProxy::PULP_NODE_FEATURE)
38
38
  plan_action(Actions::Pulp::Orchestration::Repository::RefreshRepos, smart_proxy, refresh_options)
@@ -44,6 +44,14 @@ module Actions
44
44
  end
45
45
  plan_action(SyncCapsule, smart_proxy, refresh_options)
46
46
  end
47
+ plan_self(smart_proxy_id: smart_proxy.id)
48
+ end
49
+
50
+ def finalize
51
+ smart_proxy = SmartProxy.unscoped.authorized(:view_capsule_content).find(input[:smart_proxy_id])
52
+ unless smart_proxy&.pulp_primary?
53
+ smart_proxy&.audit_capsule_sync
54
+ end
47
55
  end
48
56
  end
49
57
  end
@@ -18,7 +18,7 @@ module Actions
18
18
  org = cdn_configuration.organization
19
19
  roots = ::Katello::RootRepository.redhat.in_organization(org)
20
20
  roots.each do |root|
21
- full_path = if cdn_configuration.redhat_cdn?
21
+ full_path = if cdn_configuration.redhat_cdn? || cdn_configuration.custom_cdn?
22
22
  root.product.repo_url(root.library_instance.generate_content_path)
23
23
  elsif cdn_configuration.network_sync?
24
24
  resource.repository_url(content_label: root.content.label, arch: root.arch, major: root.major, minor: root.minor)
@@ -8,6 +8,7 @@ module Actions
8
8
  def plan(version, environments, is_force = false, description = nil, incremental_update = false)
9
9
  action_subject(version.content_view)
10
10
  version.check_ready_to_promote!(environments)
11
+ ::Katello::Util::CandlepinRepositoryChecker.check_repositories_for_promote!(version)
11
12
 
12
13
  fail ::Katello::HttpErrors::BadRequest, _("Cannot promote environment out of sequence. Use force to bypass restriction.") if !is_force && !version.promotable?(environments)
13
14
 
@@ -9,10 +9,13 @@ module Actions
9
9
  execution_plan_hooks.use :trigger_capsule_sync, :on => :success
10
10
 
11
11
  # rubocop:disable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity
12
- def plan(content_view, description = "", options = {importing: false}) # rubocop:disable Metrics/PerceivedComplexity
12
+ def plan(content_view, description = "", options = {importing: false, syncable: false}) # rubocop:disable Metrics/PerceivedComplexity
13
13
  action_subject(content_view)
14
14
 
15
- content_view.check_ready_to_publish!(importing: options[:importing])
15
+ content_view.check_ready_to_publish!(options.slice(:importing, :syncable))
16
+ unless options[:importing] || options[:syncable]
17
+ ::Katello::Util::CandlepinRepositoryChecker.check_repositories_for_publish!(content_view)
18
+ end
16
19
 
17
20
  if options[:repos_units].present?
18
21
  valid_labels_from_cv = content_view.repositories.map(&:label)
@@ -2,16 +2,20 @@ module Actions
2
2
  module Katello
3
3
  module ContentViewVersion
4
4
  class AutoCreateRedhatRepositories < Actions::Base
5
- def plan(import:)
5
+ def plan(import:, path:)
6
6
  helper = ::Katello::Pulp3::ContentViewVersion::ImportableRepositories.new(
7
7
  organization: import.organization,
8
- metadata_repositories: import.metadata_map.repositories.select { |r| r.redhat }
8
+ metadata_repositories: import.metadata_map.repositories.select { |r| r.redhat },
9
+ syncable_format: import.metadata_map.syncable_format?,
10
+ path: path
9
11
  )
10
12
  helper.generate!
11
13
 
12
14
  sequence do
13
15
  helper.creatable.each do |root|
14
- plan_action(::Actions::Katello::RepositorySet::EnableRepository, root[:product], root[:content], root[:substitutions])
16
+ plan_action(::Actions::Katello::RepositorySet::EnableRepository,
17
+ root[:product], root[:content], root[:substitutions],
18
+ override_url: root[:override_url])
15
19
  end
16
20
  helper.updatable.each do |root|
17
21
  plan_action(::Actions::Katello::Repository::Update, root[:repository], root[:options])
@@ -2,10 +2,12 @@ module Actions
2
2
  module Katello
3
3
  module ContentViewVersion
4
4
  class AutoCreateRepositories < Actions::Base
5
- def plan(import:)
5
+ def plan(import:, path:)
6
6
  helper = ::Katello::Pulp3::ContentViewVersion::ImportableRepositories.new(
7
7
  organization: import.organization,
8
- metadata_repositories: import.metadata_map.repositories.select { |r| !r.redhat }
8
+ metadata_repositories: import.metadata_map.repositories.select { |r| !r.redhat },
9
+ syncable_format: import.metadata_map.syncable_format?,
10
+ path: path
9
11
  )
10
12
  helper.generate!
11
13