katello 3.16.2 → 3.17.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 (381) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/katello/katello.scss +3 -7
  3. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -1
  4. data/app/controllers/katello/api/v2/activation_keys_controller.rb +8 -0
  5. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +10 -4
  6. data/app/controllers/katello/api/v2/host_tracer_controller.rb +33 -8
  7. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +11 -11
  8. data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +0 -15
  9. data/app/controllers/katello/api/v2/repositories_controller.rb +5 -11
  10. data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +16 -0
  11. data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +4 -4
  12. data/app/controllers/katello/concerns/api/v2/hostgroups_controller_extensions.rb +1 -1
  13. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +5 -11
  14. data/app/helpers/katello/concerns/dashboard_helper_extensions.rb +10 -0
  15. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +6 -7
  16. data/app/lib/actions/candlepin/product/content_add.rb +2 -1
  17. data/app/lib/actions/candlepin/product/content_update_enablement.rb +18 -0
  18. data/app/lib/actions/katello/applicability/hosts/bulk_generate.rb +2 -6
  19. data/app/lib/actions/katello/capsule_content/refresh_repos.rb +1 -1
  20. data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
  21. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +3 -17
  22. data/app/lib/actions/katello/content_view_version/incremental_update.rb +2 -3
  23. data/app/lib/actions/katello/organization/simple_content_access/disable.rb +17 -0
  24. data/app/lib/actions/katello/organization/simple_content_access/enable.rb +17 -0
  25. data/app/lib/actions/katello/organization/simple_content_access/toggle.rb +36 -0
  26. data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +13 -0
  27. data/app/lib/actions/katello/product/content_create.rb +3 -3
  28. data/app/lib/actions/katello/product/destroy.rb +4 -25
  29. data/app/lib/actions/katello/repository/content_update.rb +41 -0
  30. data/app/lib/actions/katello/repository/destroy.rb +1 -5
  31. data/app/lib/actions/katello/repository/export.rb +1 -1
  32. data/app/lib/actions/katello/repository/multi_clone_contents.rb +15 -13
  33. data/app/lib/actions/katello/repository/sync.rb +25 -35
  34. data/app/lib/actions/katello/repository/update.rb +19 -30
  35. data/app/lib/actions/katello/repository/update_cv_repo_cert_guard.rb +17 -0
  36. data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +1 -0
  37. data/app/lib/actions/pulp/orchestration/repository/sync.rb +1 -2
  38. data/app/lib/actions/pulp/repository/sync.rb +1 -2
  39. data/app/lib/actions/pulp3/abstract_async_task.rb +0 -1
  40. data/app/lib/actions/pulp3/capsule_content/sync.rb +1 -3
  41. data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -1
  42. data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +2 -1
  43. data/app/lib/actions/pulp3/orchestration/repository/sync.rb +1 -3
  44. data/app/lib/actions/pulp3/repository/copy_content.rb +1 -0
  45. data/app/lib/actions/pulp3/repository/delete.rb +1 -1
  46. data/app/lib/actions/pulp3/repository/multi_copy_content.rb +1 -1
  47. data/app/lib/actions/pulp3/repository/save_version.rb +16 -20
  48. data/app/lib/actions/pulp3/repository/sync.rb +1 -1
  49. data/app/lib/actions/pulp3/repository/update_cv_repository_cert_guard.rb +2 -6
  50. data/app/lib/actions/pulp3/repository/upload_file.rb +1 -1
  51. data/app/lib/katello/resources/candlepin/product.rb +11 -0
  52. data/app/lib/katello/resources/cdn.rb +2 -3
  53. data/app/lib/katello/util/cdn_var_substitutor.rb +7 -9
  54. data/app/lib/katello/validators/hostgroup_kickstart_repository_validator.rb +11 -11
  55. data/app/models/katello/activation_key.rb +1 -1
  56. data/app/models/katello/concerns/content_facet_host_extensions.rb +7 -0
  57. data/app/models/katello/concerns/host_managed_extensions.rb +39 -0
  58. data/app/models/katello/concerns/hostgroup_extensions.rb +46 -24
  59. data/app/models/katello/concerns/smart_proxy_extensions.rb +5 -19
  60. data/app/models/katello/concerns/widget_extensions.rb +23 -0
  61. data/app/models/katello/content_view.rb +9 -1
  62. data/app/models/katello/content_view_package_filter.rb +1 -1
  63. data/app/models/katello/content_view_version.rb +7 -0
  64. data/app/models/katello/erratum.rb +13 -0
  65. data/app/models/katello/erratum_cve.rb +8 -0
  66. data/app/models/katello/glue/pulp/repo.rb +1 -1
  67. data/app/models/katello/host/content_facet.rb +18 -1
  68. data/app/models/katello/host_collection.rb +6 -0
  69. data/app/models/katello/hostgroup/content_facet.rb +18 -0
  70. data/app/models/katello/installed_package.rb +8 -0
  71. data/app/models/katello/kt_environment.rb +9 -1
  72. data/app/models/katello/model.rb +16 -0
  73. data/app/models/katello/pool.rb +17 -0
  74. data/app/models/katello/product.rb +6 -0
  75. data/app/models/katello/purpose_addons_status.rb +1 -0
  76. data/app/models/katello/purpose_role_status.rb +1 -0
  77. data/app/models/katello/purpose_sla_status.rb +1 -0
  78. data/app/models/katello/purpose_usage_status.rb +1 -0
  79. data/app/models/katello/repository.rb +3 -6
  80. data/app/models/katello/root_repository.rb +24 -16
  81. data/app/models/katello/subscription_status.rb +1 -1
  82. data/app/models/katello/trace_status.rb +1 -1
  83. data/app/models/setting/content.rb +6 -2
  84. data/app/services/cert/certs.rb +2 -10
  85. data/app/services/katello/event_daemon.rb +7 -8
  86. data/app/services/katello/host_status_manager.rb +13 -0
  87. data/app/services/katello/pulp3/migration.rb +1 -1
  88. data/app/services/katello/pulp3/repository/yum.rb +6 -72
  89. data/app/services/katello/pulp3/repository.rb +11 -10
  90. data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +1 -1
  91. data/app/services/katello/pulp3/task.rb +3 -3
  92. data/app/services/katello/pulp3/task_group.rb +0 -6
  93. data/app/services/katello/smart_proxy_helper.rb +16 -13
  94. data/app/views/foreman/smart_proxies/_content_sync.html.erb +1 -1
  95. data/app/views/katello/api/v2/repositories/base.json.rabl +1 -1
  96. data/config/routes/api/rhsm.rb +0 -1
  97. data/config/routes/api/v2.rb +8 -2
  98. data/config/routes/overrides.rb +0 -4
  99. data/db/migrate/20141222151001_add_host_content_view_environment.rb +1 -1
  100. data/db/migrate/20180904122343_create_hostgroup_content_facet.katello.rb +16 -0
  101. data/db/migrate/20200514092553_move_katello_fields_from_hostgroups.katello.rb +53 -0
  102. data/db/migrate/20200610112009_remove_audits_of_root_repo_with_content_id.rb +9 -0
  103. data/db/migrate/20200701150946_add_auto_enabled_to_root_repository.rb +5 -0
  104. data/db/seeds.d/75-job_templates.rb +2 -2
  105. data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +3 -1
  106. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-associations.controller.js +5 -2
  107. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details.controller.js +4 -2
  108. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-add-subscriptions.html +1 -1
  109. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-associations-content-hosts.html +2 -2
  110. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-details.html +1 -1
  111. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +4 -1
  112. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js +4 -1
  113. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-subscriptions-modal.controller.js +1 -0
  114. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-traces-modal.controller.js +4 -3
  115. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-environment-modal.html +7 -1
  116. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +1 -0
  117. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +1 -0
  118. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +4 -2
  119. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.routes.js +1 -1
  120. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +7 -1
  121. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +4 -2
  122. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-add-subscriptions.html +1 -1
  123. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +1 -0
  124. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +14 -6
  125. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions-list.html +1 -1
  126. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +6 -6
  127. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +5 -2
  128. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +1 -1
  129. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +1 -2
  130. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-traces-resolve.factory.js +18 -0
  131. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +45 -4
  132. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +1 -1
  133. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +1 -1
  134. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +1 -1
  135. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/it.po +1 -1
  136. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +1 -1
  137. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +1 -1
  138. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +1 -1
  139. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ru.po +1 -1
  140. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +1 -1
  141. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +1 -1
  142. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/product-bulk-action.factory.js +0 -1
  143. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +0 -6
  144. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details.html +1 -7
  145. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +11 -1
  146. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +1 -1
  147. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +16 -4
  148. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository.factory.js +0 -1
  149. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +0 -15
  150. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/views/products.html +0 -6
  151. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +1 -1
  152. data/lib/katello/engine.rb +6 -5
  153. data/lib/katello/permission_creator.rb +3 -3
  154. data/lib/katello/permissions/host_permissions.rb +0 -1
  155. data/lib/katello/plugin.rb +20 -16
  156. data/lib/katello/tasks/pulp3_post_migration_check.rake +1 -2
  157. data/lib/katello/tasks/reimport.rake +1 -1
  158. data/lib/katello/tasks/reports.rake +0 -12
  159. data/lib/katello/tasks/test.rake +15 -0
  160. data/lib/katello/version.rb +1 -1
  161. data/locale/action_names.rb +48 -48
  162. data/locale/bn/katello.po +137 -14
  163. data/locale/cs/katello.po +137 -14
  164. data/locale/de/katello.po +138 -15
  165. data/locale/en/katello.po +137 -14
  166. data/locale/es/katello.po +138 -15
  167. data/locale/fr/katello.po +138 -15
  168. data/locale/gu/katello.po +137 -14
  169. data/locale/hi/katello.po +137 -14
  170. data/locale/it/katello.po +138 -15
  171. data/locale/ja/katello.po +138 -15
  172. data/locale/katello.pot +969 -769
  173. data/locale/kn/katello.po +137 -14
  174. data/locale/ko/katello.po +138 -15
  175. data/locale/mr/katello.po +137 -14
  176. data/locale/or/katello.po +137 -14
  177. data/locale/pa/katello.po +137 -14
  178. data/locale/pt/katello.po +137 -14
  179. data/locale/pt_BR/katello.po +138 -15
  180. data/locale/ru/katello.po +138 -15
  181. data/locale/ta/katello.po +137 -14
  182. data/locale/te/katello.po +137 -14
  183. data/locale/zh_CN/katello.po +138 -15
  184. data/locale/zh_TW/katello.po +138 -15
  185. data/package.json +8 -25
  186. data/webpack/__mocks__/foremanReact/Root/Context/ForemanContext.js +3 -0
  187. data/webpack/components/ActionableDetail.js +63 -0
  188. data/webpack/components/Content/ContentTable.js +2 -2
  189. data/webpack/components/Content/Details/ContentDetailRepositoryTableSchema.js +1 -1
  190. data/webpack/components/Content/Details/ContentDetails.js +1 -1
  191. data/webpack/components/Content/__tests__/ContentTable.test.js +2 -2
  192. data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +1 -1
  193. data/webpack/components/EditableSwitch.js +30 -0
  194. data/webpack/components/EditableTextInput/EditableTextInput.js +120 -0
  195. data/webpack/components/EditableTextInput/__tests__/editableTextInput.test.js +52 -0
  196. data/webpack/components/EditableTextInput/editableTextInput.scss +14 -0
  197. data/webpack/components/EditableTextInput/index.js +3 -0
  198. data/webpack/{scenes/ContentViews/components → components}/Loading.js +8 -5
  199. data/webpack/{move_to_pf → components}/LoadingState/LoadingState.js +0 -0
  200. data/webpack/{move_to_pf → components}/LoadingState/LoadingState.scss +0 -0
  201. data/webpack/{move_to_pf → components}/LoadingState/LoadingState.test.js +0 -0
  202. data/webpack/{move_to_pf → components}/LoadingState/__snapshots__/LoadingState.test.js.snap +0 -0
  203. data/webpack/{move_to_pf → components}/LoadingState/index.js +0 -0
  204. data/webpack/components/MultiSelect/index.js +1 -1
  205. data/webpack/{move_to_pf → components}/OptionTooltip/OptionTooltip.scss +0 -0
  206. data/webpack/{move_to_pf → components}/OptionTooltip/__tests__/OptionTooltip.test.js +0 -0
  207. data/webpack/{move_to_pf → components}/OptionTooltip/__tests__/__snapshots__/OptionTooltip.test.js.snap +0 -0
  208. data/webpack/{move_to_pf → components}/OptionTooltip/index.js +0 -0
  209. data/webpack/components/Search/Search.js +124 -0
  210. data/webpack/components/Search/Search.test.js +2 -1
  211. data/webpack/components/Search/__snapshots__/Search.test.js.snap +2 -0
  212. data/webpack/components/Search/__tests__/search.test.js +124 -0
  213. data/webpack/components/Search/index.js +11 -87
  214. data/webpack/{move_to_pf → components}/Select/Select.js +0 -0
  215. data/webpack/components/SelectOrg/SetOrganization.js +2 -2
  216. data/webpack/components/TabWrapper/TabWrapper.js +26 -0
  217. data/webpack/components/TabWrapper/index.js +3 -0
  218. data/webpack/components/TabbedView/TabbedView.js +38 -0
  219. data/webpack/components/TabbedView/TabbedView.scss +3 -0
  220. data/webpack/components/TabbedView/index.js +3 -0
  221. data/webpack/components/Table/EmptyStateMessage.js +61 -0
  222. data/webpack/{scenes/ContentViews/Table/TableWrapper.js → components/Table/MainTable.js} +23 -12
  223. data/webpack/components/Table/TableWrapper.js +94 -0
  224. data/webpack/{move_to_pf → components}/TooltipButton/TooltipButton.js +0 -0
  225. data/webpack/{move_to_pf → components}/TooltipButton/TooltipButton.scss +0 -0
  226. data/webpack/{move_to_pf → components}/TooltipButton/TooltipButton.test.js +0 -0
  227. data/webpack/{move_to_pf → components}/TooltipButton/__snapshots__/TooltipButton.test.js.snap +0 -0
  228. data/webpack/{move_to_pf → components}/TooltipButton/index.js +0 -0
  229. data/webpack/components/TypeAhead/TypeAhead.js +109 -0
  230. data/webpack/{move_to_pf → components}/TypeAhead/TypeAhead.scss +0 -0
  231. data/webpack/components/TypeAhead/helpers/commonPropTypes.js +35 -0
  232. data/webpack/components/TypeAhead/helpers/helpers.js +32 -0
  233. data/webpack/components/TypeAhead/index.js +3 -0
  234. data/webpack/{move_to_pf/TypeAhead → components/TypeAhead/pf3Search}/TypeAheadInput.js +3 -6
  235. data/webpack/{move_to_pf/TypeAhead → components/TypeAhead/pf3Search}/TypeAheadItems.js +3 -7
  236. data/webpack/components/TypeAhead/pf3Search/TypeAheadSearch.js +52 -0
  237. data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.js +44 -0
  238. data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.scss +11 -0
  239. data/webpack/components/TypeAhead/pf4Search/TypeAheadItems.js +57 -0
  240. data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.js +66 -0
  241. data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.scss +5 -0
  242. data/webpack/components/extensions/about/__tests__/SystemStatuses.test.js +1 -1
  243. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/CollapseSubscriptionGroupButton.js +0 -0
  244. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/CollapseSubscriptionGroupButton.test.js +0 -0
  245. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/Table.js +0 -0
  246. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/Table.test.js +0 -0
  247. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBody.js +0 -0
  248. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBody.test.js +0 -0
  249. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBodyMessage.js +0 -0
  250. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBodyMessage.test.js +0 -0
  251. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableFixtures.js +0 -0
  252. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionCell.js +0 -0
  253. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionCell.test.js +0 -0
  254. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionHeaderCell.js +0 -0
  255. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionHeaderCell.test.js +0 -0
  256. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/CollapseSubscriptionGroupButton.test.js.snap +0 -0
  257. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/Table.test.js.snap +0 -0
  258. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableBody.test.js.snap +0 -0
  259. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableBodyMessage.test.js.snap +0 -0
  260. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableSelectionCell.test.js.snap +0 -0
  261. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableSelectionHeaderCell.test.js.snap +0 -0
  262. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/index.js +0 -0
  263. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/EntitlementsInlineEditFormatter.js +1 -1
  264. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/__tests__/EntitlementsInlineEditFormatter.test.js +0 -0
  265. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/__tests__/__snapshots__/EntitlementsInlineEditFormatter.test.js.snap +0 -0
  266. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/cellFormatter.js +0 -0
  267. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/collapseableAndSelectionCellFormatter.js +0 -0
  268. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/ellipsisCellFormatter.js +0 -0
  269. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/headerFormatter.js +0 -0
  270. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/index.js +0 -0
  271. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/selectionCellFormatter.js +0 -0
  272. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/selectionHeaderCellFormatter.js +0 -0
  273. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/index.js +0 -0
  274. data/webpack/{move_to_pf → components}/react-bootstrap-select/index.js +0 -0
  275. data/webpack/containers/Application/config.js +5 -0
  276. data/webpack/containers/Application/overrides.scss +5 -0
  277. data/webpack/global_test_setup.js +3 -1
  278. data/webpack/redux/OrganizationProducts/OrganizationProductsActions.js +1 -1
  279. data/webpack/redux/OrganizationProducts/__tests__/OrganizationProductsActions.test.js +2 -2
  280. data/webpack/redux/actions/RedHatRepositories/enabled.js +1 -1
  281. data/webpack/redux/actions/RedHatRepositories/helpers.js +1 -1
  282. data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +1 -1
  283. data/webpack/redux/reducers/index.js +2 -0
  284. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js +1 -1
  285. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsTableSchema.js +1 -1
  286. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsActions.js +1 -1
  287. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsActions.test.js +2 -2
  288. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsTable.test.js +1 -1
  289. data/webpack/scenes/ContentViews/ContentViewSelectors.js +1 -2
  290. data/webpack/scenes/ContentViews/ContentViewsActions.js +4 -4
  291. data/webpack/scenes/ContentViews/ContentViewsConstants.js +4 -1
  292. data/webpack/scenes/ContentViews/ContentViewsPage.js +12 -6
  293. data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +44 -0
  294. data/webpack/scenes/ContentViews/Details/ContentViewDetailReducer.js +23 -0
  295. data/webpack/scenes/ContentViews/{details → Details}/ContentViewDetailSelectors.js +3 -0
  296. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +70 -0
  297. data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +116 -0
  298. data/webpack/scenes/ContentViews/{details → Details}/DetailsContainer.js +8 -4
  299. data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +101 -0
  300. data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetails.fixtures.json +106 -0
  301. data/webpack/scenes/ContentViews/Details/contentViewInfo.scss +8 -0
  302. data/webpack/scenes/ContentViews/Details/index.js +7 -0
  303. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +51 -36
  304. data/webpack/scenes/ContentViews/Table/tableDataGenerator.js +47 -44
  305. data/webpack/scenes/ContentViews/__tests__/basicContentViews.fixtures.js +31 -0
  306. data/webpack/scenes/ContentViews/__tests__/contentViewList.fixtures.json +2 -1
  307. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +173 -23
  308. data/webpack/scenes/ContentViews/components/ContentViewIcon.js +26 -0
  309. data/webpack/scenes/ContentViews/components/{contentViewName.scss → contentViewIcon.scss} +0 -0
  310. data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsActions.js +1 -1
  311. data/webpack/scenes/ModuleStreams/Details/Profiles/TableSchema.js +1 -1
  312. data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailsActions.test.js +2 -2
  313. data/webpack/scenes/ModuleStreams/ModuleStreamsActions.js +1 -1
  314. data/webpack/scenes/ModuleStreams/ModuleStreamsTableSchema.js +1 -1
  315. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsTable.test.js +1 -1
  316. data/webpack/scenes/Organizations/OrganizationSelectors.js +14 -0
  317. data/webpack/scenes/Products/ProductActions.js +1 -1
  318. data/webpack/scenes/RedHatRepositories/RedHatRepositoriesPage.js +1 -1
  319. data/webpack/scenes/Settings/SettingsConstants.js +3 -0
  320. data/webpack/scenes/Settings/SettingsReducer.js +33 -0
  321. data/webpack/scenes/Settings/SettingsSelectors.js +4 -0
  322. data/webpack/scenes/Settings/index.js +2 -1
  323. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +1 -1
  324. data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +1 -1
  325. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +59 -73
  326. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.scss +15 -0
  327. data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +43 -1
  328. data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +8 -0
  329. data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryTableSchema.js +1 -1
  330. data/webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js +78 -0
  331. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +2 -0
  332. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +56 -1
  333. data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +114 -0
  334. data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +6 -6
  335. data/webpack/scenes/Subscriptions/Manifest/__tests__/manifest.fixtures.js +36 -0
  336. data/webpack/scenes/Subscriptions/Manifest/index.js +3 -1
  337. data/webpack/scenes/Subscriptions/SubscriptionActions.js +1 -1
  338. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +4 -0
  339. data/webpack/scenes/Subscriptions/SubscriptionHelpers.js +0 -3
  340. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +38 -11
  341. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +30 -18
  342. data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +0 -3
  343. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +1 -1
  344. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +2 -2
  345. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +1 -1
  346. data/webpack/scenes/Subscriptions/__tests__/SubscriptionHelpers.test.js +0 -11
  347. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsActions.test.js.snap +2 -2
  348. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +4 -4
  349. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsReducer.test.js.snap +26 -1
  350. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js +2 -2
  351. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +27 -21
  352. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +6 -2
  353. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +2 -2
  354. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionTypeFormatter.test.js.snap +3 -3
  355. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Table.js +1 -1
  356. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +28 -3
  357. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +5 -10
  358. data/webpack/scenes/Subscriptions/index.js +6 -2
  359. data/webpack/test-utils/nockWrapper.js +39 -5
  360. data/webpack/test-utils/react-testing-lib-wrapper.js +35 -9
  361. data/webpack/{move_to_foreman/common → utils}/helpers.js +12 -8
  362. data/webpack/utils/useEventListener.js +37 -0
  363. metadata +143 -83
  364. data/app/lib/actions/katello/repository/verify_checksum.rb +0 -28
  365. data/app/lib/actions/pulp3/orchestration/repository/trigger_update_repo_cert_guard.rb +0 -22
  366. data/app/lib/actions/pulp3/repository/presenters/repair_presenter.rb +0 -85
  367. data/app/lib/actions/pulp3/repository/repair.rb +0 -29
  368. data/app/services/katello/host_trace_manager.rb +0 -38
  369. data/vendor/assets/stylesheets/katello/jquery.loadmask.css.scss +0 -40
  370. data/vendor/assets/stylesheets/katello/ui.spinner.css.scss +0 -3
  371. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js +0 -2
  372. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalSelectors.js +0 -2
  373. data/webpack/__mocks__/foremanReact/components/ForemanModal/index.js +0 -4
  374. data/webpack/__mocks__/foremanReact/components/Settings/SettingsActions.js +0 -4
  375. data/webpack/__mocks__/foremanReact/components/Settings/SettingsConstants.js +0 -2
  376. data/webpack/move_to_pf/TypeAhead/TypeAhead.js +0 -138
  377. data/webpack/move_to_pf/TypeAhead/helpers.js +0 -5
  378. data/webpack/scenes/ContentViews/components/ContentViewName.js +0 -33
  379. data/webpack/scenes/ContentViews/components/EmptyStateMessage.js +0 -43
  380. data/webpack/scenes/ContentViews/details/ContentViewDetailActions.js +0 -12
  381. data/webpack/scenes/ContentViews/expansions/RepositoriesExpansion.js +0 -12
