katello 4.3.0.rc1 → 4.3.0.rc4

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 (299) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/v2/api_controller.rb +4 -0
  3. data/app/controllers/katello/api/v2/capsule_content_controller.rb +11 -3
  4. data/app/controllers/katello/api/v2/content_uploads_controller.rb +1 -1
  5. data/app/controllers/katello/api/v2/generic_content_units_controller.rb +10 -4
  6. data/app/controllers/katello/api/v2/host_errata_controller.rb +5 -0
  7. data/app/controllers/katello/api/v2/host_packages_controller.rb +2 -0
  8. data/app/controllers/katello/api/v2/host_tracer_controller.rb +4 -0
  9. data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +8 -0
  10. data/app/controllers/katello/api/v2/repositories_controller.rb +35 -3
  11. data/app/controllers/katello/api/v2/repository_sets_controller.rb +2 -2
  12. data/app/controllers/katello/api/v2/root_controller.rb +10 -19
  13. data/app/controllers/katello/concerns/api/v2/bulk_extensions.rb +3 -13
  14. data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +1 -9
  15. data/app/controllers/katello/remote_execution_controller.rb +1 -1
  16. data/app/lib/actions/katello/capsule_content/refresh_repos.rb +1 -1
  17. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +7 -5
  18. data/app/lib/actions/katello/repository/destroy.rb +3 -3
  19. data/app/lib/actions/katello/repository/import_upload.rb +12 -2
  20. data/app/lib/actions/pulp/repository/sync.rb +0 -2
  21. data/app/lib/actions/pulp3/abstract_async_task.rb +16 -4
  22. data/app/lib/actions/pulp3/capsule_content/generate_metadata.rb +5 -4
  23. data/app/lib/actions/pulp3/capsule_content/reclaim_space.rb +25 -0
  24. data/app/lib/actions/pulp3/orchestration/repository/import_repository_upload.rb +36 -0
  25. data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +1 -1
  26. data/app/lib/actions/pulp3/repository/commit_upload.rb +3 -1
  27. data/app/lib/actions/pulp3/repository/import_upload.rb +4 -2
  28. data/app/lib/actions/pulp3/repository/reclaim_space.rb +25 -0
  29. data/app/lib/actions/pulp3/repository/save_artifact.rb +12 -8
  30. data/app/lib/katello/resources/cdn.rb +10 -1
  31. data/app/lib/katello/resources/registry.rb +1 -1
  32. data/app/models/katello/concerns/host_managed_extensions.rb +7 -4
  33. data/app/models/katello/concerns/smart_proxy_extensions.rb +21 -9
  34. data/app/models/katello/content_view_version.rb +1 -6
  35. data/app/models/katello/glue/pulp/repo.rb +1 -2
  36. data/app/models/katello/host_tracer.rb +2 -0
  37. data/app/models/katello/pulp3/repository_reference.rb +7 -0
  38. data/app/models/katello/repository.rb +2 -30
  39. data/app/models/katello/root_repository.rb +3 -44
  40. data/app/models/setting/content.rb +2 -8
  41. data/app/presenters/katello/host_package_presenter.rb +21 -0
  42. data/app/services/katello/bulk_items_helper.rb +35 -0
  43. data/app/services/katello/pulp3/api/core.rb +16 -2
  44. data/app/services/katello/pulp3/content.rb +4 -2
  45. data/app/services/katello/pulp3/pulp_content_unit.rb +9 -3
  46. data/app/services/katello/pulp3/repository.rb +9 -4
  47. data/app/services/katello/pulp3/repository_mirror.rb +1 -1
  48. data/app/services/katello/repository_type.rb +2 -1
  49. data/app/services/katello/smart_proxy_helper.rb +10 -1
  50. data/app/views/foreman/job_templates/change_content_source.erb +42 -0
  51. data/app/views/foreman/job_templates/install_errata.erb +8 -6
  52. data/app/views/foreman/job_templates/resolve_traces.erb +4 -5
  53. data/app/views/foreman/job_templates/resolve_traces_-_katello_ansible_default.erb +3 -5
  54. data/app/views/foreman/smart_proxies/_content_sync.html.erb +17 -4
  55. data/app/views/foreman/smart_proxies/_reclaim_space.html.erb +12 -0
  56. data/app/views/foreman/smart_proxies/show.html.erb +4 -2
  57. data/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +6 -0
  58. data/app/views/katello/api/v2/{organizations/cdn_configuration.rabl → cdn_configurations/show.json.rabl} +4 -0
  59. data/app/views/katello/api/v2/content_facet/show.json.rabl +8 -0
  60. data/app/views/katello/api/v2/content_view_filters/show.json.rabl +0 -1
  61. data/app/views/katello/api/v2/content_views/base.json.rabl +1 -1
  62. data/app/views/katello/api/v2/host_packages/base.json.rabl +2 -0
  63. data/app/views/katello/api/v2/organizations/show.json.rabl +1 -1
  64. data/app/views/katello/api/v2/repositories/show.json.rabl +0 -3
  65. data/config/routes/api/v2.rb +5 -10
  66. data/db/migrate/20210331180353_katello_pool_organization_id_not_nullable.rb +2 -0
  67. data/db/migrate/20211115215210_drop_ostree_branches.rb +13 -0
  68. data/db/migrate/20211129200124_remove_dependency_solving_algorithm_setting.rb +5 -0
  69. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +1 -2
  70. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +3 -3
  71. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.controller.js +21 -1
  72. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.factory.js +2 -1
  73. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/sync-state.service.js +2 -0
  74. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +0 -10
  75. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +0 -3
  76. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +0 -10
  77. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-versions.module.js +0 -1
  78. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version.html +0 -7
  79. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/content.service.js +0 -5
  80. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.module.js +0 -1
  81. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.routes.js +0 -11
  82. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js +1 -2
  83. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js +14 -2
  84. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +2 -4
  85. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.filter.js +0 -10
  86. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-reclaim-space-modal.controller.js +36 -0
  87. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +16 -2
  88. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details-reclaim-space-modal.html +18 -0
  89. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details.html +13 -0
  90. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +1 -1
  91. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +3 -6
  92. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +4 -1
  93. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js +1 -0
  94. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/product-repositories-reclaim-space-modal.controller.js +35 -0
  95. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.routes.js +0 -9
  96. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository.factory.js +3 -1
  97. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories-reclaim-space-modal.html +18 -0
  98. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +7 -8
  99. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/pulp-primary/pulp-primary.controller.js +35 -0
  100. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/pulp-primary/pulp-primary.factory.js +18 -0
  101. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/pulp-primary/pulp-primary.module.js +14 -0
  102. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/pulp-primary/pulp-primary.routes.js +16 -0
  103. data/engines/bastion_katello/lib/bastion_katello/engine.rb +0 -1
  104. data/lib/katello/permission_creator.rb +3 -4
  105. data/lib/katello/plugin.rb +4 -10
  106. data/lib/katello/repository_types/ostree.rb +3 -1
  107. data/lib/katello/tasks/reset.rake +2 -2
  108. data/lib/katello/tasks/upgrades/4.3/fix_url_auth.rake +25 -0
  109. data/lib/katello/version.rb +1 -1
  110. data/package.json +1 -0
  111. data/webpack/components/AddedStatusLabel.js +2 -1
  112. data/webpack/components/EditableTextInput/EditableTextInput.js +76 -17
  113. data/webpack/components/EditableTextInput/__tests__/editableTextInput.test.js +82 -0
  114. data/webpack/components/EditableTextInput/editableTextInput.scss +4 -0
  115. data/webpack/components/Packages/index.js +63 -0
  116. data/webpack/components/RoutedTabs/index.js +3 -1
  117. data/webpack/components/Search/Search.js +7 -1
  118. data/webpack/components/SelectAllCheckbox/index.js +2 -2
  119. data/webpack/components/Table/EmptyStateMessage.js +4 -2
  120. data/webpack/components/Table/MainTable.scss +7 -1
  121. data/webpack/components/Table/TableHooks.js +10 -19
  122. data/webpack/components/Table/TableWrapper.js +3 -3
  123. data/webpack/components/WithOrganization/__snapshots__/withOrganization.test.js.snap +3 -3
  124. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard.js +24 -30
  125. data/webpack/components/extensions/HostDetails/HostDetailsConstants.js +1 -0
  126. data/webpack/components/extensions/HostDetails/HostDetailsSelectors.js +16 -0
  127. data/webpack/components/extensions/HostDetails/HostErrata/HostErrataConstants.js +2 -0
  128. data/webpack/components/extensions/HostDetails/HostPackages/HostPackagesActions.js +11 -0
  129. data/webpack/components/extensions/HostDetails/HostPackages/HostPackagesConstants.js +2 -0
  130. data/webpack/components/extensions/HostDetails/HostPackages/HostPackagesSelectors.js +16 -0
  131. data/webpack/components/extensions/HostDetails/Tabs/ContentTab/SecondaryTabsRoutes.js +4 -0
  132. data/webpack/components/extensions/HostDetails/Tabs/ContentTab/constants.js +1 -0
  133. data/webpack/components/extensions/HostDetails/Tabs/ErrataTab.js +119 -25
  134. data/webpack/components/extensions/HostDetails/Tabs/HostTracesConstants.js +1 -0
  135. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab.js +127 -0
  136. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab.scss +11 -0
  137. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js +30 -4
  138. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionConstants.js +1 -0
  139. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsActions.js +73 -0
  140. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsConstants.js +2 -0
  141. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsSelectors.js +16 -0
  142. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +347 -0
  143. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.scss +7 -0
  144. data/webpack/components/extensions/HostDetails/Tabs/TracesTab.js +38 -31
  145. data/webpack/components/extensions/HostDetails/Tabs/__tests__/bookmarks.fixtures.json +12 -0
  146. data/webpack/components/extensions/HostDetails/Tabs/__tests__/contentOverrides.fixtures.json +227 -0
  147. data/webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js +423 -2
  148. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packages.fixtures.json +28 -0
  149. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js +91 -0
  150. data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySets.fixtures.json +120 -0
  151. data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +307 -0
  152. data/webpack/components/extensions/HostDetails/Tabs/__tests__/resolveErrata.fixtures.json +35 -0
  153. data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +55 -9
  154. data/webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js +28 -14
  155. data/webpack/containers/Application/overrides.scss +31 -9
  156. data/webpack/global_index.js +11 -4
  157. data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +0 -2
  158. data/webpack/scenes/Content/ContentConfig.js +23 -7
  159. data/webpack/scenes/Content/Details/__tests__/contentDetail.test.js +2 -0
  160. data/webpack/scenes/ContentCredentials/ContentCredentialActions.js +18 -0
  161. data/webpack/scenes/ContentCredentials/ContentCredentialConstants.js +2 -0
  162. data/webpack/scenes/ContentCredentials/ContentCredentialSelectors.js +12 -0
  163. data/webpack/scenes/ContentCredentials/__tests__/contentCredentials.fixtures.js +73 -0
  164. data/webpack/scenes/ContentViews/Copy/CopyContentViewForm.js +8 -12
  165. data/webpack/scenes/ContentViews/Copy/CopyContentViewModal.js +1 -1
  166. data/webpack/scenes/ContentViews/Copy/__tests__/copyContentView.test.js +1 -1
  167. data/webpack/scenes/ContentViews/Create/ContentViewFormComponents.js +3 -3
  168. data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +7 -2
  169. data/webpack/scenes/ContentViews/Create/CreateContentViewForm.scss +7 -0
  170. data/webpack/scenes/ContentViews/Create/__tests__/createContentView.test.js +9 -9
  171. data/webpack/scenes/ContentViews/Delete/ContentViewDeleteWizard.js +6 -6
  172. data/webpack/scenes/ContentViews/Delete/Steps/CVDeleteEnvironmentsSelection.js +39 -37
  173. data/webpack/scenes/ContentViews/Delete/Steps/CVDeletionFinish.js +10 -4
  174. data/webpack/scenes/ContentViews/Delete/Steps/CVDeletionReview.js +35 -33
  175. data/webpack/scenes/ContentViews/Delete/__tests__/contentViewDelete.test.js +12 -7
  176. data/webpack/scenes/ContentViews/Delete/__tests__/cvVersionsData.fixtures.json +2 -6
  177. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentEnvironments.js +13 -14
  178. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +36 -31
  179. data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +8 -8
  180. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +108 -41
  181. data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +3 -2
  182. data/webpack/scenes/ContentViews/Details/Filters/Add/CVFilterAddModal.js +2 -2
  183. data/webpack/scenes/ContentViews/Details/Filters/Add/__tests__/cvFilterCreateResult.fixtures.json +1 -2
  184. data/webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositoryTable.js +1 -4
  185. data/webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js +6 -6
  186. data/webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js +11 -5
  187. data/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js +6 -9
  188. data/webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js +5 -8
  189. data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +40 -43
  190. data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +2 -2
  191. data/webpack/scenes/ContentViews/Details/Filters/ContentType.js +4 -4
  192. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetailsHeader.js +6 -8
  193. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +6 -1
  194. data/webpack/scenes/ContentViews/Details/Filters/Rules/ContainerTag/AddEditContainerTagRuleModal.js +1 -1
  195. data/webpack/scenes/ContentViews/Details/Filters/Rules/Package/AddEditPackageRuleModal.js +16 -22
  196. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +8 -8
  197. data/webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js +3 -5
  198. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewErrataByDateDetails.fixtures.json +1 -8
  199. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetail.fixtures.json +1 -2
  200. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +5 -9
  201. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvAllRepos.fixtures.json +0 -2
  202. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataDateFilterContent.test.js +1 -9
  203. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js +2 -4
  204. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErratumFilterDetails.fixtures.json +1 -2
  205. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvFilterDetailModuleAffectedRepos.fixtures.json +1 -8
  206. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvFilterDetailWithAffectedRepos.fixtures.json +1 -8
  207. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js +2 -4
  208. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilterDetails.fixtures.json +1 -2
  209. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvPackageFilterDetail.fixtures.json +1 -3
  210. data/webpack/scenes/ContentViews/Details/Promote/ContentViewVersionPromote.js +61 -32
  211. data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +6 -1
  212. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +5 -8
  213. data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +55 -9
  214. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +2 -0
  215. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.fixtures.json +0 -2
  216. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionContent.js +48 -29
  217. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionEnvironments.js +2 -2
  218. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionErrata.js +9 -7
  219. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionErrata.scss +5 -2
  220. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +38 -9
  221. data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveCVVersionWizard.js +4 -1
  222. data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVEnvironmentSelectionForm.js +59 -53
  223. data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionDeleteFinish.js +14 -3
  224. data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionRemoveReview.js +24 -17
  225. data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemove.test.js +3 -3
  226. data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/versionsResponseData.fixtures.json +1 -4
  227. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetails.js +4 -2
  228. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsHeader.js +134 -32
  229. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionRepositoryCell.js +8 -3
  230. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionComponent.fixtures.json +1 -4
  231. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.fixtures.json +1 -2
  232. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js +21 -1
  233. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetailsCounts.fixtures.json +1 -2
  234. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetailsEmpty.test.js +22 -1
  235. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionRepositories.fixtures.json +1 -18
  236. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.fixtures.json +5 -5
  237. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +2 -0
  238. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersionsWithTask.fixtures.json +1 -3
  239. data/webpack/scenes/ContentViews/Details/contentViewInfo.scss +0 -4
  240. data/webpack/scenes/ContentViews/Publish/CVPublishForm.js +66 -53
  241. data/webpack/scenes/ContentViews/Publish/CVPublishReview.js +40 -28
  242. data/webpack/scenes/ContentViews/Publish/PublishContentViewWizard.js +3 -3
  243. data/webpack/scenes/ContentViews/Publish/__tests__/publishContentView.test.js +14 -14
  244. data/webpack/scenes/ContentViews/Publish/cvPublishForm.scss +6 -0
  245. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +53 -12
  246. data/webpack/scenes/ContentViews/Table/tableDataGenerator.js +12 -6
  247. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +6 -6
  248. data/webpack/scenes/ContentViews/components/ContentViewIcon.js +12 -7
  249. data/webpack/scenes/ContentViews/components/ContentViewsCounter.js +2 -2
  250. data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.js +26 -27
  251. data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.scss +18 -6
  252. data/webpack/scenes/ContentViews/components/WizardHeader.js +44 -0
  253. data/webpack/scenes/ContentViews/components/contentViewIcon.scss +13 -2
  254. data/webpack/scenes/Organizations/OrganizationActions.js +22 -24
  255. data/webpack/scenes/Organizations/OrganizationConstants.js +1 -3
  256. data/webpack/scenes/Organizations/OrganizationReducer.js +0 -7
  257. data/webpack/scenes/Organizations/OrganizationSelectors.js +16 -0
  258. data/webpack/scenes/Organizations/__tests__/OrganizationActions.test.js +1 -21
  259. data/webpack/scenes/Organizations/__tests__/OrganizationReducer.test.js +0 -20
  260. data/webpack/scenes/Organizations/__tests__/organizations.fixtures.js +34 -23
  261. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationForm.js +185 -0
  262. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationForm.scss +3 -0
  263. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +112 -146
  264. data/webpack/scenes/Subscriptions/Manifest/__tests__/CdnConfigurationForm.test.js +114 -0
  265. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +121 -31
  266. data/webpack/scenes/Subscriptions/Manifest/index.js +14 -3
  267. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsActions.test.js.snap +1 -0
  268. data/webpack/scenes/Tasks/TaskActions.js +4 -3
  269. data/webpack/scenes/Tasks/__tests__/__snapshots__/TaskActions.test.js.snap +1 -0
  270. data/webpack/utils/helpers.js +2 -2
  271. metadata +62 -43
  272. data/app/controllers/katello/api/v2/ostree_branches_controller.rb +0 -16
  273. data/app/lib/actions/pulp/repository/presenters/ostree_presenter.rb +0 -91
  274. data/app/models/katello/ostree_branch.rb +0 -12
  275. data/app/models/katello/repository_ostree_branch.rb +0 -7
  276. data/app/services/katello/pulp/ostree_branch.rb +0 -14
  277. data/app/services/katello/pulp/repository/ostree.rb +0 -48
  278. data/app/views/katello/api/v2/ostree_branches/compare.json.rabl +0 -10
  279. data/app/views/katello/api/v2/ostree_branches/index.json.rabl +0 -7
  280. data/app/views/katello/api/v2/ostree_branches/show.json.rabl +0 -5
  281. data/app/views/katello/api/v2/root/resource_list.json.rabl +0 -3
  282. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-ostree-branches.html +0 -26
  283. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-ostree.html +0 -27
  284. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/ostree-branch-repositories.controller.js +0 -77
  285. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/ostree-branch.controller.js +0 -31
  286. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch-info.html +0 -15
  287. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch-repositories.html +0 -72
  288. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch.html +0 -30
  289. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branch.factory.js +0 -27
  290. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.controller.js +0 -67
  291. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.module.js +0 -15
  292. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.routes.js +0 -50
  293. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/views/ostree-branches.html +0 -40
  294. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-ostree-branches.html +0 -40
  295. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/ostree-upstream-sync-policy.service.js +0 -26
  296. data/webpack/components/extensions/HostDetails/Tabs/SubscriptionTab.js +0 -12
  297. data/webpack/scenes/Content/Details/ContentCounts.js +0 -42
  298. data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +0 -108
  299. data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +0 -158
