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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf975eaf437422cc7622770087b3b996c0834bb4d0077de55ed4748670c888d2
4
- data.tar.gz: a6fbabac90eeed02b2b4a404e1c2d8af1cb245c083daf5981e2471ca035157b5
3
+ metadata.gz: 83de032a01e5d20e480d164eb425db853b1eea9a4668eb1aa853bfaa5d6a703a
4
+ data.tar.gz: aad3b14f2608df9c71cb039222ced8baf98bc89537c28967fcc1d47ac3ce3c5c
5
5
  SHA512:
6
- metadata.gz: d349265901e8142d15ad6ee35fcf6045bec5cbc8197799b9f8b8fac3edbdb29433a40f774345118a86a598587b5656e04aa9f20263cdb81ed388c9f373414a55
7
- data.tar.gz: ee28f705628e3ff302918e2bf30ba5a78addc92454937fe43fc34ed2f48b4388f1f1294c630899884afb0d6071bc9ec733843b52175c1af5ef90160759d0f814
6
+ metadata.gz: cb93e596697f4639b7b4ba3d512524f9880f63442bdba0b4963f73fe6aa18b61d4565f71f488a7cd99f54c0908cbe74cc59468b987450c5d02c9f8020a521761
7
+ data.tar.gz: 9ffa356f5005ab1e2119c119c24837530c23d4d004c1a9c99a3b120fc648f443bf126faae8adff3a5763714ba70d9aa412976f50b6d886e6dc3bd0fb4257dcce
@@ -134,6 +134,10 @@ module Katello
134
134
  scoped_search_results(query: blank_query, page: page, per_page: per_page, error: message)
135
135
  end
136
136
 
137
+ def skip_session
138
+ request.session_options[:skip] = true
139
+ end
140
+
137
141
  protected
138
142
 
139
143
  def scoped_search_query(query, group)
@@ -4,7 +4,7 @@ module Katello
4
4
  api_base_url "/katello/api"
5
5
  end
6
6
 
7
- before_action :find_capsule, :except => [:sync, :cancel_sync, :add_lifecycle_environment, :remove_lifecycle_environment]
7
+ before_action :find_capsule, :except => [:sync, :cancel_sync, :add_lifecycle_environment, :remove_lifecycle_environment, :reclaim_space]
8
8
  before_action :find_editable_capsule, :only => [:sync, :cancel_sync, :add_lifecycle_environment, :remove_lifecycle_environment]
9
9
  before_action :find_environment, :only => [:add_lifecycle_environment, :remove_lifecycle_environment]
10
10
  before_action :find_optional_organization, :only => [:sync_status]
@@ -86,6 +86,14 @@ module Katello
86
86
  end
87
87
  end
88
88
 
89
+ api :POST, '/capsules/:id/reclaim_space', N_('Reclaim space from all On Demand repositories on a smart proxy')
90
+ param :id, :number, :required => true, :desc => N_('Id of the smart proxy')
91
+ def reclaim_space
92
+ find_capsule(true)
93
+ task = async_task(::Actions::Pulp3::CapsuleContent::ReclaimSpace, @capsule)
94
+ respond_for_async :resource => task
95
+ end
96
+
89
97
  protected
90
98
 
91
99
  def respond_for_lifecycle_environments_index(environments)
@@ -104,9 +112,9 @@ module Katello
104
112
  end
105
113
  end
106
114
 
107
- def find_capsule
115
+ def find_capsule(primary_okay = false)
108
116
  @capsule = SmartProxy.unscoped.authorized(:view_capsule_content).find(params[:id])
109
- unless @capsule&.pulp_mirror?
117
+ unless @capsule&.pulp_mirror? || primary_okay
110
118
  fail _("This request may only be performed on a Smart proxy that has the Pulpcore feature with mirror=true.")
111
119
  end
112
120
  end
@@ -10,7 +10,7 @@ module Katello
10
10
  param :repository_id, :number, :required => true, :desc => N_("repository id")
11
11
  param :size, :number, :required => true, :desc => N_("Size of file to upload")