@@ -0,0 +1,36 @@
1
+ module Actions
2
+ module Katello
3
+ module Organization
4
+ module SimpleContentAccess
5
+ class Toggle < Actions::AbstractAsyncTask
6
+ middleware.use Actions::Middleware::PropagateCandlepinErrors
7
+
8
+ SIMPLE_CONTENT_ACCESS_DISABLED_VALUE = "entitlement".freeze
9
+ SIMPLE_CONTENT_ACCESS_ENABLED_VALUE = "org_environment".freeze
10
+
11
+ attr_reader :organization
12
+
13
+ def plan(organization_id)
14
+ @organization = ::Organization.find(organization_id)
15
+
16
+ ::Katello::Resources::Candlepin::UpstreamConsumer.update(
17
+ "#{consumer['apiUrl']}#{consumer['uuid']}",
18
+ consumer['idCert']['cert'],
19
+ consumer['idCert']['key'],
20
+ nil,
21
+ {contentAccessMode: content_access_mode_value}
22
+ )
23
+
24
+ plan_action(::Actions::Katello::Organization::ManifestRefresh, organization)
25
+ end
26
+
27
+ private
28
+
29
+ def consumer
30
+ @consumer ||= ::Katello::Resources::Candlepin::UpstreamCandlepinResource.upstream_consumer
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -13,6 +13,19 @@ module Actions
13
13
  Actions::Pulp3::Orchestration::OrphanCleanup::RemoveOrphans,