@@ -4,10 +4,11 @@ module Actions
4
4
  module Pulp3
5
5
  module Repository
6
6
  class ImportUpload < Pulp3::AbstractAsyncTask
7
- def plan(save_artifact_output, repository, smart_proxy)
7
+ def plan(save_artifact_output, repository, smart_proxy, options = {})
8
8
  plan_self(:save_artifact_output => save_artifact_output,
9
9
  :repository_id => repository.id,
10
- :smart_proxy_id => smart_proxy.id)
10
+ :smart_proxy_id => smart_proxy.id,
11
+ :options => options)
11
12
  end
12
13
 
13
14
  def invoke_external_task
@@ -19,6 +20,7 @@ module Actions
19
20
 
20
21
  repo = ::Katello::Repository.find(input[:repository_id])
21
22
  repo_backend_service = repo.backend_service(smart_proxy)
23
+
22
24
  output[:content_unit_href] = content_unit_href
23
25
  output[:pulp_tasks] = [repo_backend_service.add_content(content_unit_href)]
24
26
  end
@@ -0,0 +1,25 @@
1
+ module Actions
2
+ module Pulp3
3
+ module Repository
4
+ class ReclaimSpace < Pulp3::AbstractAsyncTask
5
+ def plan(repositories, smart_proxy = SmartProxy.pulp_primary)
6
+ repositories = [repositories] if repositories.is_a?(::Katello::Repository)
7
+ if repositories.empty?
8
+ fail _("No repositories selected.")
9
+ end
10
+ repositories = repositories.select { |repo| repo.download_policy == ::Katello::RootRepository::DOWNLOAD_ON_DEMAND }
11
+ if repositories.empty?
12
+ fail _("Only On Demand repositories may have space reclaimed.")
13
+ end
14
+ repository_hrefs = ::Katello::Pulp3::RepositoryReference.default_cv_repository_hrefs(repositories, Organization.current)
15
+ plan_self(repository_hrefs: repository_hrefs, smart_proxy_id: smart_proxy.id)
16
+ end
17
+
18
+ def invoke_external_task
19
+ output[:pulp_tasks] = ::Katello::Pulp3::Api::Core.new(SmartProxy.find(input[:smart_proxy_id])).
20
+ repositories_reclaim_space_api.reclaim(repo_hrefs: input[:repository_hrefs])
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -2,6 +2,7 @@ module Actions
2
2
  module Pulp3