12
12
  param :checksum, String, :required => false, :desc => N_("Checksum of file to upload")
13
- param :content_type, RepositoryTypeManager.uploadable_content_types(false).map(&:label), :required => false, :desc => N_("content type ('deb', 'docker_manifest', 'file', 'ostree', 'rpm', 'srpm')")
13
+ param :content_type, RepositoryTypeManager.uploadable_content_types(false).map(&:label), :required => false, :desc => N_("content type ('deb', 'docker_manifest', 'file', 'ostree_ref', 'rpm', 'srpm')")
14
14
  def create
15
15
  fail Katello::Errors::InvalidRepositoryContent, _("Cannot upload Ansible collections.") if @repository.ansible_collection?
16
16
  content_type = params[:content_type] || ::Katello::RepositoryTypeManager.find(@repository.content_type)&.default_managed_content_type&.label
@@ -1,10 +1,15 @@
1
1
  module Katello
2
2
  class Api::V2::GenericContentUnitsController < Api::V2::ApiController
3
+ resource_description do
4
+ name 'Content Units'
5
+ param :content_type, String, desc: N_("Possible values: #{Katello::RepositoryTypeManager.generic_content_types.join(", ")}"), required: true
6
+ end
7
+ apipie_concern_subst(:a_resource => N_("a content unit"), :resource_id => "content_units")
8
+
3
9
  Katello::RepositoryTypeManager.generic_content_types(false).each do |type|
4
- apipie_concern_subst(:a_resource => N_(type), :resource_id => type.pluralize)
5
- resource_description do
6
- name type.pluralize.titleize
7
- end
10
+ api :GET, "/#{type.pluralize}", N_("List %s" % type.pluralize)
11
+ api :GET, "/#{type.pluralize}/:id", N_("Show %s" % type.gsub(/_/, ' '))
12
+ api :GET, "/repositories/:repository_id/#{type.pluralize}/:id", N_("Show %s" % type.gsub(/_/, ' '))
8
13
  end
9
14
 
10
15
  include Katello::Concerns::Api::V2::RepositoryContentController
@@ -14,6 +19,7 @@ module Katello
14
19
  end
15
20
 
16
21
  def resource_class
22
+ fail "Required param content_type is missing" unless params[:content_type]
17
23
  ::Katello::GenericContentUnit.where(content_type: params[:content_type].singularize)
18
24
  end
19
25
 
@@ -63,6 +63,7 @@ module Katello
63
63
  param :errata_ids, Array, :desc => N_("List of Errata ids to install. Will be removed in %s") % katello_agent_removal_release, required: true
64
64
 
65
65
  param_group :bulk_errata_ids
66
+ param_group :search, Api::V2::ApiController
66
67
  def apply
67
68
  task = async_task(::Actions::Katello::Host::Erratum::Install, @host, content: @errata_ids)
68
69
  respond_for_async :resource => task
@@ -143,7 +144,11 @@ module Katello
143
144
  missing = params[:errata_ids] - Erratum.where(:errata_id => params[:errata_ids]).pluck(:errata_id)
144
145
  fail HttpErrors::NotFound, _("Couldn't find errata ids '%s'") % missing.to_sentence if missing.any?
145
146
  @errata_ids = params[:errata_ids]
147
+ elsif params[:search]
148
+ @errata_ids = @host.advisory_ids(search: params[:search])
146
149
  else
150
+ # old angular way
151
+ # Todo: remove this when the old content-host errata page is removed
147
152
  @errata_ids = find_bulk_errata_ids([@host], params[:bulk_errata_ids])
148
153
  end
149
154
  end
@@ -20,10 +20,12 @@ module Katello
20
20
 
21
21
  api :GET, "/hosts/:host_id/packages", N_("List packages installed on the host")
22
22
  param :host_id, :number, :required => true, :desc => N_("ID of the host")
23
+ param :include_latest_upgradable, :boolean, :desc => N_("Also include the latest upgradable package version for each host package")
23
24
  param_group :search, Api::V2::ApiController