14
14
  proxy)
15
15
  end
16
+ plan_self
17
+ end
18
+ end
19
+
20
+ def run
21
+ models = []
22
+ ::Katello::RepositoryTypeManager.repository_types.each_value do |repo_type|
23
+ indexable_types = repo_type.content_types_to_index
24
+ models += indexable_types&.map(&:model_class)
25
+ models.select! { |model| model.many_repository_associations }
26
+ end
27
+ models.each do |model|
28
+ model.joins("left join katello_#{model.repository_association} on #{model.table_name}.id = katello_#{model.repository_association}.#{model.unit_id_field}").where("katello_#{model.repository_association}.#{model.unit_id_field} IS NULL").destroy_all
16
29
  end
17
30
  end
18
31
  end
@@ -17,7 +17,8 @@ module Actions
17
17
  content_id = content_create.output[:response][:id]
18
18
  plan_action(Candlepin::Product::ContentAdd, owner: root.product.organization.label,
19
19
  product_id: root.product.cp_id,
20
- content_id: content_id)
20
+ content_id: content_id,
21
+ enabled: root.auto_enabled?)
21
22
 
22
23
  else
23
24
  content_id = root.content_id
@@ -51,8 +52,7 @@ module Actions
51
52
  content_url: root.custom_content_path,
