katello 3.8.1 → 3.9.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 (472) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -7
  3. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +16 -9
  4. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -1
  5. data/app/controllers/katello/api/v2/api_controller.rb +20 -22
  6. data/app/controllers/katello/api/v2/capsule_content_controller.rb +1 -1
  7. data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +5 -1
  8. data/app/controllers/katello/api/v2/content_view_histories_controller.rb +1 -1
  9. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +12 -12
  10. data/app/controllers/katello/api/v2/content_views_controller.rb +15 -1
  11. data/app/controllers/katello/api/v2/host_errata_controller.rb +1 -1
  12. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +12 -4
  13. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +12 -0
  14. data/app/controllers/katello/api/v2/module_streams_controller.rb +49 -0
  15. data/app/controllers/katello/api/v2/organizations_controller.rb +3 -1
  16. data/app/controllers/katello/api/v2/package_groups_controller.rb +1 -1
  17. data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +5 -4
  18. data/app/controllers/katello/api/v2/products_controller.rb +1 -1
  19. data/app/controllers/katello/api/v2/puppet_modules_controller.rb +5 -0
  20. data/app/controllers/katello/api/v2/repositories_controller.rb +80 -84
  21. data/app/controllers/katello/api/v2/repository_sets_controller.rb +18 -7
  22. data/app/controllers/katello/api/v2/subscriptions_controller.rb +2 -6
  23. data/app/controllers/katello/api/v2/sync_plans_controller.rb +13 -24
  24. data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +12 -5
  25. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +2 -5
  26. data/app/controllers/katello/react_controller.rb +2 -0
  27. data/app/controllers/katello/remote_execution_controller.rb +16 -5
  28. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +0 -2
  29. data/app/lib/actions/candlepin/import_pool_handler.rb +40 -15
  30. data/app/lib/actions/katello/capsule_content/create_repos.rb +1 -0
  31. data/app/lib/actions/katello/content_view/publish.rb +21 -2
  32. data/app/lib/actions/katello/content_view_version/incremental_update.rb +1 -1
  33. data/app/lib/actions/katello/environment/destroy.rb +2 -3
  34. data/app/lib/actions/katello/environment/publish_repositories.rb +1 -1
  35. data/app/lib/actions/katello/event_queue/monitor.rb +9 -15
  36. data/app/lib/actions/katello/event_queue/poller_thread.rb +24 -1
  37. data/app/lib/actions/katello/event_queue/suspended_action.rb +2 -2
  38. data/app/lib/actions/katello/host/hypervisors_update.rb +82 -22
  39. data/app/lib/actions/katello/organization/manifest_refresh.rb +1 -1
  40. data/app/lib/actions/katello/product/content_create.rb +30 -38
  41. data/app/lib/actions/katello/product/content_destroy.rb +11 -12
  42. data/app/lib/actions/katello/product/create.rb +0 -1
  43. data/app/lib/actions/katello/product/update.rb +0 -2
  44. data/app/lib/actions/katello/repository/clear.rb +2 -0
  45. data/app/lib/actions/katello/repository/clone_to_environment.rb +0 -2
  46. data/app/lib/actions/katello/repository/clone_to_version.rb +15 -3
  47. data/app/lib/actions/katello/repository/clone_yum_content.rb +21 -2
  48. data/app/lib/actions/katello/repository/clone_yum_metadata.rb +1 -1
  49. data/app/lib/actions/katello/repository/correct_checksum.rb +5 -5
  50. data/app/lib/actions/katello/repository/create.rb +7 -7
  51. data/app/lib/actions/katello/repository/create_root.rb +22 -0
  52. data/app/lib/actions/katello/repository/destroy.rb +11 -6
  53. data/app/lib/actions/katello/repository/discover.rb +5 -3
  54. data/app/lib/actions/katello/repository/export.rb +1 -1
  55. data/app/lib/actions/katello/repository/fetch_pxe_files.rb +13 -27
  56. data/app/lib/actions/katello/repository/index_module_streams.rb +16 -0
  57. data/app/lib/actions/katello/repository/metadata_generate.rb +1 -1
  58. data/app/lib/actions/katello/repository/sync.rb +0 -2
  59. data/app/lib/actions/katello/repository/update.rb +15 -28
  60. data/app/lib/actions/katello/repository_set/disable_repository.rb +5 -13
  61. data/app/lib/actions/katello/repository_set/enable_repository.rb +3 -16
  62. data/app/lib/actions/katello/repository_set/scan_cdn.rb +4 -32
  63. data/app/lib/actions/katello/sync_plan/run.rb +37 -0
  64. data/app/lib/actions/pulp/abstract.rb +7 -2
  65. data/app/lib/actions/pulp/abstract_async_task.rb +1 -0
  66. data/app/lib/actions/pulp/consumer/generate_applicability.rb +1 -0
  67. data/app/lib/actions/pulp/repository/copy_module_default.rb +11 -0
  68. data/app/lib/actions/pulp/repository/copy_module_stream.rb +11 -0
  69. data/app/lib/actions/pulp/repository/create.rb +2 -0
  70. data/app/lib/actions/pulp/repository/distributor_publish.rb +3 -2
  71. data/app/lib/actions/pulp/repository/remove_module_default.rb +11 -0
  72. data/app/lib/actions/pulp/repository/remove_module_stream.rb +11 -0
  73. data/app/lib/actions/pulp/repository/sync.rb +6 -19
  74. data/app/lib/actions/pulp/repository/update_importer.rb +9 -7
  75. data/app/lib/katello/concerns/base_template_scope_extensions.rb +42 -0
  76. data/app/lib/katello/concerns/renderer_extensions.rb +6 -4
  77. data/app/lib/katello/http_resource.rb +5 -1
  78. data/app/lib/katello/repo_discovery.rb +6 -2
  79. data/app/lib/katello/resources/candlepin/consumer.rb +18 -1
  80. data/app/lib/katello/resources/candlepin/owner.rb +9 -0
  81. data/app/lib/katello/resources/candlepin/pool.rb +2 -2
  82. data/app/lib/katello/validators/root_repository_unique_attribute_validator.rb +13 -0
  83. data/app/models/katello/authorization/product.rb +3 -4
  84. data/app/models/katello/authorization/repository.rb +4 -4
  85. data/app/models/katello/candlepin/repository_mapper.rb +12 -26
  86. data/app/models/katello/concerns/audit_search.rb +13 -0
  87. data/app/models/katello/concerns/content_facet_host_extensions.rb +1 -1
  88. data/app/models/katello/concerns/content_view_filter_rule_common.rb +1 -0
  89. data/app/models/katello/concerns/host_managed_extensions.rb +68 -2
  90. data/app/models/katello/concerns/hostgroup_extensions.rb +13 -0
  91. data/app/models/katello/concerns/location_extensions.rb +3 -3
  92. data/app/models/katello/concerns/organization_extensions.rb +7 -3
  93. data/app/models/katello/concerns/pulp_database_unit.rb +1 -0
  94. data/app/models/katello/concerns/recurring_logic_extensions.rb +11 -0
  95. data/app/models/katello/concerns/redhat_extensions.rb +0 -25
  96. data/app/models/katello/concerns/search_by_repository_name.rb +21 -0
  97. data/app/models/katello/concerns/setting_extensions.rb +1 -1
  98. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +43 -0
  99. data/app/models/katello/content.rb +7 -3
  100. data/app/models/katello/content_view.rb +4 -4
  101. data/app/models/katello/content_view_component.rb +1 -1
  102. data/app/models/katello/content_view_history.rb +1 -0
  103. data/app/models/katello/content_view_version.rb +14 -2
  104. data/app/models/katello/docker_manifest_list.rb +1 -1
  105. data/app/models/katello/docker_meta_tag.rb +11 -2
  106. data/app/models/katello/docker_tag.rb +1 -1
  107. data/app/models/katello/erratum.rb +6 -0
  108. data/app/models/katello/file_unit.rb +0 -1
  109. data/app/models/katello/glue/candlepin/owner.rb +1 -0
  110. data/app/models/katello/glue/candlepin/pool.rb +1 -2
  111. data/app/models/katello/glue/candlepin/product.rb +0 -4
  112. data/app/models/katello/glue/candlepin/repository.rb +0 -21
  113. data/app/models/katello/glue/provider.rb +4 -2
  114. data/app/models/katello/glue/pulp/repo.rb +10 -173
  115. data/app/models/katello/glue/pulp/repos.rb +2 -112
  116. data/app/models/katello/gpg_key.rb +6 -14
  117. data/app/models/katello/host/content_facet.rb +1 -1
  118. data/app/models/katello/host/subscription_facet.rb +32 -8
  119. data/app/models/katello/kt_environment.rb +9 -29
  120. data/app/models/katello/module_profile.rb +6 -0
  121. data/app/models/katello/module_profile_rpm.rb +5 -0
  122. data/app/models/katello/module_stream.rb +112 -0
  123. data/app/models/katello/module_stream_artifact.rb +5 -0
  124. data/app/models/katello/ostree_branch.rb +0 -1
  125. data/app/models/katello/package_group.rb +1 -1
  126. data/app/models/katello/pool.rb +4 -0
  127. data/app/models/katello/product.rb +18 -21
  128. data/app/models/katello/product_content.rb +2 -2
  129. data/app/models/katello/puppet_module.rb +1 -0
  130. data/app/models/katello/purpose_addons_status.rb +50 -0
  131. data/app/models/katello/purpose_role_status.rb +50 -0
  132. data/app/models/katello/purpose_sla_status.rb +48 -0
  133. data/app/models/katello/purpose_status.rb +56 -0
  134. data/app/models/katello/purpose_usage_status.rb +50 -0
  135. data/app/models/katello/repository.rb +116 -280
  136. data/app/models/katello/repository_module_stream.rb +7 -0
  137. data/app/models/katello/root_repository.rb +262 -0
  138. data/app/models/katello/subscription_status.rb +1 -1
  139. data/app/models/katello/sync_plan.rb +93 -40
  140. data/app/presenters/katello/content_view_version_compare_presenter.rb +7 -2
  141. data/app/services/katello/candlepin/consumer.rb +25 -0
  142. data/app/services/katello/candlepin/message_handler.rb +18 -2
  143. data/app/services/katello/managed_content_medium_provider.rb +27 -0
  144. data/app/services/katello/product_content_finder.rb +3 -3
  145. data/app/services/katello/pulp/module_stream.rb +9 -0
  146. data/app/services/katello/pulp/repository.rb +22 -0
  147. data/app/services/katello/pulp/srpm.rb +1 -1
  148. data/app/services/katello/pxe_files_downloader.rb +41 -0
  149. data/app/services/katello/registration_manager.rb +5 -0
  150. data/app/views/katello/api/v2/content_facet/show.json.rabl +0 -4
  151. data/app/views/katello/api/v2/content_view_versions/base.json.rabl +12 -2
  152. data/app/views/katello/api/v2/debs/compare.json.rabl +10 -0
  153. data/app/views/katello/api/v2/docker_manifest_lists/compare.json.rabl +10 -0
  154. data/app/views/katello/api/v2/environments/show.json.rabl +1 -0
  155. data/app/views/katello/api/v2/hosts/host_collections.json.rabl +3 -0
  156. data/app/views/katello/api/v2/module_streams/base.json.rabl +4 -0
  157. data/app/views/katello/api/v2/module_streams/index.json.rabl +7 -0
  158. data/app/views/katello/api/v2/module_streams/name_stream.json.rabl +3 -0
  159. data/app/views/katello/api/v2/module_streams/name_streams.json.rabl +7 -0
  160. data/app/views/katello/api/v2/module_streams/show.json.rabl +21 -0
  161. data/app/views/katello/api/v2/organizations/show.json.rabl +4 -1
  162. data/app/views/katello/api/v2/products/base.json.rabl +1 -1
  163. data/app/views/katello/api/v2/repositories/base.json.rabl +23 -10
  164. data/app/views/katello/api/v2/repositories/show.json.rabl +47 -38
  165. data/app/views/katello/api/v2/smart_proxies/download_policy.json.rabl +1 -0
  166. data/app/views/katello/api/v2/subscription_facet/base.json.rabl +1 -1
  167. data/app/views/katello/api/v2/sync_plans/show.json.rabl +2 -1
  168. data/app/views/katello/layouts/react.html.erb +1 -0
  169. data/config/katello.yaml.example +1 -2
  170. data/config/routes.rb +5 -0
  171. data/config/routes/api/v2.rb +12 -1
  172. data/config/routes/overrides.rb +1 -0
  173. data/db/migrate/20150114225023_add_upstream_name_to_repository.rb +7 -2
  174. data/db/migrate/20170208215148_add_docker_repo_name.rb +10 -1
  175. data/db/migrate/20180326190408_move_subscription_products.rb +2 -0
  176. data/db/migrate/20180622105300_add_docker_tags_whitelist_to_repository.rb +9 -0
  177. data/db/migrate/20180725083800_change_repository_password_length.rb +5 -0
  178. data/db/migrate/20180806205420_add_index_to_content_view_version.rb +5 -0
  179. data/db/migrate/20180807145652_create_katello_module_streams.rb +88 -0
  180. data/db/migrate/20180807164405_remove_repository_cp_label.rb +5 -0
  181. data/db/migrate/20180808013432_add_system_purpose_attrs.rb +39 -0
  182. data/db/migrate/20180814202747_add_recurring_logic_to_sync_plan.rb +12 -0
  183. data/db/migrate/20180816142044_add_description_to_katello_module_streams.rb +6 -0
  184. data/db/migrate/20180821144248_add_cron_logic_to_sync_plans.rb +5 -0
  185. data/db/migrate/20180828161400_remove_join_table_for_role_and_usage.rb +20 -0
  186. data/db/migrate/20180917173645_add_source_repo_checksum_type_to_katello_repositories.rb +1 -1
  187. data/db/migrate/20180920123913_drop_repo_module_streams_timestamp_not_null.rb +7 -0
  188. data/db/migrate/20180920171008_change_repository_password_to_text.rb +17 -0
  189. data/db/migrate/20180920214134_create_repository_root.rb +142 -0
  190. data/db/seeds.d/111-container-image-bookmarks.rb +19 -0
  191. data/db/seeds.d/111-upgrade_tasks.rb +9 -0
  192. data/db/seeds.d/150-module_job_templates.rb +12 -0
  193. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +1 -0
  194. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +3 -0
  195. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/module-stream-actions.service.js +26 -0
  196. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/common/views/subscription-add-or-remove.html +1 -1
  197. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-module-streams-modal.controller.js +60 -0
  198. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-repository-sets-modal.controller.js +2 -1
  199. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-host-bulk-module-streams-modal.html +70 -0
  200. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +16 -14
  201. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-repository-sets-modal.html +1 -7
  202. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-modal-helper.service.js +11 -0
  203. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts-helper.service.js +8 -4
  204. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +5 -0
  205. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.routes.js +14 -0
  206. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-module-streams.controller.js +48 -0
  207. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/views/content-host-module-streams.html +68 -0
  208. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +15 -0
  209. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +59 -2
  210. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +6 -0
  211. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +81 -27
  212. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-provisioning-info.html +1 -1
  213. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions.html +2 -2
  214. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +4 -0
  215. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +10 -0
  216. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-repositories.service.js +0 -1
  217. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-repositories.html +5 -0
  218. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +3 -0
  219. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js +7 -0
  220. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +1 -2
  221. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +38 -13
  222. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-versions.module.js +1 -0
  223. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-module-streams.html +8 -0
  224. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-ostree-branches.html +1 -1
  225. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-package-groups.html +1 -1
  226. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-packages.html +1 -1
  227. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-yum.html +5 -0
  228. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version.html +7 -0
  229. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/docker-tags/docker-tags.controller.js +1 -0
  230. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/content.service.js +5 -0
  231. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-module-streams.html +38 -0
  232. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment.html +1 -1
  233. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.routes.js +11 -0
  234. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/views/environments.html +3 -0
  235. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/erratum-repositories.controller.js +6 -22
  236. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-repositories.html +7 -1
  237. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +4 -0
  238. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +6 -0
  239. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +2 -1
  240. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/module-streams/module-stream.factory.js +27 -0
  241. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/module-streams/module-streams.module.js +15 -0
  242. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/module-streams/views/partials/module-streams-table.html +25 -0
  243. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package-repositories.controller.js +6 -22
  244. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/views/package-repositories.html +7 -1
  245. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/repositories-filters.service.js +89 -0
  246. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js +4 -5
  247. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +15 -2
  248. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.filter.js +2 -2
  249. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-manage-content.controller.js +15 -11
  250. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +5 -0
  251. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +36 -20
  252. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-module-streams.html +17 -0
  253. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +6 -6
  254. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.routes.js +9 -0
  255. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +5 -0
  256. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery.controller.js +2 -1
  257. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/views/discovery.html +10 -0
  258. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/new/new-sync-plan-modal.controller.js +6 -2
  259. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/repository-sets/repository-set.factory.js +1 -1
  260. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-details-info.controller.js +20 -3
  261. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-details.controller.js +2 -1
  262. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-info.html +23 -4
  263. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/new/new-sync-plan.controller.js +10 -6
  264. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/new/views/new-sync-plan-form.html +11 -3
  265. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/sync-plan-helper.service.js +3 -3
  266. data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/bastion_katello.scss +5 -1
  267. data/engines/bastion_katello/lib/bastion_katello/engine.rb +2 -2
  268. data/lib/katello/engine.rb +7 -12
  269. data/lib/katello/permission_creator.rb +5 -1
  270. data/lib/katello/permissions/host_permissions.rb +1 -0
  271. data/lib/katello/plugin.rb +38 -14
  272. data/lib/katello/tasks/clean_backend_objects.rake +7 -3
  273. data/lib/katello/tasks/reimport.rake +1 -0
  274. data/lib/katello/tasks/repository.rake +11 -8
  275. data/lib/katello/tasks/upgrades/3.9/migrate_sync_plans.rake +29 -0
  276. data/lib/katello/version.rb +1 -1
  277. data/package.json +11 -7
  278. data/webpack/__mocks__/foremanReact/common/I18n.js +5 -0
  279. data/webpack/components/MultiSelect/index.js +15 -3
  280. data/webpack/components/PaginationRow/index.js +1 -1
  281. data/webpack/components/Search/__snapshots__/Search.test.js.snap +1 -0
  282. data/webpack/components/Search/index.js +5 -1
  283. data/webpack/components/SelectOrg/SetOrganization.js +2 -1
  284. data/webpack/components/WithOrganization/__snapshots__/withOrganization.test.js.snap +41 -0
  285. data/webpack/components/WithOrganization/withOrganization.js +42 -10
  286. data/webpack/components/WithOrganization/withOrganization.test.js +26 -0
  287. data/webpack/containers/Application/Headers.js +11 -0
  288. data/webpack/containers/Application/Routes.js +1 -1
  289. data/webpack/containers/Application/config.js +23 -7
  290. data/webpack/containers/Application/withHeaders.js +15 -0
  291. data/webpack/move_to_foreman/common/helpers.js +72 -8
  292. data/webpack/move_to_foreman/components/common/ConfirmDialog/ConfirmDialog.js +1 -0
  293. data/webpack/move_to_foreman/components/common/Dialog/Dialog.js +1 -0
  294. data/webpack/move_to_foreman/components/common/EmptyState/index.js +1 -0
  295. data/webpack/move_to_foreman/components/common/ModalProgressBar/ModalProgressBar.js +1 -1
  296. data/webpack/move_to_foreman/components/common/table/formatters/selectionCellFormatter.js +1 -0
  297. data/webpack/move_to_pf/OptionTooltip/OptionTooltip.scss +20 -0
  298. data/webpack/move_to_pf/OptionTooltip/__tests__/OptionTooltip.test.js +32 -0
  299. data/webpack/move_to_pf/OptionTooltip/__tests__/__snapshots__/OptionTooltip.test.js.snap +84 -0
  300. data/webpack/move_to_pf/OptionTooltip/index.js +83 -0
  301. data/webpack/move_to_pf/TypeAhead/TypeAhead.js +15 -2
  302. data/webpack/move_to_pf/react-bootstrap-select/index.js +10 -4
  303. data/webpack/move_to_pf/test-utils/testHelpers.js +14 -2
  304. data/webpack/redux/actions/RedHatRepositories/enabled.js +29 -3
  305. data/webpack/redux/actions/RedHatRepositories/helpers.js +1 -1
  306. data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +27 -0
  307. data/webpack/redux/consts.js +8 -0
  308. data/webpack/redux/reducers/RedHatRepositories/__tests__/enabled.test.js +62 -0
  309. data/webpack/redux/reducers/RedHatRepositories/{repositorySetRepositories.test.js → __tests__/repositorySetRepositories.test.js} +31 -3
  310. data/webpack/redux/reducers/RedHatRepositories/{sets.test.js → __tests__/sets.test.js} +3 -3
  311. data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +16 -0
  312. data/webpack/redux/reducers/RedHatRepositories/enabled.js +34 -18
  313. data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.fixtures.js +10 -0
  314. data/webpack/redux/reducers/RedHatRepositories/repositorySetRepositories.js +39 -48
  315. data/webpack/redux/reducers/index.js +6 -0
  316. data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailArtifacts.js +19 -0
  317. data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailInfo.js +51 -0
  318. data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetails.js +147 -0
  319. data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsActions.js +25 -0
  320. data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsConstants.js +3 -0
  321. data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsReducer.js +33 -0
  322. data/webpack/scenes/ModuleStreams/Details/Profiles/ModuleStreamDetailProfiles.js +19 -0
  323. data/webpack/scenes/ModuleStreams/Details/Profiles/ProfileRpmsCellFormatter.js +53 -0
  324. data/webpack/scenes/ModuleStreams/Details/Profiles/ProfileRpmsCellFormatter.scss +4 -0
  325. data/webpack/scenes/ModuleStreams/Details/Profiles/TableSchema.js +35 -0
  326. data/webpack/scenes/ModuleStreams/Details/Profiles/__tests__/ModuleStreamDetailProfiles.test.js +14 -0
  327. data/webpack/scenes/ModuleStreams/Details/Profiles/__tests__/ProfileRpmsCellFormatter.test.js +24 -0
  328. data/webpack/scenes/ModuleStreams/Details/Profiles/__tests__/__snapshots__/ModuleStreamDetailProfiles.test.js.snap +126 -0
  329. data/webpack/scenes/ModuleStreams/Details/Profiles/__tests__/__snapshots__/ProfileRpmsCellFormatter.test.js.snap +14 -0
  330. data/webpack/scenes/ModuleStreams/Details/Repositories/ModuleStreamDetailRepositories.js +19 -0
  331. data/webpack/scenes/ModuleStreams/Details/Repositories/TableSchema.js +39 -0
  332. data/webpack/scenes/ModuleStreams/Details/Repositories/__tests__/ModuleStreamDetailRepositories.test.js +14 -0
  333. data/webpack/scenes/ModuleStreams/Details/Repositories/__tests__/__snapshots__/ModuleStreamDetailRepositories.test.js.snap +70 -0
  334. data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailArtifacts.test.js +14 -0
  335. data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailInfo.test.js +14 -0
  336. data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetails.test.js +27 -0
  337. data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailsActions.test.js +42 -0
  338. data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailsReducer.test.js +33 -0
  339. data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetailArtifacts.test.js.snap +18 -0
  340. data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetailInfo.test.js.snap +111 -0
  341. data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetails.test.js.snap +552 -0
  342. data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetailsActions.test.js.snap +144 -0
  343. data/webpack/scenes/ModuleStreams/Details/__tests__/__snapshots__/ModuleStreamDetailsReducer.test.js.snap +50 -0
  344. data/webpack/scenes/ModuleStreams/Details/__tests__/moduleStreamDetails.fixtures.js +115 -0
  345. data/webpack/scenes/ModuleStreams/Details/index.js +17 -0
  346. data/webpack/scenes/ModuleStreams/ModuleStreamsActions.js +29 -0
  347. data/webpack/scenes/ModuleStreams/ModuleStreamsConstants.js +3 -0
  348. data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +98 -0
  349. data/webpack/scenes/ModuleStreams/ModuleStreamsReducer.js +43 -0
  350. data/webpack/scenes/ModuleStreams/ModuleStreamsTable.js +38 -0
  351. data/webpack/scenes/ModuleStreams/ModuleStreamsTableSchema.js +69 -0
  352. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamPage.test.js +27 -0
  353. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsActions.test.js +49 -0
  354. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsReducer.test.js +46 -0
  355. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsTable.test.js +25 -0
  356. data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +69 -0
  357. data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamsTable.test.js.snap +95 -0
  358. data/webpack/scenes/ModuleStreams/__tests__/moduleStreams.fixtures.js +72 -0
  359. data/webpack/scenes/ModuleStreams/index.js +17 -0
  360. data/webpack/scenes/RedHatRepositories/components/EnabledRepository/EnabledRepository.js +120 -0
  361. data/webpack/scenes/RedHatRepositories/components/{EnabledRepository.stories.js → EnabledRepository/EnabledRepository.stories.js} +0 -0
  362. data/webpack/scenes/RedHatRepositories/components/{EnabledRepositoryContent.js → EnabledRepository/EnabledRepositoryContent.js} +0 -0
  363. data/webpack/scenes/RedHatRepositories/components/{__tests__ → EnabledRepository/__tests__}/EnabledRepository.test.js +6 -2
  364. data/webpack/scenes/RedHatRepositories/components/{__tests__ → EnabledRepository/__tests__}/EnabledRepositoryContent.test.js +0 -0
  365. data/webpack/scenes/RedHatRepositories/components/EnabledRepository/__tests__/__snapshots__/EnabledRepository.test.js.snap +31 -0
  366. data/webpack/scenes/RedHatRepositories/components/{__tests__ → EnabledRepository/__tests__}/__snapshots__/EnabledRepositoryContent.test.js.snap +0 -0
  367. data/webpack/scenes/RedHatRepositories/components/EnabledRepository/index.js +17 -0
  368. data/webpack/scenes/RedHatRepositories/components/RepositorySet.js +1 -1
  369. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepositories.js +43 -5
  370. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepositoriesHelpers.js +3 -0
  371. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/RepositorySetRepository.js +168 -0
  372. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/__test__/RepositorySetRepository.test.js +38 -0
  373. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/__test__/__snapshots__/RepositorySetRepository.test.js.snap +70 -0
  374. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/index.js +18 -0
  375. data/webpack/scenes/RedHatRepositories/components/SearchBar.js +4 -3
  376. data/webpack/scenes/RedHatRepositories/components/__tests__/RepositorySetRepositories.test.js +44 -0
  377. data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/RepositorySetRepositories.test.js.snap +48 -0
  378. data/webpack/scenes/RedHatRepositories/helpers.js +19 -15
  379. data/webpack/scenes/RedHatRepositories/index.js +1 -3
  380. data/webpack/scenes/RedHatRepositories/index.scss +16 -0
  381. data/webpack/scenes/Settings/Tables/TableActions.js +73 -0
  382. data/webpack/scenes/Settings/Tables/TableConstants.js +11 -0
  383. data/webpack/scenes/Settings/Tables/TableHelpers.js +8 -0
  384. data/webpack/scenes/Settings/Tables/TableReducer.js +46 -0
  385. data/webpack/scenes/Settings/Tables/__tests__/Table.fixtures.js +125 -0
  386. data/webpack/scenes/Settings/Tables/__tests__/TableActions.test.js +84 -0
  387. data/webpack/scenes/Settings/Tables/__tests__/TableReducer.test.js +41 -0
  388. data/webpack/scenes/Settings/Tables/__tests__/__snapshots__/TableReducer.test.js.snap +76 -0
  389. data/webpack/scenes/Settings/index.js +4 -0
  390. data/webpack/scenes/Subscriptions/Details/SubscriptionAttributes.js +2 -0
  391. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +1 -1
  392. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailAssociations.js +1 -0
  393. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailInfo.js +1 -0
  394. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailProduct.js +20 -13
  395. data/webpack/scenes/Subscriptions/Details/{SubscriptionDetailEnabledProducts.js → SubscriptionDetailProductContent.js} +5 -5
  396. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailReducer.js +3 -3
  397. data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +7 -6
  398. data/webpack/scenes/Subscriptions/Details/__tests__/{SubscriptionDetailEnabledProducts.test.js → SubscriptionDetailProductContent.test.js} +4 -4
  399. data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetails.test.js +2 -2
  400. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailProduct.test.js.snap +28 -16
  401. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/{SubscriptionDetailEnabledProducts.test.js.snap → SubscriptionDetailProductContent.test.js.snap} +1 -1
  402. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +16 -16
  403. data/webpack/scenes/Subscriptions/Details/__tests__/subscriptionDetails.fixtures.js +1 -1
  404. data/webpack/scenes/Subscriptions/Manifest/DeleteManifestModalText.js +2 -0
  405. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +38 -61
  406. data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js +4 -0
  407. data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryTableSchema.js +1 -0
  408. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +3 -3
  409. data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +12 -3
  410. data/webpack/scenes/Subscriptions/SubscriptionActions.js +26 -0
  411. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +56 -0
  412. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +26 -11
  413. data/webpack/scenes/Subscriptions/SubscriptionValidations.js +1 -0
  414. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +144 -39
  415. data/webpack/scenes/Subscriptions/SubscriptionsPage.scss +7 -0
  416. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +10 -16
  417. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +1 -0
  418. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsPage.test.js +1 -1
  419. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsActions.test.js +11 -1
  420. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +15 -2
  421. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsReducer.test.js +12 -0
  422. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +19 -0
  423. data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +87 -0
  424. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/EntitlementsInlineEditFormatter.js +1 -1
  425. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js +31 -0
  426. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +16 -11
  427. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +18 -3
  428. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionTypeFormatter.test.js +33 -0
  429. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.test.js +29 -0
  430. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionTypeFormatter.test.js.snap +34 -0
  431. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +24 -43
  432. data/webpack/scenes/Subscriptions/index.js +24 -7
  433. data/webpack/scenes/Tasks/TaskActions.js +43 -19
  434. data/webpack/scenes/Tasks/TaskConstants.js +1 -0
  435. data/webpack/scenes/Tasks/__tests__/TaskActions.test.js +15 -12
  436. data/webpack/scenes/Tasks/helpers.js +17 -27
  437. data/webpack/services/api/index.js +3 -0
  438. metadata +160 -52
  439. data/app/lib/actions/katello/repository/scheduled_sync.rb +0 -15
  440. data/app/lib/actions/katello/sync_plan/add_products.rb +0 -27
  441. data/app/lib/actions/katello/sync_plan/destroy.rb +0 -26
  442. data/app/lib/actions/katello/sync_plan/remove_products.rb +0 -23
  443. data/app/lib/actions/katello/sync_plan/update.rb +0 -20
  444. data/app/lib/actions/pulp/repos/update.rb +0 -24
  445. data/app/lib/actions/pulp/repository/ensure_sync_notification.rb +0 -11
  446. data/app/lib/actions/pulp/repository/remove_schedule.rb +0 -16
  447. data/app/lib/actions/pulp/repository/update_schedule.rb +0 -47
  448. data/app/lib/katello/validators/repository_unique_attribute_validator.rb +0 -13
  449. data/app/models/katello/candlepin/docker_repository_mapper.rb +0 -77
  450. data/app/models/katello/input_template_renderer.rb +0 -7
  451. data/lib/katello/tasks/upgrades/2.4/import_distributions.rake +0 -11
  452. data/lib/katello/tasks/upgrades/2.4/import_package_groups.rake +0 -11
  453. data/lib/katello/tasks/upgrades/2.4/import_puppet_modules.rake +0 -12
  454. data/lib/katello/tasks/upgrades/2.4/import_rpms.rake +0 -12
  455. data/lib/katello/tasks/upgrades/3.0/add_export_distributor.rake +0 -14
  456. data/lib/katello/tasks/upgrades/3.0/delete_docker_v1_content.rake +0 -27
  457. data/lib/katello/tasks/upgrades/3.0/update_puppet_repository_distributors.rake +0 -20
  458. data/lib/katello/tasks/upgrades/3.0/update_subscription_facet_backend_data.rake +0 -9
  459. data/lib/katello/tasks/upgrades/3.3/hypervisors.rake +0 -7
  460. data/lib/katello/tasks/upgrades/3.4/reindex_docker_tags.rake +0 -12
  461. data/lib/katello/tasks/upgrades/3.4/remove_unused_products.rake +0 -28
  462. data/lib/katello/tasks/upgrades/3.6/import_backend_consumer_attributes.rake +0 -32
  463. data/lib/katello/tasks/upgrades/3.6/import_product_content.rake +0 -12
  464. data/lib/katello/tasks/upgrades/3.6/republish_file_repos.rake +0 -16
  465. data/lib/katello/tasks/upgrades/3.7/import_pools.rake +0 -12
  466. data/lib/katello/tasks/upgrades/3.7/make_all_ks_repos_bootable.rake +0 -11
  467. data/webpack/helpers/caret.js +0 -6
  468. data/webpack/redux/reducers/RedHatRepositories/enabled.test.js +0 -36
  469. data/webpack/redux/reducers/RedHatRepositories/filters.fixtures.js +0 -5
  470. data/webpack/scenes/RedHatRepositories/components/EnabledRepository.js +0 -105
  471. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository.js +0 -129
  472. data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/EnabledRepository.test.js.snap +0 -25