24
25
  add_scoped_search_description_for(Katello::InstalledPackage)
25
26
  def index
26
27
  collection = scoped_search(index_relation, :name, :asc, :resource_class => ::Katello::InstalledPackage)
28
+ collection[:results] = HostPackagePresenter.with_latest(collection[:results], @host) if ::Foreman::Cast.to_bool(params[:include_latest_upgradable])
27
29
  respond_for_index(:collection => collection)
28
30
  end
29
31
 
@@ -35,6 +35,10 @@ module Katello
35
35
  @host.host_traces
36
36
  end
37
37
 
38
+ def total_selectable(query)
39
+ query.where(:id => @host.host_traces.selectable).count
40
+ end
41
+
38
42
  private
39
43
 
40
44
  def find_host
@@ -50,6 +50,14 @@ module Katello
50
50
  end
51
51
  end
52
52
 
53
+ api :POST, "/repositories/bulk/reclaim_space", N_("Reclaim space from On Demand repositories")
54
+ param :ids, Array, :desc => N_("List of repository ids"), :required => true
55
+ def reclaim_space_from_repositories
56
+ task = async_task(::Actions::Pulp3::Repository::ReclaimSpace, @repositories)
57
+
58
+ respond_for_async :resource => task
59
+ end
60
+
53
61
  private
54
62
 
55
63
  def find_repositories
@@ -23,7 +23,7 @@ module Katello
23
23
  before_action :find_unauthorized_katello_resource, :only => [:gpg_key_content]
24
24
  before_action :find_authorized_katello_resource, :only => [:show, :update, :destroy, :sync,
25
25
  :remove_content, :upload_content, :republish,
26
- :import_uploads, :verify_checksum]
26
+ :import_uploads, :verify_checksum, :reclaim_space]
27
27
  before_action :find_content, :only => :remove_content
28
28
  before_action :find_organization_from_repo, :only => [:update]
29
29
  before_action :error_on_rh_product, :only => [:create]
@@ -234,6 +234,10 @@ module Katello
234
234
  fail HttpErrors::UnprocessableEntity, msg
235
235
  end
236
236
 
237
+ if !repo_params[:url].nil? && URI(repo_params[:url]).userinfo
238
+ fail "Do not include the username/password in the URL. Use the username/password settings instead."
239
+ end
240
+
237
241
  gpg_key = get_content_credential(repo_params, CONTENT_CREDENTIAL_GPG_KEY_TYPE)
238
242
  ssl_ca_cert = get_content_credential(repo_params, CONTENT_CREDENTIAL_SSL_CA_CERT_TYPE)
239
243
  ssl_client_cert = get_content_credential(repo_params, CONTENT_CREDENTIAL_SSL_CLIENT_CERT_TYPE)
@@ -317,6 +321,15 @@ module Katello
317
321
  raise HttpErrors::BadRequest, e.message
318
322
  end
319
323
 
324
+ api :POST, "/repositories/:id/reclaim_space", N_("Reclaim space from an On Demand repository")
325
+ param :id, :number, :required => true, :desc => N_("repository ID")
326
+ def reclaim_space
327
+ task = async_task(::Actions::Pulp3::Repository::ReclaimSpace, @repository)
328
+ respond_for_async :resource => task
329
+ rescue Errors::InvalidActionOptionError => e
330
+ raise HttpErrors::BadRequest, e.message
331
+ end
332
+
320
333
  api :PUT, "/repositories/:id", N_("Update a repository")
321
334
  param :id, :number, :required => true, :desc => N_("repository ID")
322
335
  param :name, String, :required => false
@@ -324,6 +337,9 @@ module Katello
324
337
  param_group :repo
325
338
  def update
326
339
  repo_params = repository_params
340
+ if !repo_params[:url].nil? && URI(repo_params[:url]).userinfo
341
+ fail "Do not include the username/password in the URL. Use the username/password settings instead."
342
+ end
327
343
 
328
344
  if @repository.generic?