52
53
  vendor: ::Katello::Provider::CUSTOM)
53
54
 
54
- #custom product content is always enabled by default
55
- ::Katello::ProductContent.create!(product: root.product, content: content, enabled: true)
55
+ ::Katello::ProductContent.create!(product: root.product, content: content, enabled: root.auto_enabled?)
56
56
  end
57
57
  end
58
58
  end
@@ -5,8 +5,6 @@ module Actions
5
5
  # rubocop:disable Metrics/MethodLength
6
6
  def plan(product, options = {})
7
7
  organization_destroy = options.fetch(:organization_destroy, false)
8
- skip_environment_update = options.fetch(:skip_environment_update, false) ||
9
- options.fetch(:organization_destroy, false)
10
8
 
11
9
  unless organization_destroy || product.user_deletable?
12
10
  if product.redhat?
@@ -26,13 +24,11 @@ module Actions
26
24
 
27
25
  sequence do
28
26
  unless organization_destroy
29
- sequence do
30
- # ContentDestroy must be called sequentially due to Candlepin's
31
- # issues with running multiple remove_content calls at the same time.
32
- plan_content_destruction(product, skip_environment_update)
33
- end
34
27
  concurrence do
35
- plan_repo_destruction(product, options)
28
+ product.repositories.in_default_view.each do |repo|
29
+ repo_options = options.clone
30
+ plan_action(Katello::Repository::Destroy, repo, repo_options)
31
+ end
36
32
  end