@@ -25,7 +25,7 @@ module Katello
25
25
  update_attributes(:schema_version => json[:schema_version],
26
26
  :digest => json[:digest],
27
27
  :downloaded => json[:downloaded],
28
- :docker_manifests => ::Katello::DockerManifest.where(:digest => json[:manifests])
28
+ :docker_manifests => ::Katello::DockerManifest.where(:digest => json[:manifests].pluck(:digest))
29
29
  )
30
30
  end
31
31
 
@@ -1,6 +1,7 @@
1
1
  module Katello
2
2
  class DockerMetaTag < Katello::Model
3
3
  include ScopedSearchExtensions
4
+
4
5
  belongs_to :repository, :inverse_of => :docker_meta_tags, :class_name => "Katello::Repository"
5
6
 
6
7
  belongs_to :schema1, :class_name => "Katello::DockerTag",
@@ -10,14 +11,22 @@ module Katello
10
11
  :inverse_of => :schema2_meta_tag
11
12
 
12
13
  scoped_search :on => :name, :complete_value => true, :rename => :tag
14
+ scoped_search :on => :id, :only_explicit => true
15
+ scoped_search :on => :name, :complete_value => true
13
16
  scoped_search :on => :schema_version, :rename => :schema_version, :complete_value => { "1" => "1", "2" => "2"},