329
345
  generic_remote_options = generic_remote_options_hash(repo_params)
@@ -421,10 +437,16 @@ module Katello
421
437
  end
422
438
 
423
439
  begin
440
+ upload_args = {
441
+ content_type: params[:content_type],
442
+ generate_metadata: generate_metadata,
443
+ sync_capsule: sync_capsule
444
+ }
445
+ upload_args.merge!(generic_content_type_import_upload_args)
446
+
424
447
  respond_for_async(resource: send(
425
448
  async ? :async_task : :sync_task,
426
- ::Actions::Katello::Repository::ImportUpload, @repository, uploads,
427
- generate_metadata: generate_metadata, sync_capsule: sync_capsule, content_type: params[:content_type]))
449
+ ::Actions::Katello::Repository::ImportUpload, @repository, uploads, upload_args))
428
450
  rescue => e
429
451
  raise HttpErrors::BadRequest, e.message
430
452
  end
@@ -617,6 +639,16 @@ module Katello
617
639
  generic_remote_options
618
640
  end
619
641
 
642
+ def generic_content_type_import_upload_args
643
+ args = {}
644
+ @repository.repository_type&.import_attributes&.collect do |import_attribute|
645
+ if params[import_attribute.api_param]
646
+ args[import_attribute.api_param] = params[import_attribute.api_param]
647
+ end
648
+ end
649
+ args
650
+ end
651
+
620
652
  def check_import_parameters
621
653
  @repository.repository_type&.import_attributes&.each do |import_attribute|
622
654
  if import_attribute.required && params[import_attribute.api_param].blank?
@@ -28,8 +28,8 @@ module Katello
28
28
  param :with_custom, :bool, :required => false, :desc => N_("If true, return custom repository sets along with redhat repos")
29
29
  param :activation_key_id, :number, :desc => N_("activation key identifier"), :required => false
30
30
  param :host_id, :number, :desc => N_("Id of the host"), :required => false
31
- param :content_access_mode_all, :bool, :desc => N_("Get all content available, not just that provided by subscriptions. Relevant for Activation Keys only")
32
- param :content_access_mode_env, :bool, :desc => N_("Limit content to just that available in the activation key's content view version. Relevant for Activation Keys only")
31
+ param :content_access_mode_all, :bool, :desc => N_("Get all content available, not just that provided by subscriptions.")
32
+ param :content_access_mode_env, :bool, :desc => N_("Limit content to just that available in the host's or activation key's content view version and lifecycle environment.")
33
33
  param_group :search, Api::V2::ApiController
34
34
  add_scoped_search_description_for(Katello::ProductContent)
35
35
  def index
@@ -1,35 +1,28 @@
1
1
  module Katello
2
2
  class Api::V2::RootController < Api::V2::ApiController
3
3
  skip_before_action :authorize # ok - only shows URLs available
4
+ skip_before_action :load_settings # no Settings used here, avoid DB calls
5
+ after_action :skip_session
4
6
 
5
7
  resource_description do
6
8
  api_version 'v2'
7
9
  api_base_url "/katello/api"
8
10
  end
9
11
 
10
- def resource_list
11
- all_routes = Engine.routes.routes
12
- all_routes = all_routes.collect { |r| r.path.spec.to_s }
13
-
14
- api_root_routes = all_routes.select do |path|
15
- path =~ %r{^/katello/api(\(/:api_version\))?/[^/]+/:id\(\.:format\)$}
16
- end
17
- api_root_routes = api_root_routes.collect do |path|
18
- path = path.sub("(/:api_version)", "")
19
- path[0..-(":id(.:format)".length + 1)]
20
- end
21
-
22
- api_root_routes.collect! { |r| { :rel => r["/katello/api/".size..-2], :href => r } }
23
-
24
- respond_for_index :collection => api_root_routes
25
- end
26
-
27
12
  def rhsm_resource_list
28
13
  # The RHSM resource list is required to interact with RHSM on the client.
29
14
  # When requested, it will return a list of the resources (href & rel) defined by katello