37
33
  plan_action(Candlepin::Product::DeletePools,
38
34
  cp_id: product.cp_id, organization_label: product.organization.label)
@@ -69,23 +65,6 @@ module Actions
69
65
  product.pool_products.delete_all
70
66
  end
71
67
 
72
- def plan_content_destruction(product, skip_environment_update)
73
- product.repositories.in_default_view.each do |repo|
74
- if repo.root.repositories.where.not(id: repo.id).empty? &&
75
- !repo.redhat? &&
76
- !skip_environment_update
77
- plan_action(::Actions::Katello::Product::ContentDestroy, repo.root)
78
- end
79
- end
80
- end
81
-
82
- def plan_repo_destruction(product, options)
83
- product.repositories.in_default_view.each do |repo|
84
- repo_options = options.clone
85
- plan_action(Katello::Repository::Destroy, repo, repo_options.merge(destroy_content: false))
86
- end
87
- end
88
-
89
68
  def view_versions(product)
90
69
  cvvs = product.published_content_view_versions.uniq
91
70
  views = cvvs.inject({}) do |result, version|
@@ -0,0 +1,41 @@
1
+ module Actions
2
+ module Katello
3
+ module Repository
4
+ class ContentUpdate < Actions::Base
5
+ def plan(repository, update_auto_enabled: false)
6
+ root = repository.root
7
+ content = root.content
8
+ plan_action(::Actions::Candlepin::Product::ContentUpdate,
9
+ :owner => repository.organization.label,
10
+ :content_id => root.content_id,
11
+ :name => root.name,
12
+ :content_url => root.custom_content_path,
13
+ :gpg_key_url => repository.yum_gpg_key_url,
14
+ :label => content.label,
15
+ :type => root.content_type,
16
+ :arches => root.format_arches)
17
+
18
+ if update_auto_enabled
19
+ plan_action(::Actions::Candlepin::Product::ContentUpdateEnablement,
20
+ :owner => repository.organization.label,
21
+ :product_id => root.product.cp_id,
22
+ :content_enablements => root.content_enablements)
23
+ plan_self(:repository_id => repository.id)
24
+ end
25
+
26
+ content.update!(name: root.name,
27
+ content_url: root.custom_content_path,
28
+ content_type: repository.content_type,
29
+ label: content.label,
30
+ gpg_url: repository.yum_gpg_key_url)
31
+ end
32
+
33
+ def run
34
+ repository = ::Katello::Repository.find(input[:repository_id])
35
+ ::Katello::ProductContent.where(:product => repository.product, :content => repository.content)
36
+ .update(:enabled => repository.root.auto_enabled?)
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -7,11 +7,9 @@ module Actions
7
7
 
8
8
  # options:
9
9
  # skip_environment_update - defaults to false. skips updating the CP environment
10
- # destroy_content - can be disabled to skip Candlepin remove_content
11
10
  def plan(repository, options = {})
12
11
  skip_environment_update = options.fetch(:skip_environment_update, false) ||
13
12
  options.fetch(:organization_destroy, false)
14
- destroy_content = options.fetch(:destroy_content, true)
15
13
  action_subject(repository)
16
14
 
17
15
  unless repository.destroyable?
@@ -31,9 +29,7 @@ module Actions
31
29
  if repository.redhat?
32
30
  handle_redhat_content(repository) unless skip_environment_update
33
31
  else
34
- if destroy_content && !skip_environment_update
35
- handle_custom_content(repository)
36
- end
32
+ handle_custom_content(repository) unless skip_environment_update
37
33
  end
38
34
  end
39
35
  end
@@ -69,7 +69,7 @@ module Actions
69
69
  sequence do
70
70
  if repo.link?
71
71
  plan_action(Pulp::Repository::Clear, repo, SmartProxy.pulp_master!)
72
- plan_action(Pulp::Repository::CopyAllUnits, repo.target_repository, repo)
72
+ plan_action(Pulp::Repository::CopyAllUnits, repo, ::SmartProxy.pulp_master, repo.target_repository)
73
73
  end
74
74
  end
75
75
  end
@@ -16,16 +16,14 @@ module Actions
16
16
  solve_dependencies: solve_dependencies)
17
17
  end
18
18
 
19
- concurrence do
20
- extended_repo_mapping.each do |source_repos, dest_repo_map|
21
- if generate_metadata
22
- metadata_generate(source_repos, dest_repo_map[:dest_repo], dest_repo_map[:filters])
23
- end
19
+ extended_repo_mapping.each do |source_repos, dest_repo_map|
20
+ if generate_metadata
21
+ metadata_generate(source_repos, dest_repo_map[:dest_repo], dest_repo_map[:filters])
24
22
  end
23
+ end
25
24
 
26
- extended_repo_mapping.values.each do |dest_repo_map|
27
- plan_action(Katello::Repository::IndexContent, id: dest_repo_map[:dest_repo].id)
28
- end
25
+ extended_repo_mapping.values.each do |dest_repo_map|
26
+ plan_action(Katello::Repository::IndexContent, id: dest_repo_map[:dest_repo].id)
29
27
  end
30
28
  end
31
29
  end
@@ -48,15 +46,19 @@ module Actions
48
46
 
49
47
  plan_action(Katello::Repository::MetadataGenerate, new_repository, metadata_options)
50
48
  unless source_repositories.first.saved_checksum_type == new_repository.saved_checksum_type
51
- plan_self(:source_checksum_type => source_repositories.first.saved_checksum_type,
52
- :target_repo_id => new_repository.id)
49
+ checksum_mapping = {}
50
+ repository_mapping.each do |source_repos, dest_repo|
51
+ checksum_mapping[dest_repo.id] = source_repos.first.saved_checksum_type
52
+ end
53
+ plan_self(:checksum_mapping => checksum_mapping)
53
54
  end