14
17
  :only_explicit => true, :ext_method => :find_by_schema_version, :operators => ["="]
15
- scoped_search :relation => :repository, :on => :name, :rename => :repository,
16
- :complete_value => true, :only_explicit => true
17
18
  scoped_search :relation => :repository, :on => :container_repository_name, :rename => :image,
18
19
  :complete_value => true, :only_explicit => true
19
20
  scoped_search :on => :digest, :rename => :digest, :complete_value => false,
20
21
  :only_explicit => true, :ext_method => :find_by_digest, :operators => ["="]
22
+ scoped_search :relation => :repositories, :on => :name, :rename => :repository, :complete_value => true,
23
+ :ext_method => :search_by_repo_name, :only_explicit => true
24
+
25
+ def self.search_by_repo_name(_key, operator, value)
26
+ conditions = sanitize_sql_for_conditions(["#{Katello::RootRepository.table_name}.name #{operator} ?", value_to_sql(operator, value)])
27
+ query = self.joins(:repository => :root).where(conditions).select('id')
28
+ {:conditions => "#{self.table_name}.id IN (#{query.to_sql})"}
29
+ end
21
30
 
22
31
  def self.meta_tags_by_digest_query(operator, digest, manifest_klass)
23
32
  search = "digest #{operator} ?"