30
15
  # for the /rhsm namespace. The rel values are used by RHSM to determine if the server
31
16
  # supports a particular resource (e.g. environments, guestids, organizations..etc)
32
17
 
18
+ render json: self.class.rhsm_resource_list
19
+ end
20
+
21
+ def self.rhsm_resource_list
22
+ @rhsm_resource_list ||= generate_rhsm_resource_list
23
+ end
24
+
25
+ def self.generate_rhsm_resource_list
33
26
  all_routes = Engine.routes.routes.collect { |r| r.path.spec.to_s }
34
27
 
35
28
  api_routes = all_routes.select do |path|
@@ -53,8 +46,6 @@ module Katello
53
46
 
54
47
  api_routes.uniq!
55
48
  api_routes.collect! { |r| { :rel => r.split('/').last, :href => r } }
56
-
57
- respond_for_index :collection => api_routes, :template => 'resource_list'
58
49
  end
59
50
  end
60
51
  end
@@ -8,7 +8,6 @@ module Katello
8
8
  bulk_params = ActiveSupport::JSON.decode(bulk_params).
9
9
  deep_symbolize_keys
10
10
  end
11
-
12
11
  bulk_params[:included] ||= {}
13
12
  bulk_params[:excluded] ||= {}
14
13
 
@@ -22,18 +21,9 @@ module Katello
22
21
  fail HttpErrors::BadRequest, _("Sending a list of included IDs is not allowed when all items are being selected.")
23
22
  end
24
23
 
25
- items = model_scope
26
- if bulk_params[:included][:ids]
27
- items = model_scope.where(key => bulk_params[:included][:ids])
28
- elsif bulk_params[:included][:search]
29
- items = model_scope.search_for(bulk_params[:included][:search])
30
- end
31
-
32
- if bulk_params[:excluded][:ids]
33
- items = items.where.not(key => bulk_params[:excluded][:ids])
34
- end
35
-
36
- items
24
+ ::Katello::BulkItemsHelper.new(bulk_params: bulk_params,
25
+ model_scope: model_scope,
26
+ key: key).fetch
37
27
  end
38
28
  end
39
29
  end
@@ -28,7 +28,7 @@ module Katello
28
28
  end
29
29
 
30
30
  def context_urls
31
- super.merge(rhsm_url: rhsm_url, pulp_content_url: pulp_content_url)
31
+ super.merge(rhsm_url: smart_proxy.rhsm_url, pulp_content_url: smart_proxy.pulp_content_url)
32
32
  end
33
33
 
34
34
  private
@@ -43,14 +43,6 @@ module Katello
43
43
  proxy
44
44
  end
45
45
  end
46
-
47
- def rhsm_url
48
- URI(smart_proxy.rhsm_url)
49
- end
50
-
51
- def pulp_content_url
52
- smart_proxy.setting(SmartProxy::PULP3_FEATURE, 'content_app_url')
53
- end
54
46
  end
55
47
  end
56
48
  end
@@ -48,7 +48,7 @@ module Katello
48
48
 
49
49
  def inputs
50
50
  if feature_name == 'katello_errata_install'
51
- { :errata => errata_inputs }
51
+ { "Errata Search Query" => "errata_id ^ (#{errata_inputs.join(',')})" }
52
52
  elsif feature_name == 'katello_service_restart'
53
53
  { :helper => params[:name] }
54
54
  elsif feature_name == 'katello_module_stream_action'
@@ -40,7 +40,7 @@ module Actions
40
40
  pulp_repo = repo.backend_service(smart_proxy)
41
41
  if !current_repos_on_capsule_ids.include?(repo.id)
42
42
  pulp_repo.create_mirror_entities
43
- elsif pulp_repo.mirror_needs_updates?
43
+ else
44
44
  tasks += pulp_repo.refresh_mirror_entities
45
45
  end
46
46
  end
@@ -3,6 +3,7 @@ module Actions
3
3
  module CapsuleContent
4
4
  class SyncCapsule < ::Actions::EntryAction