3
3
  module Repository
4
4
  class SaveArtifact < Pulp3::AbstractAsyncTask
5
+ #This task creates a content unit and may or may not create a new repository version in the process
5
6
  def plan(file, repository, smart_proxy, tasks, unit_type_id, options = {})
6
7
  options[:file_name] = file[:filename]
7
8
  options[:sha256] = file[:sha256] || Digest::SHA256.hexdigest(File.read(file[:path]))
@@ -15,17 +16,20 @@ module Actions
15
16
  content_type = input[:unit_type_id]
16
17
  content_backend_service = SmartProxy.pulp_primary.content_service(content_type)
17
18
 
18
- existing_content = ::Katello::Pulp3::PulpContentUnit.find_duplicate_unit(repository, input['unit_type_id'], {filename: input[:options][:file_name]}, input[:options][:sha256])
19
+ existing_content = ::Katello::Pulp3::PulpContentUnit.find_duplicate_unit(repository, input[:unit_type_id], {filename: input[:options][:file_name]}, input[:options][:sha256])
19
20
  existing_content_href = existing_content&.results&.first&.pulp_href
20
21
 
21
- if existing_content_href
22
- output[:content_unit_href] = existing_content_href
23
- []
22
+ if ::Katello::RepositoryTypeManager.find_content_type(input[:unit_type_id]).repository_import_on_upload
23
+ output[:pulp_tasks] = [repository.backend_service(smart_proxy).repository_import_content(artifact_href, input[:options])]
24
24
  else