@@ -42,7 +42,7 @@ module Katello
42
42
  end
43
43
 
44
44
  def self.grouped
45
- grouped_fields = "#{table_name}.name, #{Repository.table_name}.name, #{Product.table_name}.name"
45
+ grouped_fields = "#{table_name}.name, #{Repository.table_name}.root_id, #{Product.table_name}.name"
46
46
  ids = distinct.select("ON (#{grouped_fields}) #{table_name}.id").joins(:repository => :product)
47
47
  where(:id => ids)
48
48
  end
@@ -20,9 +20,11 @@ module Katello
20
20
  has_many :cves, :class_name => "Katello::ErratumCve", :dependent => :destroy, :inverse_of => :erratum
21
21
  has_many :packages, :class_name => "Katello::ErratumPackage", :dependent => :destroy, :inverse_of => :erratum
22
22
 
23
+ scoped_search :on => :errata_id, :only_explicit => true
23
24
  scoped_search :on => :errata_id, :rename => :id, :complete_value => true, :only_explicit => true
24
25
  scoped_search :on => :title, :only_explicit => true
25
26
  scoped_search :on => :severity, :complete_value => true
27
+ scoped_search :on => :errata_type, :only_explicit => true
26
28
  scoped_search :on => :errata_type, :rename => :type, :complete_value => true