5
5
  include Actions::Katello::PulpSelector
6
+ # rubocop:disable Metrics/MethodLength
6
7
  def plan(smart_proxy, options = {})
7
8
  plan_self(:smart_proxy_id => smart_proxy.id)
8
9
  action_subject(smart_proxy)
@@ -17,11 +18,11 @@ module Actions
17
18
  repos.in_groups_of(Setting[:foreman_proxy_content_batch_size], false) do |repo_batch|
18
19
  concurrence do
19
20
  repo_batch.each do |repo|
20
- plan_pulp_action(
21
- [Actions::Pulp::Orchestration::Repository::SmartProxySync,
22
- Actions::Pulp3::CapsuleContent::Sync],
23
- repo, smart_proxy,
24
- skip_metadata_check: skip_metadata_check)
21
+ if smart_proxy.backend_service_type(repo) == Actions::Pulp3::Abstract::BACKEND_SERVICE_TYPE
22
+ plan_action(Actions::Pulp3::CapsuleContent::Sync,
23
+ repo, smart_proxy,
24
+ skip_metadata_check: skip_metadata_check)
25
+ end
25
26
  end
26
27
  end
27
28
 
@@ -39,6 +40,7 @@ module Actions
39
40
  end
40
41
  end
41
42
  end
43
+ # rubocop:enable Metrics/MethodLength
42
44
 
43
45
  def repos_to_sync(smart_proxy, environment, content_view, repository, skip_metatadata_check = false)
44
46
  smart_proxy_helper = ::Katello::SmartProxyHelper.new(smart_proxy)
@@ -37,7 +37,7 @@ module Actions
37
37
  handle_redhat_content(repository) unless skip_environment_update
38
38
  else
39
39
  if destroy_content && !skip_environment_update
40
- handle_custom_content(repository)
40
+ handle_custom_content(repository, remove_from_content_view_versions)
41
41
  end
42
42
  end
43
43
  end
@@ -57,9 +57,9 @@ module Actions
57
57
  end
58
58
  end
59
59
 
60
- def handle_custom_content(repository)
60
+ def handle_custom_content(repository, remove_from_content_view_versions)
61
61
  #if this is the last instance of a custom repo, destroy the content
62
- if repository.root.repositories.where.not(id: repository.id).empty?
62
+ if remove_from_content_view_versions || repository.root.repositories.where.not(id: repository.id).empty?
63
63
  plan_action(::Actions::Katello::Product::ContentDestroy, repository.root)
64
64
  end
65
65
  end
@@ -4,6 +4,7 @@ module Actions
4
4
  module Repository
5
5
  class ImportUpload < Actions::EntryAction
6
6
  include Actions::Katello::PulpSelector
7
+ # rubocop:disable Metrics/MethodLength
7
8
  def plan(repository, uploads, options = {})
8
9
  action_subject(repository)
9
10
  repository.clear_smart_proxy_sync_histories
@@ -21,6 +22,7 @@ module Actions
21
22
  else
22
23
  unit_type_id = SmartProxy.pulp_primary.content_service(options[:content_type])::CONTENT_TYPE
23
24
  end
25
+ content_type = ::Katello::RepositoryTypeManager.find_content_type(options[:content_type])
24
26
 
25
27
  sequence do
26
28
  upload_results = concurrence do
@@ -34,8 +36,15 @@ module Actions
34
36
  unit_metadata: unit_metadata
35
37
  }
36
38
 
37
- import_upload = plan_action(Actions::Pulp3::Orchestration::Repository::ImportUpload,
38
- repository, SmartProxy.pulp_primary, import_upload_args)
39
+ import_upload_args.merge!(options)
40
+
41
+ if content_type.repository_import_on_upload
42
+ action_class = ::Actions::Pulp3::Orchestration::Repository::ImportRepositoryUpload
43
+ else
44
+ action_class = ::Actions::Pulp3::Orchestration::Repository::ImportUpload
45
+ end
46
+
47
+ import_upload = plan_action(action_class, repository, SmartProxy.pulp_primary, import_upload_args)
39
48
  plan_action(FinishUpload, repository, :import_upload_task => import_upload.output,
40
49
  generate_metadata: false, content_type: options[:content_type])