25
- output[:pulp_tasks] = [content_backend_service.content_api_create(relative_path: input[:options][:file_name],
26
- artifact: artifact_href,
27
- repository_id: input[:repository_id],
28
- content_type: content_type)]
25
+ if existing_content_href
26
+ output[:content_unit_href] = existing_content_href
27
+ []
28
+ else
29
+ output[:pulp_tasks] = [content_backend_service.content_api_create(relative_path: input[:options][:file_name],
30
+ artifact: artifact_href,
31
+ content_type: content_type)]
32
+ end
29
33
  end
30
34
  end
31
35
 
@@ -41,7 +41,12 @@ module Katello
41
41
  :ssl_ca_cert)
42
42
 
43
43
  if options[:ssl_ca_cert].present?
44
- ca_cert = OpenSSL::X509::Certificate.new(options[:ssl_ca_cert])
44
+ begin
45
+ ca_cert = OpenSSL::X509::Certificate.new(options[:ssl_ca_cert])
46
+ rescue
47
+ raise _("Invalid SSL CA certificate given for CDN")
48
+ end
49
+
45
50
  @cert_store = OpenSSL::X509::Store.new
46
51
  @cert_store.add_cert(ca_cert)
47
52
  end
@@ -112,6 +117,7 @@ module Katello
112
117
  net
113
118
  end
114
119
 
120
+ # rubocop:disable Metrics/MethodLength
115
121
  def get(path, _headers = {})
116
122
  net = http_downloader
117
123
  path = File.join(@uri.request_uri, path)
@@ -140,6 +146,8 @@ module Katello
140
146
  fail exception_class.new(nil, code)
141
147
  end
142
148
  end
149
+ rescue SocketError
150
+ raise _("Couldn't establish a connection to %s") % @uri
143
151
  rescue EOFError
144
152
  raise RestClient::ServerBrokeConnection
145
153
  rescue Timeout::Error
@@ -152,6 +160,7 @@ module Katello
152
160
  raise Errors::SecurityViolation, _("CDN loading error: access forbidden to %s") % used_url
153
161
  end
154
162
  end
163
+ # rubocop:enable Metrics/MethodLength
155
164
 
156
165
  def valid_path?(path, postfix)
157
166
  get(File.join(path, postfix)).present?
@@ -32,7 +32,7 @@ module Katello
32
32
  self.prefix = "/pulpcore_registry/"
33
33
  self.site = "#{uri.scheme}://#{uri.host}:#{uri.port}"
34
34
  self.ca_cert_file = Setting[:ssl_ca_file]
35
- pulp_primary.pulp3_ssl_configuration(self)
35
+ pulp_primary.pulp3_ssl_configuration(self, :net_http)
36
36
 
37
37
  self
38
38
  end