27
29
  scoped_search :on => :issued, :complete_value => true
28
30
  scoped_search :on => :updated, :complete_value => true
@@ -210,5 +212,9 @@ module Katello
210
212
  end
211
213
  run_until(needed_function, action_function)
212
214
  end
215
+
216
+ class Jail < ::Safemode::Jail
217
+ allow :errata_id, :errata_type, :issued, :created_at, :severity, :package_names, :cves, :reboot_suggested
218
+ end
213
219
  end
214
220
  end
@@ -12,7 +12,6 @@ module Katello
12
12
  scoped_search :on => :name, :complete_value => true
13
13
  scoped_search :on => :path, :complete_value => true
14
14
  scoped_search :on => :checksum
15
- scoped_search :relation => :repositories, :on => :name, :rename => :repository, :complete_value => true
16
15
 
17
16
  def self.default_sort
18
17
  order(:name)
@@ -11,6 +11,7 @@ module Katello
11
11
 
12
12
  lazy_accessor :events, :initializer => lambda { |_s| Resources::Candlepin::Owner.events(label) }
13
13
  lazy_accessor :service_levels, :initializer => lambda { |_s| Resources::Candlepin::Owner.service_levels(label) }
14
+ lazy_accessor :system_purposes, :initializer => lambda { |_s| Resources::Candlepin::Owner.system_purpose(label) }
14
15
  lazy_accessor :debug_cert, :initializer => lambda { |_s| load_debug_cert }