54
55
  end
55
56
 
56
57
  def finalize
57
- repository = ::Katello::Repository.find(input[:target_repo_id])
58
- source_checksum_type = input[:source_checksum_type]
59
- repository.update!(saved_checksum_type: source_checksum_type) if (repository && source_checksum_type)
58
+ input[:checksum_mapping].each do |repo_id, checksum_type|
59
+ repository = ::Katello::Repository.find(repo_id)
60
+ repository.update!(saved_checksum_type: checksum_type) if (repository && checksum_type)
61
+ end
60
62
  end
61
63
  end
62
64
  end
@@ -34,47 +34,38 @@ module Actions
34
34
 
35
35
  pulp_sync_options = {}
36
36
  pulp_sync_options[:download_policy] = ::Runcible::Models::YumImporter::DOWNLOAD_ON_DEMAND if validate_contents && repo.yum?
37
-
38
- #pulp2 options
39
37
  pulp_sync_options[:force_full] = true if skip_metadata_check && repo.yum?
40
38
  pulp_sync_options[:repair_sync] = true if validate_contents && repo.deb?
41
39
  pulp_sync_options[:remove_missing] = false if incremental
42
- pulp_sync_options[:source_url] = source_url
43
-
44
- #pulp3 options
45
- pulp_sync_options[:optimize] = false if skip_metadata_check && repo.yum?
46
40
 
47
41
  sequence do
48
- if SmartProxy.pulp_master.pulp3_support?(repo) && validate_contents
49
- plan_action(Katello::Repository::VerifyChecksum, repo)
50
- else
51
- plan_action(Pulp::Repository::RemoveUnits, :repo_id => repo.id, :content_unit_type => ::Katello::YumMetadataFile::CONTENT_TYPE) if validate_contents && repo.yum?
52
- sync_action = plan_pulp_action([Actions::Pulp::Orchestration::Repository::Sync,
53
- Actions::Pulp3::Orchestration::Repository::Sync],
54
- repo,
55
- SmartProxy.pulp_master,
56
- pulp_sync_options)
57
- output = sync_action.output
58
-
59
- contents_changed = skip_metadata_check || output[:contents_changed]
60
-
61
- plan_action(Katello::Repository::IndexContent, :id => repo.id, :contents_changed => contents_changed)
62
- plan_action(Katello::Foreman::ContentUpdate, repo.environment, repo.content_view, repo)
63
- plan_action(Katello::Repository::FetchPxeFiles, :id => repo.id)
64
- plan_action(Katello::Repository::CorrectChecksum, repo)
65
- concurrence do
66
- plan_action(Pulp::Repository::Download, :pulp_id => repo.pulp_id, :options => {:verify_all_units => true}) if validate_contents && repo.yum?
67
- plan_action(Katello::Repository::MetadataGenerate, repo, :force => true) if skip_metadata_check && repo.yum?
68
- plan_action(Katello::Repository::ErrataMail, repo, nil, contents_changed)
69
- if generate_applicability
70
- regenerate_applicability(repo, contents_changed)
71
- end
42
+ plan_action(Pulp::Repository::RemoveUnits, :repo_id => repo.id, :content_unit_type => ::Katello::YumMetadataFile::CONTENT_TYPE) if validate_contents && repo.yum?
43
+ sync_args = {:smart_proxy_id => SmartProxy.pulp_master.id, :repo_id => repo.id, :source_url => source_url, :options => pulp_sync_options}
44
+ sync_action = plan_pulp_action([Actions::Pulp::Orchestration::Repository::Sync,
45
+ Actions::Pulp3::Orchestration::Repository::Sync],
46
+ repo,
47
+ SmartProxy.pulp_master,
48
+ sync_args)
49
+ output = sync_action.output
50
+
51
+ contents_changed = skip_metadata_check || output[:contents_changed]
52
+
53
+ plan_action(Katello::Repository::IndexContent, :id => repo.id, :contents_changed => contents_changed)
54
+ plan_action(Katello::Foreman::ContentUpdate, repo.environment, repo.content_view, repo)
55
+ plan_action(Katello::Repository::FetchPxeFiles, :id => repo.id)
56
+ plan_action(Katello::Repository::CorrectChecksum, repo)
57
+ concurrence do
58
+ plan_action(Pulp::Repository::Download, :pulp_id => repo.pulp_id, :options => {:verify_all_units => true}) if validate_contents && repo.yum?
59
+ plan_action(Katello::Repository::MetadataGenerate, repo, :force => true) if skip_metadata_check && repo.yum?
60
+ plan_action(Katello::Repository::ErrataMail, repo, nil, contents_changed)
61
+ if generate_applicability
62
+ regenerate_applicability(repo, contents_changed)
72
63
  end
73
- plan_self(:id => repo.id, :sync_result => output, :skip_metadata_check => skip_metadata_check, :validate_contents => validate_contents,
74
- :contents_changed => contents_changed)
75
- plan_action(Katello::Repository::ImportApplicability, :repo_id => repo.id, :contents_changed => contents_changed) if generate_applicability
76
- plan_action(Katello::Repository::SyncHook, :id => repo.id)
77
64
  end
65
+ plan_self(:id => repo.id, :sync_result => output, :skip_metadata_check => skip_metadata_check, :validate_contents => validate_contents,
66
+ :contents_changed => contents_changed)
67
+ plan_action(Katello::Repository::ImportApplicability, :repo_id => repo.id, :contents_changed => contents_changed) if generate_applicability
68
+ plan_action(Katello::Repository::SyncHook, :id => repo.id)
78
69
  end
79
70
  end
80
71
 
@@ -100,7 +91,6 @@ module Actions
100
91
  def presenter
101
92
  found = all_planned_actions(Pulp::Repository::Sync)
102
93
  found = all_planned_actions(Pulp3::Repository::Sync) if found.empty?
103
- found = all_planned_actions(Pulp3::Repository::Repair) if found.empty?
104
94
  Helpers::Presenter::Delegated.new(self, found)
105
95
  end
106
96
 
@@ -3,14 +3,13 @@ module Actions
3
3
  module Repository
4
4
  class Update < Actions::EntryAction
5
5
  include Actions::Katello::PulpSelector
6
-
7
- # rubocop:disable Metrics/MethodLength
8
6
  def plan(root, repo_params)
9
7
  repository = root.library_instance
10
8
  action_subject root.library_instance
11
9
 
12
10
  repo_params[:url] = nil if repo_params[:url] == ''
13
- update_cv_cert_protected = repo_params.key?(:unprotected) && (repo_params[:unprotected] != repository.unprotected)
11
+ update_cv_cert_protected = (repo_params[:unprotected] != repository.unprotected)
12
+ update_auto_enabled = repo_params.key?(:auto_enabled) && (repo_params[:auto_enabled] != root.auto_enabled)
14
13
  root.update!(repo_params)