@@ -383,12 +383,15 @@ module Katello
383
383
  @traces_status_label ||= get_status(::Katello::TraceStatus).to_label(options)
384
384
  end
385
385
 
386
- def traces_helpers(ids = nil)
387
- traces = host_traces
388
- traces = host_traces.where(id: ids) if ids.present?
386
+ def traces_helpers(search:)
387
+ traces = host_traces.selectable.search_for(search)
389
388
  ::Katello::HostTracer.helpers_for(traces)
390
389
  end
391
390
 
391
+ def advisory_ids(search:)
392
+ ::Katello::Erratum.installable_for_hosts([self]).search_for(search).pluck(:errata_id)
393
+ end
394
+
392
395
  def valid_content_override_label?(content_label)
393
396
  available_content = subscription_facet.candlepin_consumer.available_product_content
394
397
  available_content.map(&:content).any? { |content| content.label == content_label }
@@ -411,7 +414,7 @@ end
411
414
  class ::Host::Managed::Jail < Safemode::Jail
412
415
  allow :content_source, :subscription_manager_configuration_url, :rhsm_organization_label,
413
416
  :host_collections, :pools, :hypervisor_host, :lifecycle_environment, :content_view,
414
- :installed_packages, :traces_helpers
417
+ :installed_packages, :traces_helpers, :advisory_ids
415
418
  end
416
419
 
417
420
  class ActiveRecord::Associations::CollectionProxy::Jail < Safemode::Jail
@@ -185,17 +185,17 @@ module Katello
185
185
  end
186
186
  end
187
187
 
188
- def pulp3_ssl_configuration(config)
189
- legacy_pulp_cert = !self.setting(PULP3_FEATURE, 'client_authentication')&.include?('client_certificates')
188
+ def pulp3_ssl_configuration(config, connection_adapter = Faraday.default_adapter)
189
+ legacy_pulp_cert = !self.setting(PULP3_FEATURE, 'client_authentication')&.include?('client_certificate')
190
190
 
191
- if Faraday.default_adapter == :excon
191
+ if connection_adapter == :excon
192
192
  config.ssl_client_cert = ::Cert::Certs.ssl_client_cert_filename(use_admin_as_cn_cert: legacy_pulp_cert)
193
193
  config.ssl_client_key = ::Cert::Certs.ssl_client_key_filename(use_admin_as_cn_cert: legacy_pulp_cert)
194
- elsif Faraday.default_adapter == :net_http
194
+ elsif connection_adapter == :net_http
195
195
  config.ssl_client_cert = ::Cert::Certs.ssl_client_cert(use_admin_as_cn_cert: legacy_pulp_cert)
196
196
  config.ssl_client_key = ::Cert::Certs.ssl_client_key(use_admin_as_cn_cert: legacy_pulp_cert)
197
197
  else
198
- fail "Unexpected faraday default_adapter #{Faraday.default_adapter}! Cannot continue, this is likely a bug."
198
+ fail "Unexpected connection_adapter #{Faraday.default_adapter}! Cannot continue, this is likely a bug."
199
199
  end
200
200
  end
201
201
 
@@ -423,7 +423,7 @@ module Katello
423
423
  repos = Katello::Repository
424
424
  repos = repos.in_environment(environment) if environment
425
425
  repos = repos.in_content_views([content_view]) if content_view
426
- repos
426
+ repos.respond_to?(:to_a) ? repos : repos.none
427
427
  end
428
428
 
429
429
  def repos_in_sync_history
@@ -444,12 +444,24 @@ module Katello
444
444
  end
445
445
 
446
446
  def rhsm_url
447
- if pulp_primary?
448
- "https://#{URI.parse(url).host}/rhsm"
447
+ # Since Foreman 3.1 this setting is set
448
+ if (rhsm_url = setting(SmartProxy::PULP3_FEATURE, 'rhsm_url'))
449
+ URI(rhsm_url)
450
+ # Compatibility fall back
451
+ elsif pulp_primary?
452
+ URI("https://#{URI.parse(url).host}/rhsm")
449
453
  elsif pulp_mirror?
450
- "https://#{URI.parse(url).host}:8443/rhsm"
454
+ URI("https://#{URI.parse(url).host}:8443/rhsm")
451
455
  end
452
456
  end
457
+
458
+ def pulp_content_url
459
+ URI(setting(SmartProxy::PULP3_FEATURE, 'content_app_url'))
460
+ end
461
+
462
+ class ::SmartProxy::Jail < ::Safemode::Jail
463
+ allow :rhsm_url, :pulp_content_url
464
+ end
453
465
  end
454
466
  end
455
467
  end
@@ -314,10 +314,6 @@ module Katello
314
314
  FileUnit.in_repositories(archived_repos)
315
315
  end
316
316
 
317
- def ostree_branches
318
- OstreeBranch.in_repositories(archived_repos)
319
- end
320
-
321
317
  def docker_manifests
322
318
  DockerManifest.in_repositories(archived_repos)
323
319
  end
@@ -357,8 +353,7 @@ module Katello
357
353
  update_content_counts! if content_counts.blank?
358
354
  counts = Hash[content_counts.map { |key, value| ["#{key}_count", value] }]
359
355
  counts.merge("module_stream_count" => counts["modulemd_count"],
360
- "package_count" => counts["rpm_count"],
361
- "ostree_branch_count" => counts["ostree_count"])
356
+ "package_count" => counts["rpm_count"])
362
357
  end
363
358
 
364
359
  def check_ready_to_promote!(to_env)
@@ -90,8 +90,7 @@ module Katello
90
90
  errata.count != pulp_counts['erratum'].to_i ||
91
91
  package_groups.count != pulp_counts['package_group'].to_i ||
92
92
  docker_manifests.count != pulp_counts['docker_manifest'].to_i ||
93
- docker_tags.count != pulp_counts['docker_tag'].to_i ||
94
- ostree_branches.count != pulp_counts['ostree'].to_i
93
+ docker_tags.count != pulp_counts['docker_tag'].to_i
95
94
  end
96
95
 
97
96
  def empty_in_pulp?
@@ -5,10 +5,12 @@ module Katello
5
5
  belongs_to :host, :inverse_of => :host_traces, :class_name => '::Host::Managed'
6
6
 
7
7
  scope :reboot_required, -> { where(app_type: 'static') }
8
+ scope :selectable, -> { where.not(app_type: 'session') }
8
9
 
9
10
  validates :application, :length => {:maximum => 255}, :presence => true
10
11
  validates :app_type, :length => {:maximum => 255}, :presence => true
11
12
 
13
+ scoped_search :on => :id, :only_explicit => true
12
14
  scoped_search :on => :application, :complete_value => true