15
16
  end
16
17
  end
@@ -163,8 +163,7 @@ module Katello
163
163
  end
164
164
 
165
165
  def import_hosts
166
- entitlements = Resources::Candlepin::Pool.entitlements(self.cp_id, ["consumer.uuid"])
167
- uuids = entitlements.map { |ent| ent["consumer"]["uuid"] }
166
+ uuids = Resources::Candlepin::Pool.consumer_uuids(self.cp_id)
168
167
 
169
168
  sub_facet_ids_from_cp = Katello::Host::SubscriptionFacet.where(:uuid => uuids).select(:id).pluck(:id)
170
169
  sub_facet_ids_from_pool_table = Katello::SubscriptionFacetPool.where(:pool_id => self.id).select(:subscription_facet_id).pluck(:subscription_facet_id)
@@ -107,10 +107,6 @@ module Katello
107
107
  super
108
108
  end
109
109
 
110
- def orphaned?
111
- self.provider.redhat_provider? && self.certificate.nil?
112
- end
113
-
114
110
  def support_level
115
111
  return _attr(:support_level)
116
112
  end
@@ -10,27 +10,10 @@ module Katello
10
10
  end
11
11
 
12
12
  module InstanceMethods
13
- def substitutions
14
- {
15
- :releasever => self.minor,
16
- :basearch => self.arch
17
- }
18
- end
19
-
20
13
  def content
21
14
  Katello::Content.find_by(:cp_content_id => self.content_id, :organization_id => self.product.organization_id)
22
15
  end
23
16
 
24
- def calculate_updated_name
25
- fail _("Cannot calculate name for custom repos") if custom?
26
- Katello::Candlepin::RepositoryMapper.new(self.product, self.content, self.substitutions).name
27
- end
28
-
29
- def should_update_content?
30
- (self.gpg_key_id_was.nil? && !self.gpg_key_id.nil? && self.content.gpgUrl == '') ||
31
- (!self.gpg_key_id_was.nil? && self.gpg_key_id.nil? && self.content.gpgUrl != '')
32
- end
33
-
34
17
  def yum_gpg_key_url
35
18
  # if the repo has a gpg key return a url to access it
36
19
  if (gpg_key && gpg_key.content.present?)
@@ -38,10 +21,6 @@ module Katello
38
21
  gpg_key_content_api_repository_url(self, :host => host + "/katello", :protocol => 'https')
39
22
  end
40
23
  end
41
-
42
- def custom_content_label
43
- "#{organization.label} #{product.label} #{label}".gsub(/\s/, "_")
44
- end
45
24
  end
46
25
  end
47
26
  end
@@ -5,6 +5,8 @@ module Katello
5
5
  end
6
6
 
7
7
  module InstanceMethods
8
+ API_URL = 'https://subscription.rhsm.redhat.com/subscription/consumers/'.freeze
9
+
8
10
  def sync
9
11
  Rails.logger.debug "Syncing provider #{name}"
10
12
  syncs = self.products.collect do |p|
@@ -60,7 +62,7 @@ module Katello
60
62
  end
61
63
 
62
64
  # Default to Red Hat
63
- url = upstream['apiUrl'] || 'https://subscription.rhn.redhat.com/subscription/consumers/'
65
+ url = upstream['apiUrl'] || API_URL
64
66
 
65
67
  # TODO: wait until ca_path is supported
66
68
  # https://github.com/L2G/rest-client-fork/pull/8
@@ -83,7 +85,7 @@ module Katello
83
85
  end
84
86
 
85
87
  # Default to Red Hat