41
50
  import_upload.output
@@ -46,6 +55,7 @@ module Actions
46
55
  plan_self(repository_id: repository.id, sync_capsule: sync_capsule, upload_results: upload_results)
47
56
  end
48
57
  end
58
+ # rubocop:enable Metrics/MethodLength
49
59
 
50
60
  def run
51
61
  repository = ::Katello::Repository.find(input[:repository_id])
@@ -77,8 +77,6 @@ module Actions
77
77
  Presenters::FileUnitPresenter.new(self)
78
78
  elsif repo.try(:docker?)
79
79
  Presenters::DockerPresenter.new(self)
80
- elsif repo.try(:ostree?)
81
- Presenters::OstreePresenter.new(self)
82
80
  elsif repo.try(:deb?)
83
81
  Presenters::DebPresenter.new(self)
84
82
  end
@@ -46,7 +46,7 @@ module Actions
46
46
  end
47
47
 
48
48
  def combined_tasks
49
- return nil if pulp_tasks.nil? || task_groups.nil?
49
+ return nil if pulp_tasks.nil? && task_groups.nil?
50
50
  pulp_tasks + task_groups
51
51
  end
52
52
 
@@ -120,11 +120,23 @@ module Actions
120
120
  end
121
121
 
122
122
  def external_task=(external_task_data)
123
- #currently we assume everything coming from invoke_external_task_methods are tasks
124
123
  tasks = transform_task_response(external_task_data)
125
- output[:pulp_tasks] = new_or_existing_objects(::Katello::Pulp3::Task, tasks)
124
+ output[:pulp_tasks] = [] if output[:pulp_tasks].nil?
125
+ output[:task_groups] = [] if output[:task_groups].nil?
126
+ if tasks.detect { |task| task['task'] || (task['pulp_href'] && !task['tasks']) }
127
+ output[:pulp_tasks] = new_or_existing_objects(::Katello::Pulp3::Task, tasks)
128
+ add_task_groups
129
+ else
130
+ output[:pulp_tasks] = []
131
+ tasks.each do |task|
132
+ if task['task_group']
133
+ output[:task_groups] << ::Katello::Pulp3::TaskGroup.new_from_href(smart_proxy, task['task_group'])
134
+ elsif task['pulp_href'] && task['tasks']
135
+ output[:task_groups] << ::Katello::Pulp3::TaskGroup.new_from_href(smart_proxy, task['pulp_href'])
136
+ end
137
+ end
138
+ end
126
139
 
127
- add_task_groups
128
140
  check_for_errors
129
141
  end
130
142
 
@@ -17,13 +17,14 @@ module Actions
17
17
 
18
18
  def invoke_external_task
19
19
  repository = ::Katello::Repository.find(input[:repository_id])
20
+ backend = repository.backend_service(smart_proxy).with_mirror_adapter
20
21
  #yum repositories use metadata mirroring always, so we should never
21
- # regenerate metadata on proxies
22
- if repository.yum?
22
+ # regenerate metadata on proxies. but if there is no publication,
23
+ # it means the repo was likely empty and syncing didn't generate one
24
+ if repository.yum? && backend.publication_href.present?
23
25
  []
24
26
  else
25
- smart_proxy = ::SmartProxy.unscoped.find(input[:smart_proxy_id])
26
- repository.backend_service(smart_proxy).with_mirror_adapter.create_publication
27
+ backend.create_publication
27
28
  end
28
29
  end
29
30
  end