15
14
 
16
15
  if root.download_policy == ::Runcible::Models::YumImporter::DOWNLOAD_BACKGROUND
@@ -22,43 +21,33 @@ module Actions
22
21
  end
23
22
 
24
23
  if update_content?(repository)
25
- content = root.content
26
-
27
- plan_action(::Actions::Candlepin::Product::ContentUpdate,
28
- :owner => repository.organization.label,
29
- :content_id => root.content_id,
30
- :name => root.name,
31
- :content_url => root.custom_content_path,
32
- :gpg_key_url => repository.yum_gpg_key_url,
33
- :label => content.label,
34
- :type => root.content_type,
35
- :arches => root.format_arches)
36
-
37
- content.update!(name: root.name,
38
- content_url: root.custom_content_path,
39
- content_type: repository.content_type,
40
- label: content.label,
41
- gpg_url: repository.yum_gpg_key_url)
24
+ plan_action(Katello::Repository::ContentUpdate, repository,
25
+ update_auto_enabled: update_auto_enabled)
42
26
  end
27
+
43
28
  if root.pulp_update_needed?
44
- sequence do
45
- plan_pulp_action([::Actions::Pulp::Orchestration::Repository::Refresh,
46
- ::Actions::Pulp3::Orchestration::Repository::Update],
47
- repository,
48
- SmartProxy.pulp_master)
49
- plan_self(:repository_id => root.library_instance.id)
50
- if update_cv_cert_protected
51
- plan_optional_pulp_action([::Actions::Pulp3::Orchestration::Repository::TriggerUpdateRepoCertGuard], repository, ::SmartProxy.pulp_master)
52
- end
53
- end
29
+ plan_pulp_action([::Actions::Pulp::Orchestration::Repository::Refresh,
30
+ ::Actions::Pulp3::Orchestration::Repository::Update],
31
+ repository,
32
+ SmartProxy.pulp_master)
33
+ plan_self(:repository_id => root.library_instance.id, :update_cv_cert_protected => update_cv_cert_protected)
54
34
  end
55
35
  end
56
36
 
57
37
  def run
58
38
  repository = ::Katello::Repository.find(input[:repository_id])
39
+ output[:repository_id] = input[:repository_id]
40
+ output[:update_cv_cert_protected] = input[:update_cv_cert_protected]
59
41
  ForemanTasks.async_task(Katello::Repository::MetadataGenerate, repository)
60
42
  end
61
43
 
44
+ def finalize
45
+ repository = ::Katello::Repository.find(output[:repository_id])
46
+ if output[:update_cv_cert_protected]
47
+ ForemanTasks.async_task(::Actions::Katello::Repository::UpdateCVRepoCertGuard, repository, SmartProxy.pulp_master)
48
+ end
49
+ end
50
+
62
51
  private
63
52
 
64
53
  def update_content?(repository)
@@ -0,0 +1,17 @@
1
+ module Actions
2
+ module Katello
3
+ module Repository
4
+ class UpdateCVRepoCertGuard < Actions::Base
5
+ include Actions::Katello::PulpSelector
6
+
7
+ def plan(repository, smart_proxy)
8
+ plan_optional_pulp_action([::Actions::Pulp3::Repository::UpdateCVRepositoryCertGuard], repository, smart_proxy)
9
+ end
10
+
11
+ def humanized_name
12
+ _("Updating repository authentication configuration")
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -15,6 +15,7 @@ module Actions
15
15
  end
16
16
  pulp_options = { remove_missing: repository && ["deb", "puppet", "yum"].include?(repository.content_type) }
17
17
  pulp_options[:force_full] = true if skip_metadata_check && repository.content_type == "yum"
18
+ pulp_options[:repair_sync] = true if skip_metadata_check && repository.content_type == "deb"
18
19
 
19
20
  plan_action(Pulp::Consumer::SyncCapsule,
20
21
  repository, smart_proxy, pulp_options)
@@ -4,9 +4,8 @@ module Actions
4
4
  module Repository
5
5
  class Sync < Pulp::Abstract
6
6
  include Actions::Helpers::OutputPropagator
7
- def plan(repository, smart_proxy, options)
7
+ def plan(_repository, _smart_proxy, options)
8
8
  sequence do
9
- options.merge!(:repo_id => repository.id, :smart_proxy_id => smart_proxy.id)
10
9
  action_output = plan_action(Actions::Pulp::Repository::Sync, options).output
11
10
  plan_self(:subaction_output => action_output)
12
11
  end
@@ -14,9 +14,8 @@ module Actions
14
14
  overrides = {}
15
15
  overrides[:feed] = input[:source_url] if input[:source_url]
16
16
  overrides[:validate] = !(SETTINGS[:katello][:pulp][:skip_checksum_validation])
17
- overrides.merge(input[:options]) if input[:options]
17
+ overrides[:options] = input[:options] if input[:options]
18
18
  repo = ::Katello::Repository.find(input[:repo_id])
19
-
20
19
  output[:pulp_tasks] = repo.backend_service(::SmartProxy.pulp_master).sync(overrides)
21
20
  end
22
21
 
@@ -74,7 +74,6 @@ module Actions
74
74
 
75
75
  def cancel
76
76
  pulp_tasks.each { |task| task.cancel }
77
- task_groups.each { |task_group| task_group.cancel }
78
77
  end
79
78
 
80
79
  def rescue_external_task(error)
@@ -11,9 +11,7 @@ module Actions
11
11
 
12
12
  def invoke_external_task
13
13
  repo = ::Katello::Repository.find(input[:repository_id])
14
- sync_options = {}
15
- sync_options[:optimize] = false if sync_options[:skip_metadata_check]
16
- output[:pulp_tasks] = repo.backend_service(smart_proxy).with_mirror_adapter.sync(sync_options)
14
+ output[:pulp_tasks] = repo.backend_service(smart_proxy).with_mirror_adapter.sync
17
15
  end
18
16
 
19
17
  def rescue_strategy_for_self
@@ -14,7 +14,7 @@ module Actions
14
14
  content_view.repository_references.each do |repository_reference|
15
15
  repo = repository_reference.root_repository.library_instance
16
16
  #force pulp3 in case we've done migrations, but haven't switched over yet
17
- tasks << repo.backend_service(smart_proxy, true).delete_repository(repository_reference)
17
+ tasks << repo.backend_service(smart_proxy, true).delete(repository_reference.repository_href)
18
18
  end
19
19
  content_view.repository_references.destroy_all
20
20
 
@@ -16,7 +16,8 @@ module Actions
16
16
  copy_action = plan_action(Actions::Pulp3::Repository::CopyContent, source_repositories.first, smart_proxy, target_repo,
17
17
  filter_ids: filter_ids, solve_dependencies: solve_dependencies,
18
18
  rpm_filenames: rpm_filenames)