86
- url = upstream['apiUrl'] || 'https://subscription.rhn.redhat.com/subscription/consumers/'
88
+ url = upstream['apiUrl'] || API_URL
87
89
 
88
90
  # TODO: wait until ca_path is supported
89
91
  # https://github.com/L2G/rest-client-fork/pull/8
@@ -3,7 +3,6 @@ module Katello
3
3
  # TODO: move into submodules
4
4
  # rubocop:disable MethodLength
5
5
  # rubocop:disable ModuleLength
6
- # rubocop:disable Metrics/AbcSize
7
6
  def self.included(base)
8
7
  base.send :include, LazyAccessor
9
8
  base.send :include, InstanceMethods
@@ -26,34 +25,6 @@ module Katello
26
25
  lazy_accessor :distributors,
27
26
  :initializer => lambda { |_s| pulp_repo_facts["distributors"] if pulp_id }
28
27
 
29
- def self.ensure_sync_notification
30
- results = {:existing => [], :deleted => []}
31
- resource = Katello.pulp_server.resources.event_notifier
32
- url = SETTINGS[:katello][:post_sync_url]
33
- type = Runcible::Resources::EventNotifier::EventTypes::REPO_SYNC_COMPLETE
34
- notifs = resource.list
35
-
36
- # delete any similar tasks with the wrong url (in case it changed)
37
- notifs.select { |n| n['event_types'] == [type] }.each do |e|
38
- if e['notifier_config']['url'] != url
39
- resource.delete(e['id'])
40
- results[:deleted] << e
41
- else
42
- results[:existing] << e
43
- end
44
- end
45
-
46
- #only create a notifier if one doesn't exist with the correct url
47
- exists = notifs.select { |n| n['event_types'] == [type] && n['notifier_config']['url'] == url }
48
-
49
- if exists.empty?
50
- resource.create(Runcible::Resources::EventNotifier::NotifierTypes::REST_API, {:url => url}, [type])
51
- results[:created] = url
52
- end
53
-
54
- results
55
- end
56
-
57
28
  def self.delete_orphaned_content
58
29
  Katello.pulp_server.resources.content.remove_orphans
59
30
  end
@@ -185,10 +156,11 @@ module Katello
185
156
  options[:upstream_name] = capsule.default_capsule? ? self.docker_upstream_name : self.container_repository_name
186
157
  options[:feed] = docker_feed_url(capsule)
187
158
  options[:enable_v1] = false
159
+ options[:tags] = capsule.default_capsule? ? self.docker_tags_whitelist : nil
188
160
  Runcible::Models::DockerImporter.new(importer_connection_options(capsule).merge(options))
189
161
  when Repository::OSTREE_TYPE
190
162
  options = importer_connection_options(capsule)
191
- options[:depth] = capsule.default_capsule? ? compute_ostree_upstream_sync_depth : ostree_capsule_sync_depth
163
+ options[:depth] = capsule.default_capsule? ? root.compute_ostree_upstream_sync_depth : ostree_capsule_sync_depth
192
164
  options[:feed] = self.importer_feed_url(capsule)
193
165
  Runcible::Models::OstreeImporter.new(options)
194
166
  when Repository::DEB_TYPE
@@ -299,7 +271,7 @@ module Katello
299
271
  yum_dist_options = {:protected => true, :id => yum_dist_id, :auto_publish => true}
300
272
  yum_dist_options[:skip] = ignorable_content if ignorable_content
301
273
  #check the instance variable, as we do not want to go to pulp
302
- yum_dist_options['checksum_type'] = self.checksum_type
274
+ yum_dist_options['checksum_type'] = self.saved_checksum_type || self.checksum_type
303
275
  yum_dist = Runcible::Models::YumDistributor.new(self.relative_path, self.unprotected, true,
304
276
  yum_dist_options)
305
277
  clone_dist = Runcible::Models::YumCloneDistributor.new(:id => "#{self.pulp_id}_clone",
@@ -334,7 +306,7 @@ module Katello
334
306
  options = { :id => self.pulp_id,
335
307
  :auto_publish => true,
336
308
  :relative_path => relative_path,
337
- :depth => self.compute_ostree_upstream_sync_depth }
309
+ :depth => self.root.compute_ostree_upstream_sync_depth }
338
310
 
339
311
  dist = Runcible::Models::OstreeDistributor.new(options)
340
312
  distributors = [dist]
@@ -379,14 +351,6 @@ module Katello
379
351
  !found.nil?
380
352
  end
381
353
 
382
- def other_repos_with_same_product_and_content
383
- Repository.where(:content_id => self.content_id).in_product(self.product).pluck(:pulp_id) - [self.pulp_id]
384
- end
385
-
386
- def other_repos_with_same_content
387
- Repository.where(:content_id => self.content_id).pluck(:pulp_id) - [self.pulp_id]
388
- end
389
-
390
354
  def package_group_count
391
355
  content_unit_counts = 0
392
356
  if self.pulp_repo_facts
@@ -395,61 +359,6 @@ module Katello
395
359
  content_unit_counts
396
360
  end
397
361
 
398
- # remove errata and groups from this repo
399
- # that have no packages
400
- def purge_empty_groups_errata
401
- package_lists = package_lists_for_publish
402
- rpm_names = package_lists[:names]
403
- filenames = package_lists[:filenames]
404
-
405
- # Remove all errata with no packages
406
- errata_to_delete = errata.collect do |erratum|
407
- erratum.errata_id if filenames.intersection(erratum.package_filenames).empty?
408
- end
409
- errata_to_delete.compact!
410
-
411
- #do the errata remove call
412
- unless errata_to_delete.empty?
413
- unassociate_by_filter(ContentViewErratumFilter::CONTENT_TYPE,
414
- "id" => { "$in" => errata_to_delete })
415
- end
416
-
417
- # Remove all package groups with no packages
418
- package_groups_to_delete = package_groups.collect do |group|
419
- group.package_group_id if rpm_names.intersection(group.package_names).empty?
420
- end
421
- package_groups_to_delete.compact!
422
-
423
- unless package_groups_to_delete.empty?
424
- unassociate_by_filter(ContentViewPackageGroupFilter::CONTENT_TYPE,
425
- "id" => { "$in" => package_groups_to_delete })
426
- end
427
- end
428
-
429
- def sync_schedule(date_and_time)
430
- if date_and_time
431
- Katello.pulp_server.extensions.repository.create_or_update_schedule(self.pulp_id, importer_type, date_and_time)
432
- else
433
- Katello.pulp_server.extensions.repository.remove_schedules(self.pulp_id, importer_type)
434
- end
435
- end
436
-
437
- def find_packages_by_name(name)
438
- Katello.pulp_server.extensions.repository.rpms_by_nvre self.pulp_id, name
439
- end
440
-
441
- def find_packages_by_nvre(name, version, release, epoch)
442
- Katello.pulp_server.extensions.repository.rpms_by_nvre self.pulp_id, name, version, release, epoch
443
- end
444
-
445
- def pulp_update_needed?
446
- changeable_attributes = %w(url unprotected checksum_type docker_upstream_name download_policy mirror_on_sync verify_ssl_on_sync
447
- upstream_username upstream_password ostree_upstream_sync_policy ostree_upstream_sync_depth ignore_global_proxy ignorable_content)
448
- changeable_attributes += %w(name container_repository_name) if docker?
449
- changeable_attributes += %w(deb_releases deb_components deb_architectures) if deb?
450
- changeable_attributes.any? { |key| previous_changes.key?(key) }
451
- end
452
-
453
362
  def sync(options = {})