@@ -0,0 +1,25 @@
1
+ module Actions
2
+ module Pulp3
3
+ module CapsuleContent
4
+ class ReclaimSpace < Pulp3::AbstractAsyncTask
5
+ def plan(smart_proxy)
6
+ if smart_proxy.pulp_primary?
7
+ repository_hrefs = ::Katello::Pulp3::RepositoryReference.default_cv_repository_hrefs(::Katello::Repository.unscoped.on_demand, ::Organization.all)
8
+ repository_hrefs.flatten!
9
+ else
10
+ if smart_proxy.download_policy != ::Katello::RootRepository::DOWNLOAD_ON_DEMAND
11
+ fail _('Only On Demand smart proxies may have space reclaimed.')
12
+ end
13
+ repository_hrefs = ::Katello::Pulp3::Api::Core.new(smart_proxy).core_repositories_list_all(fields: 'pulp_href').map(&:pulp_href)
14
+ end
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
@@ -0,0 +1,36 @@
1
+ module Actions
2
+ module Pulp3
3
+ module Orchestration
4
+ module Repository
5
+ #Used for a different type of uploading where you are importing an entire repository, not a single content unit
6
+ # This workflow involves never actually creating a content unit directly, but instead importing the artifact directly into the repository
7
+ class ImportRepositoryUpload < Pulp3::Abstract
8
+ def plan(repository, smart_proxy, args)
9
+ file = {:filename => args.dig(:unit_key, :name), :sha256 => args.dig(:unit_key, :checksum) }
10
+ sequence do
11
+ upload_href = "/pulp/api/v3/uploads/#{args.dig(:upload_id)}/" if args.dig(:upload_id) && args.dig(:upload_id) != 'duplicate'
12
+ commit_output = plan_action(Pulp3::Repository::CommitUpload,
13
+ repository,
14
+ smart_proxy,
15
+ upload_href,
16
+ args.dig(:unit_key, :checksum)).output
17
+
18
+ artifact_output = plan_action(Pulp3::Repository::SaveArtifact,
19
+ file,
20
+ repository,
21
+ smart_proxy,
22
+ commit_output[:pulp_tasks],
23
+ args.dig(:unit_type_id), args).output
24
+ plan_self(:artifact_output => artifact_output)
25
+ plan_action(Pulp3::Repository::SaveVersion, repository, tasks: artifact_output[:pulp_tasks])
26
+ end
27
+ end
28
+
29
+ def run
30
+ output[:content_unit_href] = input[:artifact_output][:content_unit_href] || input[:artifact_output][:pulp_tasks].last[:created_resources].first
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -33,7 +33,7 @@ module Actions
33
33
  repository,
34
34
  smart_proxy,
35
35
  commit_output[:pulp_tasks],
36
- args.dig(:unit_type_id)).output
36
+ args.dig(:unit_type_id), args).output
37
37
  end
38
38
 
39
39
  plan_self(:commit_output => commit_output[:pulp_tasks], :artifact_output => artifact_output)
@@ -1,6 +1,7 @@
1
1
  module Actions
2
2
  module Pulp3
3
3
  module Repository
4
+ #Creates an artifacts
4
5
  class CommitUpload < Pulp3::AbstractAsyncTask
5
6
  def plan(repository, smart_proxy, upload_href, sha256)
6
7
  plan_self(:repository_id => repository.id, :smart_proxy_id => smart_proxy.id, :upload_href => upload_href, :sha256 => sha256)
@@ -10,10 +11,11 @@ module Actions
10
11
  repo = ::Katello::Repository.find(input[:repository_id])
11
12
  repo_backend_service = repo.backend_service(smart_proxy)
12
13
  uploads_api = repo_backend_service.core_api.uploads_api
14
+
13
15
  duplicate_sha_artifact_list = ::Katello::Pulp3::Api::Core.new(smart_proxy).artifacts_api.list("sha256": input[:sha256])
14
16
  duplicate_sha_artifact_href = duplicate_sha_artifact_list&.results&.first&.pulp_href
15
17
  if duplicate_sha_artifact_href
16
- uploads_api.delete(input[:upload_href])
18
+ uploads_api.delete(input[:upload_href]) if input[:upload_href]
17
19
  output[:artifact_href] = duplicate_sha_artifact_href
18
20
  output[:pulp_tasks] = nil
19
21
  else