13
15
  scoped_search :on => :app_type, :complete_value => true
14
16
  scoped_search :on => :helper, :complete_value => true
@@ -3,6 +3,13 @@ module Katello
3
3
  class RepositoryReference < Katello::Model
4
4
  belongs_to :root_repository, :class_name => 'Katello::RootRepository'
5
5
  belongs_to :content_view, :class_name => 'Katello::ContentView'
6
+
7
+ def self.default_cv_repository_hrefs(repositories, organizations)
8
+ organizations = [organizations] if organizations.is_a?(::Organization)
9
+ where(content_view_id: organizations.map(&:default_content_view).compact.pluck(:id)).
10
+ where(root_repository_id: repositories.pluck(:root_id)).
11
+ select(:repository_href).pluck(:repository_href)
12
+ end
6
13
  end
7
14
  end
8
15
  end
@@ -79,9 +79,6 @@ module Katello
79
79
  has_many :repository_docker_meta_tags, :class_name => "Katello::RepositoryDockerMetaTag", :dependent => :delete_all
80
80
  has_many :docker_meta_tags, :through => :repository_docker_meta_tags
81
81
 
82
- has_many :repository_ostree_branches, :class_name => "Katello::RepositoryOstreeBranch", :dependent => :delete_all
83
- has_many :ostree_branches, :through => :repository_ostree_branches
84
-
85
82
  has_many :repository_debs, :class_name => "Katello::RepositoryDeb", :dependent => :delete_all
86
83
  has_many :debs, :through => :repository_debs
87
84
 
@@ -178,7 +175,7 @@ module Katello
178
175
  delegate :name, :created_at, :updated_at, :major, :minor, :gpg_key_id, :gpg_key, :arch, :label, :url, :unprotected,
179
176
  :content_type, :product_id, :checksum_type, :docker_upstream_name, :mirror_on_sync, :"mirror_on_sync?",
180
177
  :download_policy, :verify_ssl_on_sync, :"verify_ssl_on_sync?", :upstream_username, :upstream_password,
181
- :upstream_authentication_token, :ostree_upstream_sync_policy, :ostree_upstream_sync_depth, :deb_releases,
178
+ :upstream_authentication_token, :deb_releases,
182
179
  :deb_components, :deb_architectures, :ssl_ca_cert_id, :ssl_ca_cert, :ssl_client_cert, :ssl_client_cert_id,
183
180
  :ssl_client_key_id, :os_versions, :ssl_client_key, :ignorable_content, :description, :docker_tags_whitelist,
184
181
  :ansible_collection_requirements, :ansible_collection_auth_url, :ansible_collection_auth_token,
@@ -259,13 +256,7 @@ module Katello
259
256
  end
260
257
 
261
258
  def self.undisplayable_types
262
- ret = [::Katello::Repository::CANDLEPIN_DOCKER_TYPE]
263
-
264
- unless ::Katello::RepositoryTypeManager.enabled?(Repository::OSTREE_TYPE)
265
- ret << ::Katello::Repository::CANDLEPIN_OSTREE_TYPE
266
- end
267
-
268
- ret
259
+ [::Katello::Repository::CANDLEPIN_DOCKER_TYPE]
269
260
  end
270
261
 
271
262
  def self.in_organization(org)
@@ -693,10 +684,6 @@ module Katello
693
684
  end
694
685
  end
695
686
 
696
- def ostree_branch_names
697
- self.ostree_branches.map(&:name)
698
- end
699
-
700
687
  def units_for_removal(ids, type_class = nil)
701
688
  removable_unit_association = unit_type_for_removal(type_class)
702
689
  table_name = removable_unit_association.table_name
@@ -739,21 +726,6 @@ module Katello
739
726
  }
740
727
  end
741
728
 
742
- def check_duplicate_branch_names(branch_names)
743
- dupe_branch_checker = {}
744
- dupe_branch_checker.default = 0
745
- branch_names.each do |branch|
746
- dupe_branch_checker[branch] += 1
747
- end
748
-
749
- duplicate_branch_names = dupe_branch_checker.select { |_, value| value > 1 }.keys
750
-
751
- unless duplicate_branch_names.empty?
752
- fail ::Katello::Errors::ConflictException,
753
- _("Duplicate branches specified - %{branches}") % { branches: duplicate_branch_names.join(", ")}
754
- end
755
- end
756
-
757
729
  # deleteable? is already taken by the authorization mixin
758
730
  def destroyable?(remove_from_content_view_versions = false)
759
731
  if self.environment.try(:library?) && self.content_view.default?
@@ -18,18 +18,10 @@ module Katello
18
18
  IGNORABLE_CONTENT_UNIT_TYPES = %w(srpm).freeze
19
19
  CHECKSUM_TYPES = %w(sha1 sha256).freeze
20
20
 
21
- OSTREE_UPSTREAM_SYNC_POLICY_LATEST = "latest".freeze
22
- OSTREE_UPSTREAM_SYNC_POLICY_ALL = "all".freeze
23
- OSTREE_UPSTREAM_SYNC_POLICY_CUSTOM = "custom".freeze
24
- OSTREE_UPSTREAM_SYNC_POLICIES = [OSTREE_UPSTREAM_SYNC_POLICY_LATEST, OSTREE_UPSTREAM_SYNC_POLICY_ALL, OSTREE_UPSTREAM_SYNC_POLICY_CUSTOM].freeze
25
-
26
21
  SUBSCRIBABLE_TYPES = [Repository::YUM_TYPE, Repository::OSTREE_TYPE, Repository::DEB_TYPE].freeze
27
22
 
28
23
  CONTENT_ATTRIBUTE_RESTRICTIONS = {
29
- :ostree_upstream_sync_depth => [Repository::OSTREE_TYPE],
30
- :ostree_upstream_sync_policy => [Repository::OSTREE_TYPE],
31
24
  :download_policy => [Repository::YUM_TYPE, Repository::DEB_TYPE]
32
-
33
25
  }.freeze
34
26
 
35
27
  NO_DEFAULT_HTTP_PROXY = 'none'.freeze
@@ -43,7 +35,8 @@ module Katello
43
35
  RHEL6 = 'rhel-6'.freeze
44
36
  RHEL7 = 'rhel-7'.freeze
45
37
  RHEL8 = 'rhel-8'.freeze
46
- ALLOWED_OS_VERSIONS = [RHEL6, RHEL7, RHEL8].freeze
38
+ RHEL9 = 'rhel-9'.freeze
39
+ ALLOWED_OS_VERSIONS = [RHEL6, RHEL7, RHEL8, RHEL9].freeze
47
40
 