454
363
  sync_options = {}
455
364
  sync_options[:max_speed] ||= SETTINGS[:katello][:pulp][:sync_KBlimit] if SETTINGS[:katello][:pulp][:sync_KBlimit] # set bandwidth limit
@@ -465,59 +374,6 @@ module Katello
465
374
  return [task]
466
375
  end
467
376
 
468
- def clone_contents_by_filter(to_repo, content_type, filter_clauses, override_config = {})
469
- content_classes = {
470
- Katello::Rpm::CONTENT_TYPE => :rpm,
471
- Katello::PackageGroup::CONTENT_TYPE => :package_group,
472
- Katello::Erratum::CONTENT_TYPE => :errata,
473
- Katello::PuppetModule::CONTENT_TYPE => :puppet_module
474
- }
475
- fail "Invalid content type #{content_type} sent. It needs to be one of #{content_classes.keys}"\
476
- unless content_classes[content_type]
477
- criteria = {}
478
- case content_type
479
- when Runcible::Extensions::Rpm.content_type
480
- criteria[:fields] = Pulp::Rpm::PULP_SELECT_FIELDS
481
- when Runcible::Extensions::Errata.content_type
482
- criteria[:fields] = Pulp::Erratum::PULP_SELECT_FIELDS
483
- end
484
-
485
- if filter_clauses && !filter_clauses.empty?
486
- if content_type == Runcible::Extensions::PuppetModule.content_type
487
- criteria[:filters] = {:association => filter_clauses}
488
- else
489
- criteria[:filters] = {:unit => filter_clauses}
490
- end
491
- end
492
- criteria[:override_config] = override_config unless override_config.empty?
493
- Katello.pulp_server.extensions.send(content_classes[content_type]).copy(self.pulp_id, to_repo.pulp_id, criteria)
494
- end
495
-
496
- def clone_contents(to_repo)
497
- events = []
498
-
499
- if self.content_type == Repository::PUPPET_TYPE
500
- events << Katello.pulp_server.extensions.puppet_module.copy(self.pulp_id, to_repo.pulp_id)
501
- else
502
- # In order to reduce the memory usage of pulp during the copy process,
503
- # include the fields that will uniquely identify the rpm. If no fields
504
- # are listed, pulp will retrieve every field it knows about for the rpm
505
- # (e.g. changelog, filelist...etc).
506
- events << Katello.pulp_server.extensions.rpm.copy(self.pulp_id, to_repo.pulp_id,
507
- :fields => Pulp::Rpm::PULP_SELECT_FIELDS)
508
-
509
- # Since the rpms will be copied above, during the copy of errata and package groups,
510
- # include the copy_children flag to request that pulp skip copying them again.
511
- events << Katello.pulp_server.extensions.errata.copy(self.pulp_id, to_repo.pulp_id,
512
- :fields => Pulp::Erratum::PULP_SELECT_FIELDS,
513
- :copy_children => false)
514
- events << Katello.pulp_server.extensions.package_group.copy(self.pulp_id, to_repo.pulp_id, :copy_children => false)
515
- events << clone_file_metadata(to_repo)
516
- end
517
-
518
- events
519
- end
520
-
521
377
  def clone_file_metadata(to_repo)
522
378
  Katello.pulp_server.extensions.yum_repo_metadata_file.copy(self.pulp_id, to_repo.pulp_id)
523
379
  end
@@ -544,7 +400,8 @@ module Katello
544
400
  def content_types
545
401
  [Katello.pulp_server.extensions.errata,
546
402
  Katello.pulp_server.extensions.package_group,
547
- Katello.pulp_server.extensions.puppet_module
403
+ Katello.pulp_server.extensions.puppet_module,
404
+ Katello.pulp_server.extensions.module_stream
548
405
  ]
549
406
  end
550
407
 
@@ -637,28 +494,6 @@ module Katello
637
494
  Katello.pulp_server.extensions.repository.unit_search(self.pulp_id, options)
638
495
  end
639
496
 
640
- # A helper method used by purge_empty_groups_errata
641
- # to obtain a list of package filenames and names
642
- # so that it could mix/match empty package groups
643
- # and errata and purge them.
644
- def package_lists_for_publish
645
- names = []
646
- filenames = []
647
- rpm_list = []
648
- rpm_ids = Katello::Pulp::Rpm.ids_for_repository(self)
649
- rpm_ids.each_slice(SETTINGS[:katello][:pulp][:bulk_load_size]) do |sub_list|
650
- rpm_list.concat(Katello.pulp_server.extensions.rpm.find_all_by_unit_ids(
651
- sub_list, %w(filename name), :include_repos => false))
652
- end
653
-
654
- rpm_list.each do |rpm|
655
- filenames << rpm["filename"]
656
- names << rpm["name"]
657
- end
658
- {:names => names.to_set,
659
- :filenames => filenames.to_set}
660
- end
661
-
662
497
  def docker?
663
498
  self.content_type == Repository::DOCKER_TYPE
664
499
  end
@@ -691,7 +526,7 @@ module Katello
691
526
  policy = capsule.download_policy || Setting[:default_proxy_download_policy]
692
527
  if self.yum?
693
528
  if policy == ::SmartProxy::DOWNLOAD_INHERIT
694
- (self.library_instance || self).download_policy
529
+ self.root.download_policy
695
530
  else
696
531
  policy
697
532
  end
@@ -790,7 +625,7 @@ module Katello
790
625
  elsif ostree?
791
626
  "#{scheme}://#{pulp_uri.host.downcase}/pulp/ostree/web/#{relative_path}"
792
627
  elsif deb?
793
- "#{scheme}://#{pulp_uri.host.downcase}/pulp/deb/#{relative_path}"
628
+ "#{scheme}://#{pulp_uri.host.downcase}/pulp/deb/#{relative_path}/"
794
629
  else
795
630
  "#{scheme}://#{pulp_uri.host.downcase}/pulp/repos/#{relative_path}/"
796
631
  end
@@ -802,6 +637,7 @@ module Katello
802
637
  Katello::Srpm.import_for_repository(self, full_index)
803
638
  Katello::Erratum.import_for_repository(self)
804
639
  Katello::PackageGroup.import_for_repository(self)
640
+ Katello::ModuleStream.import_for_repository(self)
805
641
  self.import_distribution_data
806
642
  else
807
643
  index_linked_repo
@@ -813,6 +649,7 @@ module Katello
813
649
  Rpm.copy_repository_associations(base_repo, self)
814
650
  Erratum.copy_repository_associations(base_repo, self)
815
651
  PackageGroup.copy_repository_associations(base_repo, self)
652
+ ModuleStream.copy_repository_associations(base_repo, self)
816
653
  self.update_attributes!(
817
654
  :distribution_version => base_repo.distribution_version,
818
655
  :distribution_arch => base_repo.distribution_arch,