19
- plan_action(Actions::Pulp3::Repository::SaveVersion, target_repo, tasks: copy_action.output[:pulp_tasks])
19
+ plan_action(Actions::Pulp3::Repository::SaveVersion, target_repo,
20
+ repository_details: { latest_version_href: copy_action.output[:latest_version_href] }, tasks: copy_action.output[:pulp_tasks])
20
21
  else
21
22
  #if we are not filtering, copy the version to the cv repository, and the units for each additional repo
22
23
  action = plan_action(Actions::Pulp3::Repository::CopyVersion, source_repositories.first, smart_proxy, target_repo)
@@ -7,9 +7,7 @@ module Actions
7
7
  def plan(repository, smart_proxy, options)
8
8
  sequence do
9
9
  action_output = plan_action(Actions::Pulp3::Repository::Sync, repository, smart_proxy, options).output
10
-
11
- force_fetch_version = true if options[:optimize] == false
12
- version_output = plan_action(Pulp3::Repository::SaveVersion, repository, tasks: action_output[:pulp_tasks], :force_fetch_version => force_fetch_version).output
10
+ version_output = plan_action(Pulp3::Repository::SaveVersion, repository, tasks: action_output[:pulp_tasks]).output
13
11
  plan_action(Pulp3::Orchestration::Repository::GenerateMetadata, repository, smart_proxy, :contents_changed => version_output[:contents_changed])
14
12
  plan_self(:subaction_output => version_output)
15
13
  end
@@ -11,6 +11,7 @@ module Actions
11
11
  def invoke_external_task
12
12
  source = ::Katello::Repository.find(input[:source_repository_id])
13
13
  target = ::Katello::Repository.find(input[:target_repository_id] || input[:target_repository])
14
+ output[:latest_version_href] = target.backend_service(smart_proxy).read.latest_version_href
14
15
  output[:pulp_tasks] = target.backend_service(smart_proxy).copy_content_for_source(source, input)
15
16
  end
16
17
  end
@@ -8,7 +8,7 @@ module Actions
8
8
 
9
9
  def invoke_external_task
10
10
  repo = ::Katello::Repository.find(input[:repository_id])
11
- output[:response] = repo.backend_service(smart_proxy).delete_repository
11
+ output[:response] = repo.backend_service(smart_proxy).delete
12
12
  end
13
13
  end
14
14
  end
@@ -17,7 +17,7 @@ module Actions
17
17
  repo_id_map = {}
18
18
 
19
19
  input[:repo_id_map].each do |source_repo_ids, dest_repo_map|
20
- repo_id_map[JSON.parse(source_repo_ids)] = dest_repo_map.deep_dup
20
+ repo_id_map[JSON.parse(source_repo_ids)] = dest_repo_map
21
21
  end
22
22
 
23
23
  output[:pulp_tasks] = ::Katello::Repository.find(repo_id_map.values.first[:dest_repo]).backend_service(smart_proxy).copy_content_from_mapping(repo_id_map, input)
@@ -3,39 +3,35 @@ module Actions
3
3
  module Repository
4
4
  class SaveVersion < Pulp3::Abstract
5
5
  def plan(repository, options)
6
- fail "Cannot accept tasks and repository_details into Save Version." if options[:tasks].present? && options[:repository_details].present?
7
- plan_self(:repository_id => repository.id, :tasks => options[:tasks], :repository_details => options[:repository_details], :force_fetch_version => options.fetch(:force_fetch_version, false))
6
+ plan_self(:repository_id => repository.id, :tasks => options[:tasks], :repository_details => options[:repository_details])
8
7
  end
9
8
 
10
9
  def run
11
10
  repo = ::Katello::Repository.find(input[:repository_id])
12
11
 
13
- if input[:force_fetch_version]
14
- version_href = fetch_version_href(repo)
15
- elsif input[:repository_details].present?
16
- version_href = input[:repository_details][:latest_version_href]
17
- elsif input[:tasks].present?
12
+ if input[:tasks].present?
18
13
  version_href = input[:tasks].last[:created_resources].first
19
- else
20
- version_href = fetch_version_href(repo)
21
14
  end
22
15
 
23
- if version_href
24
- if repo.version_href != version_href || input[:force_fetch_version]
25
- output[:contents_changed] = true
26
- repo.update(:version_href => version_href)
16
+ unless version_href
17
+ if input[:repository_details]
18
+ version_href = input[:repository_details][:latest_version_href]
19
+ elsif repo.version_href.nil?
20
+ # Fetch latest Pulp 3 repo version
21
+ repo_backend_service = repo.backend_service(SmartProxy.pulp_master)
22
+ version_href ||= repo_backend_service.api.
23
+ repositories_api.read(repo_backend_service.
24
+ repository_reference.repository_href).latest_version_href
27
25
  end
26
+ end
27
+
28
+ if version_href
29
+ repo.update(:version_href => version_href)
30
+ output[:contents_changed] = true
28
31
  else
29
32
  output[:contents_changed] = false
30
33
  end
31
34
  end
32
-
33
- def fetch_version_href(repo)
34
- # Fetch latest Pulp 3 repo version
35
- repo_backend_service = repo.backend_service(SmartProxy.pulp_master)
36
- repo_href = repo_backend_service.repository_reference.repository_href
37
- repo_backend_service.api.repositories_api.read(repo_href).latest_version_href
38
- end
39
35
  end
40
36
  end
41
37
  end
@@ -10,7 +10,7 @@ module Actions
10
10
 
11
11
  def invoke_external_task
12
12
  repo = ::Katello::Repository.find(input[:repo_id])
13
- output[:pulp_tasks] = repo.backend_service(::SmartProxy.unscoped.find(input[:smart_proxy_id])).sync(input[:options])
13
+ output[:pulp_tasks] = repo.backend_service(::SmartProxy.unscoped.find(input[:smart_proxy_id])).sync
14
14
  end
15
15
 
16
16
  def external_task=(tasks)
@@ -2,17 +2,13 @@ module Actions
2
2
  module Pulp3
3
3
  module Repository
4
4
  class UpdateCVRepositoryCertGuard < Pulp3::Abstract
5
- def plan(repository, smart_proxy)
5
+ def plan(repository, _smart_proxy)
6
6
  root = repository.root
7
7
  cv_repositories = root.repositories - [root.library_instance]
8
8
  cv_repositories.each do |repo|
9
- plan_action(::Actions::Pulp3::Repository::RefreshDistribution, repo, smart_proxy)
9
+ plan_action(::Actions::Pulp3::Repository::RefreshDistribution, repo, SmartProxy.pulp_master)
10
10
  end
11
11
  end
12
-
13
- def humanized_name
14
- _("Updating repository authentication configuration")
15
- end
16
12
  end
17
13
  end
18
14
  end