48
41
  belongs_to :product, :inverse_of => :root_repositories, :class_name => "Katello::Product"
49
42
  has_one :provider, :through => :product
@@ -59,8 +52,6 @@ module Katello
59
52
  has_many :repository_references, :class_name => 'Katello::Pulp3::RepositoryReference', :foreign_key => :root_repository_id,
60
53
  :dependent => :destroy, :inverse_of => :root_repository
61
54
 
62
- before_validation :update_ostree_upstream_sync_policy
63
-
64
55
  validates_lengths_from_database :except => [:label]
65
56
  validates_with Validators::KatelloLabelFormatValidator, :attributes => :label
66
57
  validates_with Validators::KatelloNameFormatValidator, :attributes => :name
@@ -83,12 +74,8 @@ module Katello
83
74
  validate :ensure_valid_authentication_token, :if => :yum?
84
75
  validate :ensure_valid_deb_constraints, :if => :deb?
85
76
  validate :ensure_no_checksum_on_demand
86
- validates :url, presence: true, if: :ostree?
87
77
  validates :checksum_type, :inclusion => {:in => CHECKSUM_TYPES}, :allow_blank => true
88
78
  validates :product_id, :presence => true
89
- validates :ostree_upstream_sync_policy, :inclusion => {:in => OSTREE_UPSTREAM_SYNC_POLICIES, :allow_blank => true}, :if => :ostree?
90
- validates :ostree_upstream_sync_depth, :presence => true, :numericality => { :only_integer => true },
91
- :if => proc { |r| r.ostree? && r.ostree_upstream_sync_policy == OSTREE_UPSTREAM_SYNC_POLICY_CUSTOM }
92
79
  validates :content_type, :inclusion => {
93
80
  :in => ->(_) { Katello::RepositoryTypeManager.enabled_repository_types.keys },
94
81
  :allow_blank => false,
@@ -203,34 +190,6 @@ module Katello
203
190
  end
204
191
  end
205
192
 
206
- def update_ostree_upstream_sync_policy
207
- return unless ostree?
208
- if self.ostree_upstream_sync_policy.blank?
209
- self.ostree_upstream_sync_policy = OSTREE_UPSTREAM_SYNC_POLICY_LATEST
210
- end
211
-
212
- if self.ostree_upstream_sync_policy_changed? &&
213
- previous_changes[:ostree_upstream_sync_policy].present?
214
- self.ostree_upstream_sync_depth = nil unless self.ostree_upstream_sync_policy == OSTREE_UPSTREAM_SYNC_POLICY_CUSTOM
215
- end
216
- end
217
-
218
- def compute_ostree_upstream_sync_depth
219
- if ostree_upstream_sync_policy == OSTREE_UPSTREAM_SYNC_POLICY_CUSTOM
220
- ostree_upstream_sync_depth
221
- elsif ostree_upstream_sync_policy == OSTREE_UPSTREAM_SYNC_POLICY_ALL
222
- -1
223
- else
224
- 0
225
- end
226
- end
227
-
228
- def ensure_no_ostree_upstream_sync_policy
229
- if !ostree? && ostree_upstream_sync_policy.present?
230
- errors.add(:ostree_upstream_sync_policy, N_("cannot be set for non-ostree repositories."))
231
- end
232
- end
233
-
234
193
  def ensure_valid_ignorable_content
235
194
  return if ignorable_content.blank?
236
195
  if !yum?
@@ -372,7 +331,7 @@ module Katello
372
331
 
373
332
  def pulp_update_needed?
374
333
  changeable_attributes = %w(url unprotected checksum_type docker_upstream_name download_policy mirror_on_sync verify_ssl_on_sync
375
- upstream_username upstream_password ostree_upstream_sync_policy ostree_upstream_sync_depth ignorable_content
334
+ upstream_username upstream_password ignorable_content
376
335
  ssl_ca_cert_id ssl_client_cert_id ssl_client_key_id http_proxy_policy http_proxy_id download_concurrency)
377
336
  changeable_attributes += %w(name container_repository_name docker_tags_whitelist) if docker?
378
337
  changeable_attributes += %w(deb_releases deb_components deb_architectures gpg_key_id) if deb?
@@ -13,7 +13,6 @@ class Setting::Content < Setting
13
13
  download_policies = proc { hashify_parameters(::Katello::RootRepository::DOWNLOAD_POLICIES) }
14
14
 
15
15
  proxy_download_policies = proc { hashify_parameters(::SmartProxy::DOWNLOAD_POLICIES) }
16
- dependency_solving_options = proc { hashify_parameters(['conservative', 'greedy']) }
17
16
  cdn_ssl_versions = proc { hashify_parameters(Katello::Resources::CDN::SUPPORTED_SSL_VERSIONS) }
18
17
  http_proxy_select = [{
19
18
  name: _("HTTP Proxies"),
@@ -125,12 +124,6 @@ class Setting::Content < Setting
125
124
  self.set('content_view_solve_dependencies',
126
125
  N_('The default dependency solving value for new Content Views.'),
127
126
  false, N_('Content View Dependency Solving Default')),
128
- self.set('dependency_solving_algorithm',
129
- N_("How the logic of solving dependencies in a Content View is managed. Conservative will only add " \
130
- "packages to solve the dependencies if the package needed doesn't exist. Greedy will pull in the " \
131
- "latest package to solve a dependency even if it already does exist in the repository."),
132
- 'conservative', N_('Content View Dependency Solving Algorithm'), nil,
133
- :collection => dependency_solving_options),
134
127
  self.set('host_dmi_uuid_duplicates',
135
128
  N_("If hosts fail to register because of duplicate DMI UUIDs " \
136
129
  "add their comma-separated values here. Subsequent registrations will generate a unique DMI UUID for the affected hosts."),
@@ -154,7 +147,8 @@ class Setting::Content < Setting
154
147
  self.set('bulk_load_size', N_('The number of items fetched from a single paged Pulp API call.'), 2000,
155
148
  N_('Pulp bulk load size')),
156
149
  self.set('upload_profiles_without_dynflow', N_('Allow Katello to update host installed packages, enabled repos, and module inventory directly instead of wrapped in Dynflow tasks (try turning off if Puma processes are using too much memory)'), true,
157
- N_('Upload profiles without Dynflow'))
150
+ N_('Upload profiles without Dynflow')),
151
+ self.set('orphan_protection_time', N_('Time in minutes to consider orphan content as orphaned.'), 1440, N_('Orphaned Content Protection Time'))
158
152
  ]
159
153
  end
160
154
 
@@ -0,0 +1,21 @@
1
+ module Katello
2
+ class HostPackagePresenter < SimpleDelegator
3
+ attr_accessor :installed_package, :upgradable_version, :rpm_id
4
+
5
+ def initialize(installed_package, upgradable_version, rpm_id)
6
+ @installed_package = installed_package
7
+ @upgradable_version = upgradable_version
8
+ @rpm_id = rpm_id
9
+ super(@installed_package)
10
+ end
11
+
12
+ def self.with_latest(packages, host)
13
+ upgradable_packages_map = ::Katello::Rpm.installable_for_hosts([host]).select(:id, :name, :nvra, :evr).order(evr: :desc).all.group_by(&:name)
14
+ installed_packages_map = ::Katello::Rpm.where(nvra: packages.map(&:nvra)).select(:id, :name).group_by(&:name)
15
+
16
+ packages.map do |p|
17
+ HostPackagePresenter.new(p, upgradable_packages_map[p.name]&.first&.nvra, installed_packages_map[p.name]&.first&.id)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,35 @@
1
+ module Katello
2
+ class BulkItemsHelper
3
+ attr_reader :bulk_params, :model_scope, :key
4
+
5
+ def initialize(bulk_params:, model_scope:, key: :id)
6
+ @bulk_params = bulk_params
7
+
8
+ if @bulk_params.is_a?(String)
9
+ @bulk_params = ActiveSupport::JSON.decode(@bulk_params).
10
+ deep_symbolize_keys
11
+ end
12
+
13
+ @model_scope = model_scope
14
+ @key = key
15
+ end
16
+
17
+ def fetch
18
+ params = bulk_params
19
+ params[:included] ||= {}
20
+ params[:excluded] ||= {}
21
+
22
+ items = model_scope
23
+ if params[:included][:ids]
24
+ items = model_scope.where(key => params[:included][:ids])
25
+ elsif params[:included][:search]
26
+ items = model_scope.search_for(params[:included][:search])
27
+ end
28
+ if params[:excluded][:ids]
29
+ items = items.where.not(key => params[:excluded][:ids])
30
+ end
31
+
32
+ items
33
+ end
34
+ end
35
+ end
@@ -55,6 +55,10 @@ module Katello
55
55
  repository_type.distributions_api_class.new(api_client)
56
56
  end
57
57
 
58
+ def core_repositories_api
59
+ PulpcoreClient::RepositoriesApi.new(core_api_client)
60
+ end
61
+
58
62
  def repositories_api
59
63
  repository_type.repositories_api_class.new(api_client)
60
64
  end
@@ -81,6 +85,10 @@ module Katello
81
85
  end
82
86
  end
83
87
 
88
+ def repositories_reclaim_space_api
89
+ PulpcoreClient::RepositoriesReclaimSpaceApi.new(core_api_client)
90
+ end
91
+
84
92
  def exporter_api
85
93
  PulpcoreClient::ExportersPulpApi.new(core_api_client)
86
94
  end
@@ -102,7 +110,7 @@ module Katello
102
110
  end
103
111
 
104
112
  def orphans_api
105
- PulpcoreClient::OrphansApi.new(core_api_client)
113
+ PulpcoreClient::OrphansCleanupApi.new(core_api_client)
106
114
  end
107
115
 
108
116
  def artifacts_api
@@ -152,7 +160,7 @@ module Katello
152
160
  end
153
161
 
154
162
  def delete_orphans
155
- [orphans_api.delete]
163
+ [orphans_api.cleanup(PulpcoreClient::OrphansCleanup.new(orphan_protection_time: Setting[:orphan_protection_time]))]
156
164
  end
157
165
 
158
166
  def delete_remote(remote_href)
@@ -192,6 +200,12 @@ module Katello
192
200
  ignore_404_exception { distributions_api.delete(href) }
193
201
  end
194
202
 
203
+ def core_repositories_list_all(options = {})
204
+ self.class.fetch_from_list do |page_opts|
205
+ core_repositories_api.list(page_opts.merge(options))
206
+ end
207
+ end
208
+
195
209
  def list_all(options = {})
196
210
  self.class.fetch_from_list do |page_opts|
197
211
  repositories_api.list(page_opts.merge(options))
@@ -6,10 +6,12 @@ module Katello
6
6
  class << self
7
7
  def create_upload(size = 0, checksum = nil, content_type = nil, repository = nil)
8
8
  content_unit_href = nil
9
- if checksum
9
+ content_type = ::Katello::RepositoryTypeManager.find_content_type(content_type)
10
+
11
+ if checksum && !content_type.repository_import_on_upload
10
12
  content_backend_service = SmartProxy.pulp_primary.content_service(content_type)
11
13
  if repository&.generic?
12
- content_list = content_backend_service.content_api(repository.repository_type, content_type).list("sha256": checksum)
14
+ content_list = content_backend_service.content_api(repository.repository_type, content_type).list('sha256': checksum)
13
15
  else
14
16
  content_list = content_backend_service.content_api.list("sha256": checksum)
15
17
  end
@@ -116,24 +116,30 @@ module Katello
116
116
  content_unit_list page_opts
117
117
  end
118
118
 
119
+ # rubocop:disable Lint/UselessAssignment
119
120
  def self.find_duplicate_unit(repository, unit_type_id, file, checksum)
121
+ filter_label = 'sha256'
122
+ if unit_type_id == 'ostree_ref'
123
+ filter_label = 'checksum'
124
+ end
120
125
  content_backend_service = SmartProxy.pulp_primary.content_service(unit_type_id)
121
126
  duplicates_allowed = ::Katello::RepositoryTypeManager.find_content_type(unit_type_id).try(:duplicates_allowed)
122
127
  if repository.generic? && duplicates_allowed
123
128
  filename_key = ::Katello::RepositoryTypeManager.find_content_type(unit_type_id).filename_key
124
129
  duplicate_sha_path_content_list = content_backend_service.content_api(repository.repository_type, unit_type_id).list(
125
- "sha256": checksum,
130
+ filter_label: checksum,
126
131
  filename_key => file[:filename])
127
132
  elsif repository.generic?
128
133
  duplicate_sha_path_content_list = content_backend_service.content_api(repository.repository_type, unit_type_id).list(
129
- "sha256": checksum)
134
+ filter_label: checksum)
130
135
  else
131
136
  duplicate_sha_path_content_list = content_backend_service.content_api.list(
132
- "sha256": checksum,
137
+ filter_label: checksum,
133
138
  "relative_path": file[:filename])
134
139
  end
135
140
  duplicate_sha_path_content_list
136
141
  end
142
+ # rubocop:enable Lint/UselessAssignment
137
143
  end
138
144
  end
139
145
  end