katello 3.10.0 → 3.10.1

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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/v2/repository_sets_controller.rb +1 -1
  3. data/app/lib/actions/katello/product/destroy.rb +6 -2
  4. data/app/lib/actions/katello/repository/check_matching_content.rb +2 -1
  5. data/app/lib/actions/katello/repository/clone_yum_metadata.rb +8 -0
  6. data/app/lib/actions/pulp/repository/refresh.rb +7 -3
  7. data/app/lib/katello/concerns/renderer_extensions.rb +1 -1
  8. data/app/lib/katello/util/cdn_var_substitutor.rb +2 -1
  9. data/app/models/katello/activation_key.rb +2 -1
  10. data/app/models/katello/candlepin/repository_mapper.rb +5 -1
  11. data/app/models/katello/concerns/hostgroup_extensions.rb +7 -2
  12. data/app/models/katello/concerns/redhat_extensions.rb +3 -7
  13. data/app/models/katello/erratum.rb +2 -1
  14. data/app/models/katello/glue/pulp/repos.rb +0 -4
  15. data/app/models/katello/ostree_branch.rb +1 -3
  16. data/app/models/katello/root_repository.rb +5 -1
  17. data/app/services/katello/pulp/repository.rb +17 -10
  18. data/app/services/katello/pulp/repository/puppet.rb +1 -1
  19. data/app/views/katello/api/v2/ostree_branches/show.json.rabl +1 -1
  20. data/app/views/katello/api/v2/products/base.json.rabl +1 -1
  21. data/app/views/katello/layouts/react.html.erb +1 -1
  22. data/db/migrate/20190326145039_remove_version_date_from_ostree_branch.rb +5 -0
  23. data/db/seeds.d/111-upgrade_tasks.rb +3 -1
  24. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-module-streams.controller.js +1 -0
  25. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +1 -1
  26. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-ostree-branches.html +0 -2
  27. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-ostree.html +0 -2
  28. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch-info.html +0 -3
  29. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/partials/sync-status.html +5 -0
  30. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-ostree-branches.html +0 -4
  31. data/engines/bastion_katello/lib/bastion_katello/engine.rb +6 -1
  32. data/lib/katello/tasks/upgrades/3.11/update_puppet_repos.rake +16 -0
  33. data/lib/katello/tasks/upgrades/3.8/clear_checksum_type.rake +15 -14
  34. data/lib/katello/version.rb +1 -1
  35. data/webpack/containers/Application/config.js +2 -2
  36. data/webpack/scenes/RedHatRepositories/components/EnabledRepository/__tests__/__snapshots__/EnabledRepository.test.js.snap +1 -0
  37. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/__test__/__snapshots__/RepositorySetRepository.test.js.snap +1 -0
  38. data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +5 -0
  39. data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetails.test.js +1 -1
  40. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +2 -0
  41. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +8 -6
  42. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +36 -24
  43. data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +4 -2
  44. metadata +12 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 549f4d68cf5b318cdd905af9f64484b4b9e72c47a63e97c9762eb8d1a9bfd727
4
- data.tar.gz: e3ffb0fc087a2af96c68197dfde40416216d0d63c89e34106b89c6bf5d4282c7
3
+ metadata.gz: 8798a06f36592ba61b6f81d34e9e9f625875748ff28db06be37f37bd5788f60d
4
+ data.tar.gz: 2b17845bb2a28a81561f5e2d873616d25bd7ce0bff191a4a7d2c46836f2b05b8
5
5
  SHA512:
6
- metadata.gz: 0d0d88d495d52f78327a79dc19ece1997275474e3ee33049b681540eb18242a75b0a097c272d7d61e602d4c1cb400fb86b170727b74501bfeb9595eecbdb3fe9
7
- data.tar.gz: 9362b8d400c5424c60de7b58f99c538fe45dcba35c280204243045e110d1086fee3159e853234365d07214fcb60ba7d3c95429695f4056b87da57fa7bba21083
6
+ metadata.gz: fffb292706b356b1ec255806e507d965c7dd143fc75cddf97e1d35ea0ef32fa867a56a1dba463dd1bb11a5557576848784fc1a903469f13d375545ea1b313860
7
+ data.tar.gz: cb4ecec8972f1318a553afd24697eb457e64914e9395467d093fdf5dd634b32e86bf4cfaf730ee663c37a7ae000c007b9dd22a452dfc9d9256e47519133efbc8
@@ -125,7 +125,7 @@ module Katello
125
125
  @product_content = @product.product_content_by_id(params[:id])
126
126
  else
127
127
  content = Katello::Content.find_by(:cp_content_id => params[:id], :organization_id => @organization[:id])
128
- @product_content = Katello::ProductContent.find_by(:id => content[:id])
128
+ @product_content = Katello::ProductContent.find_by(:content_id => content.id)
129
129
  end
130
130
  fail HttpErrors::NotFound, _("Couldn't find repository set with id '%s'.") % params[:id] if @product_content.nil?
131
131
  @product = @product_content.product if @product.nil?
@@ -35,9 +35,7 @@ module Actions
35
35
  cp_id: product.cp_id, organization_label: product.organization.label)
36
36
  plan_action(Candlepin::Product::DeleteSubscriptions,
37
37
  cp_id: product.cp_id, organization_label: product.organization.label)
38
- end
39
38
 
40
- unless organization_destroy
41
39
  concurrence do
42
40
  remaining_product_content.each do |pc|
43
41
  plan_action(Candlepin::Product::ContentRemove,
@@ -49,6 +47,8 @@ module Actions
49
47
  end
50
48
  end
51
49
 
50
+ clear_pool_associations(product)
51
+
52
52
  plan_self(:product_id => product.id)
53
53
  end
54
54
  end
@@ -62,6 +62,10 @@ module Actions
62
62
  _("Delete Product")
63
63
  end
64
64
 
65
+ def clear_pool_associations(product)
66
+ product.pool_products.delete_all
67
+ end
68
+
65
69
  def view_versions(product)
66
70
  cvvs = product.published_content_view_versions.uniq
67
71
  views = cvvs.inject({}) do |result, version|
@@ -20,8 +20,9 @@ module Actions
20
20
  errata = errata_match?(source_repo, target_repo)
21
21
  package_groups = package_groups_match?(source_repo, target_repo)
22
22
  distributions = distributions_match?(source_repo, target_repo)
23
+ checksum_match = (target_repo.saved_checksum_type == source_repo.saved_checksum_type)
23
24
 
24
- output[:matching_content] = srpms_match && rpms && errata && package_groups && distributions && target_repo.published?
25
+ output[:matching_content] = srpms_match && rpms && errata && package_groups && distributions && target_repo.published? && checksum_match
25
26
  end
26
27
 
27
28
  if source_repo.content_type == ::Katello::Repository::DEB_TYPE
@@ -20,8 +20,16 @@ module Actions
20
20
  target_repo,
21
21
  :source_repository => source_repo,
22
22
  :matching_content => output[:matching_content])
23
+
24
+ plan_self(:source_checksum_type => source_repo.saved_checksum_type, :target_repo_id => target_repo.id) unless source_repo.saved_checksum_type == target_repo.saved_checksum_type
23
25
  end
24
26
  end
27
+
28
+ def finalize
29
+ repository = ::Katello::Repository.find(input[:target_repo_id])
30
+ source_checksum_type = input[:source_checksum_type]
31
+ repository.update_attributes!(saved_checksum_type: source_checksum_type) if (repository && source_checksum_type)
32
+ end
25
33
  end
26
34
  end
27
35
  end
@@ -1,7 +1,7 @@
1
1
  module Actions
2
2
  module Pulp
3
3
  module Repository
4
- class Refresh < Pulp::Abstract
4
+ class Refresh < Pulp::AbstractAsyncTask
5
5
  input_format do
6
6
  param :capsule_id
7
7
  param :pulp_id
@@ -12,9 +12,13 @@ module Actions
12
12
  plan_self(:capsule_id => options[:capsule_id], :pulp_id => repository.pulp_id)
13
13
  end
14
14
 
15
- def run
15
+ def invoke_external_task
16
16
  repo = ::Katello::Repository.find_by(:pulp_id => input[:pulp_id])
17
- output[:results] = repo.backend_service(smart_proxy(input[:capsule_id])).refresh
17
+ if repo.nil?
18
+ repo = ::Katello::ContentViewPuppetEnvironment.find_by(:pulp_id => input[:pulp_id])
19
+ repo = repo.nonpersisted_repository
20
+ end
21
+ repo.backend_service(smart_proxy(input[:capsule_id])).refresh
18
22
  end
19
23
  end
20
24
  end
@@ -7,7 +7,7 @@ module Katello
7
7
  def kickstart_attributes
8
8
  super
9
9
 
10
- medium_provider = Katello::ManagedContentMediumProvider.new(host.content_facet)
10
+ medium_provider = Katello::ManagedContentMediumProvider.new(host)
11
11
  content_view = host.try(:content_facet).try(:content_view) || host.try(:content_view)
12
12
 
13
13
  if content_view && host.operatingsystem.is_a?(Redhat) &&
@@ -60,7 +60,8 @@ module Katello
60
60
  return resolved if to_resolve.empty?
61
61
 
62
62
  futures = to_resolve.map do |path_with_substitution|
63
- Concurrent.future do
63
+ future_namespace = defined?(Concurrent::Promises) ? Concurrent::Promises : Concurrent
64
+ future_namespace.future do
64
65
  path_with_substitution.resolve_substitutions(@resource)
65
66
  end
66
67
  end
@@ -59,7 +59,8 @@ module Katello
59
59
  scoped_search :on => :content_view_id, :complete_value => true, :only_explicit => true, :validator => ScopedSearch::Validators::INTEGER
60
60
  scoped_search :on => :description, :complete_value => true
61
61
  scoped_search :on => :name, :relation => :subscriptions, :rename => :subscription_name, :complete_value => true, :ext_method => :find_by_subscription_name
62
- scoped_search :on => :id, :relation => :subscriptions, :rename => :subscription_id, :complete_value => true, :ext_method => :find_by_subscription_id
62
+ scoped_search :on => :id, :relation => :subscriptions, :rename => :subscription_id, :complete_value => true,
63
+ :only_explicit => true, :validator => ScopedSearch::Validators::INTEGER, :ext_method => :find_by_subscription_id
63
64
 
64
65
  def environment_exists
65
66
  if environment_id && environment.nil?
@@ -106,7 +106,11 @@ module Katello
106
106
  end
107
107
 
108
108
  def unprotected?
109
- kickstart? || file?
109
+ kickstart? || file? || suse?
110
+ end
111
+
112
+ def suse?
113
+ content.content_type == Repository::YUM_TYPE && !!path.downcase.match(/suse/) # rubocop:disable Style/DoubleNegation
110
114
  end
111
115
 
112
116
  def file?
@@ -88,14 +88,19 @@ module Katello
88
88
  end
89
89
 
90
90
  def equivalent_kickstart_repository
91
- return unless operatingsystem && kickstart_repository
91
+ return unless operatingsystem &&
92
+ kickstart_repository &&
93
+ operatingsystem.respond_to?(:kickstart_repos)
92
94
  ks_repos = operatingsystem.kickstart_repos(self)
93
95
  ks_repos.find { |repo| repo[:name] == kickstart_repository.label }
94
96
  end
95
97
 
96
98
  def matching_kickstart_repository?
97
99
  return true unless operatingsystem
98
- operatingsystem.kickstart_repos(self).any? { |repo| repo[:id] == kickstart_repository_id }
100
+
101
+ if operatingsystem.respond_to? :kickstart_repos
102
+ return operatingsystem.kickstart_repos(self).any? { |repo| repo[:id] == kickstart_repository_id }
103
+ end
99
104
  end
100
105
 
101
106
  private
@@ -41,11 +41,7 @@ module Katello
41
41
  end
42
42
 
43
43
  def kickstart_repos(host)
44
- distribution_repos = distribution_repositories(host)
45
-
46
- return [] if distribution_repos.empty?
47
-
48
- distros = distribution_repos.where(distribution_bootable: true)
44
+ distros = distribution_repositories(host).where(distribution_bootable: true)
49
45
  if distros && host.content_source
50
46
  distros.map { |distro| distro.to_hash(host.content_source) }
51
47
  else
@@ -55,7 +51,7 @@ module Katello
55
51
 
56
52
  def variant_repo(host, variant)
57
53
  if variant && host.content_source
58
- product_id = host&.content_facet&.kickstart_repository&.product_id
54
+ product_id = host.try(:content_facet).try(:kickstart_repository).try(:product_id) || host.try(:kickstart_repository).try(:product_id)
59
55
  distro = distribution_repositories(host)
60
56
  .joins(:product)
61
57
  .where(
@@ -75,7 +71,7 @@ module Katello
75
71
  where(:distribution_version => host.os.release,
76
72
  :distribution_arch => host.architecture.name)
77
73
  else
78
- []
74
+ Katello::Repository.none
79
75
  end
80
76
  end
81
77
  end
@@ -217,7 +217,8 @@ module Katello
217
217
  module_stream_attributes = []
218
218
  json.each do |package_item|
219
219
  if package_item['module']
220
- module_stream = ModuleStream.where(package_item['module']).first_or_create!
220
+ module_stream = ModuleStream.where(package_item['module']).first
221
+ next if module_stream.blank?
221
222
  nvreas = package_item["packages"].map { |hash| Util::Package.build_nvra(hash) }
222
223
  module_stream_id_column = "#{ModuleStreamErratumPackage.table_name}.module_stream_id"
223
224
  existing = ErratumPackage.joins(:module_streams).
@@ -34,10 +34,6 @@ module Katello
34
34
  end
35
35
 
36
36
  module InstanceMethods
37
- def empty?
38
- return self.repos(library).empty?
39
- end
40
-
41
37
  def distributions(env)
42
38
  to_ret = []
43
39
  self.repos(env).each do |repo|
@@ -9,7 +9,6 @@ module Katello
9
9
  scoped_search :on => :version, :complete_value => true
10
10
  scoped_search :on => :commit, :complete_value => true
11
11
  scoped_search :on => :uuid, :complete_value => true
12
- scoped_search :on => :version_date, :complete_value => true, :rename => :created
13
12
 
14
13
  CONTENT_TYPE = Pulp::OstreeBranch::CONTENT_TYPE
15
14
 
@@ -20,8 +19,7 @@ module Katello
20
19
  def update_from_json(json)
21
20
  update_attributes(:name => json[:branch],
22
21
  :version => json[:metadata][:version],
23
- :commit => json[:commit],
24
- :version_date => json[:_created].to_datetime
22
+ :commit => json[:commit]
25
23
  )
26
24
  end
27
25
  end
@@ -231,10 +231,14 @@ module Katello
231
231
  (%w(unprotected checksum_type container_repsoitory_name) & previous_changes.keys).any?
232
232
  end
233
233
 
234
+ def on_demand?
235
+ self.download_policy == Runcible::Models::YumImporter::DOWNLOAD_ON_DEMAND
236
+ end
237
+
234
238
  def pulp_update_needed?
235
239
  changeable_attributes = %w(url unprotected checksum_type docker_upstream_name download_policy mirror_on_sync verify_ssl_on_sync
236
240
  upstream_username upstream_password ostree_upstream_sync_policy ostree_upstream_sync_depth ignore_global_proxy ignorable_content)
237
- changeable_attributes += %w(name container_repository_name) if docker?
241
+ changeable_attributes += %w(name container_repository_name docker_tags_whitelist) if docker?
238
242
  changeable_attributes += %w(deb_releases deb_components deb_architectures gpg_key_id) if deb?
239
243
  changeable_attributes.any? { |key| previous_changes.key?(key) }
240
244
  end
@@ -123,9 +123,10 @@ module Katello
123
123
  end
124
124
 
125
125
  def refresh
126
- update_or_associate_importer
127
- update_or_associate_distributors
128
- remove_unnecessary_distributors
126
+ tasks = update_or_associate_importer
127
+ tasks += update_or_associate_distributors
128
+ tasks += remove_unnecessary_distributors
129
+ tasks
129
130
  end
130
131
 
131
132
  def update_or_associate_importer
@@ -133,6 +134,7 @@ module Katello
133
134
  importer = generate_importer
134
135
  found = existing_importers.find { |i| i['importer_type_id'] == importer.id }
135
136
 
137
+ tasks = []
136
138
  if found
137
139
  ssl_ca_cert = importer.config.delete('ssl_ca_cert')
138
140
  ssl_client_cert = importer.config.delete('ssl_client_cert')
@@ -140,35 +142,40 @@ module Katello
140
142
  importer.config['basic_auth_username'] = nil if importer.config['basic_auth_username'].blank?
141
143
  importer.config['basic_auth_password'] = nil if importer.config['basic_auth_password'].blank?
142
144
  # Update ssl options by themselves workaround for https://pulp.plan.io/issues/2727
143
- smart_proxy.pulp_api.resources.repository.update_importer(repo.pulp_id, found['id'], :ssl_client_cert => ssl_client_cert,
145
+ tasks << smart_proxy.pulp_api.resources.repository.update_importer(repo.pulp_id, found['id'], :ssl_client_cert => ssl_client_cert,
144
146
  :ssl_client_key => ssl_client_key, :ssl_ca_cert => ssl_ca_cert)
145
- smart_proxy.pulp_api.resources.repository.update_importer(repo.pulp_id, found['id'], importer.config)
147
+ tasks << smart_proxy.pulp_api.resources.repository.update_importer(repo.pulp_id, found['id'], importer.config)
146
148
  else
147
- smart_proxy.pulp_api.resources.repository.associate_importer(repo.pulp_id, repo.importers.first['importer_type_id'], importer.config)
149
+ tasks << smart_proxy.pulp_api.resources.repository.associate_importer(repo.pulp_id, repo.importers.first['importer_type_id'], importer.config)
148
150
  end
151
+ tasks
149
152
  end
150
153
 
151
154
  def update_or_associate_distributors
155
+ tasks = []
152
156
  existing_distributors = backend_data["distributors"]
153
157
  generate_distributors.each do |distributor|
154
158
  found = existing_distributors.find { |i| i['distributor_type_id'] == distributor.type_id }
155
159
  if found
156
- smart_proxy.pulp_api.resources.repository.
157
- update_distributor(repo.pulp_id, found['id'], distributor.config)
160
+ tasks << smart_proxy.pulp_api.resources.repository.update_distributor(repo.pulp_id, found['id'], distributor.config)
158
161
  else
159
162
  smart_proxy.pulp_api.resources.repository.
160
- associate_distributor(repo.pulp_id, distributor.type_id, distributor.config, :distributor_id => distributor.id)
163
+ associate_distributor(repo.pulp_id, distributor.type_id, distributor.config, :distributor_id => distributor.id,
164
+ :auto_publish => distributor.auto_publish)
161
165
  end
162
166
  end
167
+ tasks
163
168
  end
164
169
 
165
170
  def remove_unnecessary_distributors
171
+ tasks = []
166
172
  existing_distributors = backend_data["distributors"]
167
173
  generated_distributors = generate_distributors
168
174
  existing_distributors.each do |distributor|
169
175
  found = generated_distributors.find { |dist| dist.type_id == distributor['distributor_type_id'] }
170
- smart_proxy.pulp_api.resources.repository.delete_distributor(repo.pulp_id, distributor['id']) unless found
176
+ tasks << smart_proxy.pulp_api.resources.repository.delete_distributor(repo.pulp_id, distributor['id']) unless found
171
177
  end
178
+ tasks
172
179
  end
173
180
  end
174
181
  end
@@ -19,7 +19,7 @@ module Katello
19
19
  end
20
20
 
21
21
  def generate_distributors
22
- puppet_install_dist = Runcible::Models::PuppetInstallDistributor.new(puppet_install_distributor_path, :id => repo.pulp_id, :auto_publish => true)
22
+ puppet_install_dist = Runcible::Models::PuppetInstallDistributor.new(puppet_install_distributor_path, :id => repo.pulp_id, :auto_publish => false)
23
23
  puppet_dist = Runcible::Models::PuppetDistributor.new(nil, (root.unprotected || false), true,
24
24
  :id => "#{repo.pulp_id}_puppet", :auto_publish => true)
25
25
  [puppet_dist, puppet_install_dist]
@@ -1,4 +1,4 @@
1
1
  object @resource
2
2
 
3
3
  attributes :uuid, :id
4
- attributes :name, :version, :commit, :version_date
4
+ attributes :name, :version, :commit
@@ -18,7 +18,7 @@ child({:available_content => :available_content}, :if => params[:include_availab
18
18
  end
19
19
 
20
20
  child :sync_plan do
21
- attributes :id, :name, :description, :sync_date, :interval, :next_sync
21
+ attributes :id, :name, :description, :sync_date, :interval, :next_sync, :cron_expression
22
22
  end
23
23
 
24
24
  node :repository_count do |product|
@@ -11,6 +11,6 @@
11
11
  <div id="organization-id" data-id="<%= Organization.current.id if Organization.current %>" ></div>
12
12
  <div id="user-id" data-id="<%= User.current.id if User.current %>" ></div>
13
13
  <div id="reactRoot"></div>
14
+ <%= mount_react_component('katello', '#reactRoot') %>
14
15
  <% end %>
15
16
  <%= render file: "layouts/base" %>
16
- <%= mount_react_component('katello', '#reactRoot') %>
@@ -0,0 +1,5 @@
1
+ class RemoveVersionDateFromOstreeBranch < ActiveRecord::Migration[5.2]
2
+ def change
3
+ remove_column :katello_ostree_branches, :version_date, :timestamp
4
+ end
5
+ end
@@ -5,6 +5,8 @@ UpgradeTask.define_tasks(:katello) do
5
5
  {:name => 'katello:clean_backend_objects', :long_running => true, :skip_failure => true, :always_run => true},
6
6
  {:name => 'katello:upgrades:3.8:clear_checksum_type'},
7
7
  {:name => 'katello:upgrades:3.9:migrate_sync_plans'},
8
- {:name => 'katello:upgrades:3.10:clear_invalid_repo_credentials'}
8
+ {:name => 'katello:upgrades:3.10:clear_invalid_repo_credentials'},
9
+ {:name => 'katello:upgrades:3.11:import_yum_metadata'},
10
+ {:name => 'katello:upgrades:3.11:update_puppet_repos'}
9
11
  ]
10
12
  end
@@ -61,6 +61,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostModuleStreamsCont
61
61
  return scope.nutupaneParams.status;
62
62
  },
63
63
  function() {
64
+ $scope.nutupaneParams.page = 1;
64
65
  $scope.moduleStreamsNutupane.refresh();
65
66
  }
66
67
  );
@@ -62,7 +62,7 @@
62
62
  params: {
63
63
  'content_type': "ostree",
64
64
  'content_view_version_id': $scope.$stateParams.versionId,
65
- 'sort_by': 'created',
65
+ 'sort_by': 'version',
66
66
  'sort_order': 'DESC'
67
67
  }
68
68
  },
@@ -9,7 +9,6 @@
9
9
  <th bst-table-column translate>Name</th>
10
10
  <th bst-table-column translate>Version</th>
11
11
  <th bst-table-column translate>Commit</th>
12
- <th bst-table-column translate>Date</th>
13
12
  </tr>
14
13
  </thead>
15
14
 
@@ -18,7 +17,6 @@
18
17
  <td bst-table-cell>{{ branch.name }}</td>
19
18
  <td bst-table-cell>{{ branch.version }}</td>
20
19
  <td bst-table-cell>{{ branch.commit }}</td>
21
- <td bst-table-cell>{{ branch.version_date }}</td>
22
20
  </tr>
23
21
  </tbody>
24
22
  </table>
@@ -18,7 +18,6 @@
18
18
  <th bst-table-column translate>Name</th>
19
19
  <th bst-table-column translate>Version</th>
20
20
  <th bst-table-column translate>Commit</th>
21
- <th bst-table-column translate>Date</th>
22
21
  </tr>
23
22
  </thead>
24
23
 
@@ -27,7 +26,6 @@
27
26
  <td bst-table-cell>{{ branch.name }}</td>
28
27
  <td bst-table-cell>{{ branch.version }}</td>
29
28
  <td bst-table-cell>{{ branch.commit }}</td>
30
- <td bst-table-cell>{{ branch.version_date }}</td>
31
29
  </tr>
32
30
  </tbody>
33
31
  </table>
@@ -10,9 +10,6 @@
10
10
 
11
11
  <dt translate>Commit</dt>
12
12
  <dd>{{ branch.commit }}</dd>
13
-
14
- <dt translate>Date</dt>
15
- <dd>{{ branch.version_date }}</dd>
16
13
  </dl>
17
14
  </div>
18
15
  </div>
@@ -14,6 +14,11 @@
14
14
  Weekly on {{ product.sync_plan.sync_date | date:'EEEE' }} at {{ product.sync_plan.sync_date | date:'mediumTime' }} (Server Time)
15
15
  </span>
16
16
  </dd>
17
+ <dd ng-if="product.sync_plan.cron_expression">
18
+ <span translate>
19
+ Custom Cron : {{ product.sync_plan.cron_expression }}
20
+ </span>
21
+ </dd>
17
22
  <dd ng-hide="product.sync_plan.next_sync">
18
23
  <span translate>
19
24
  Synced manually, no interval set.
@@ -19,7 +19,6 @@
19
19
  <th bst-table-column><span translate>Branch Name</span></th>
20
20
  <th bst-table-column><span translate>Version</span></th>
21
21
  <th bst-table-column><span translate>Commit</span></th>
22
- <th bst-table-column><span translate>Date</span></th>
23
22
  </tr>
24
23
  </thead>
25
24
 
@@ -34,9 +33,6 @@
34
33
  <td bst-table-cell>
35
34
  {{ item.commit }}
36
35
  </td>
37
- <td bst-table-cell>
38
- {{ item.version_date }}
39
- </td>
40
36
  </tr>
41
37
  </tbody>
42
38
  </table>
@@ -14,7 +14,12 @@ module BastionKatello
14
14
 
15
15
  Bastion.register_plugin(
16
16
  :name => 'bastion_katello',
17
- :javascript => 'bastion_katello/bastion_katello',
17
+ :javascript => proc do
18
+ [
19
+ javascript_include_tag(*webpack_asset_paths('katello:common', :extension => 'js'), "data-turbolinks-track" => true),
20
+ javascript_include_tag('bastion_katello/bastion_katello')
21
+ ]
22
+ end,
18
23
  :stylesheet => 'bastion_katello/bastion_katello',
19
24
  :pages => %w(
20
25
  activation_keys
@@ -0,0 +1,16 @@
1
+ namespace :katello do
2
+ namespace :upgrades do
3
+ namespace '3.11' do
4
+ desc "update puppet repos to regenerate pulp configuration"
5
+ task :update_puppet_repos => %w(environment) do
6
+ User.current = User.anonymous_admin
7
+ Katello::Repository.puppet_type.each do |repo|
8
+ puts "Refreshing repository #{repo.label} (#{repo.id})"
9
+ install_dist = repo.backend_service(SmartProxy.pulp_master).backend_data['distributors'].find { |dist| dist['distributor_type_id'] == 'puppet_install_distributor' }
10
+ SmartProxy.pulp_master.pulp_api.resources.repository.delete_distributor(repo.pulp_id, install_dist['id'])
11
+ ForemanTasks.sync_task(::Actions::Pulp::Repository::Refresh, repo)
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -5,24 +5,25 @@ namespace :katello do
5
5
  task :clear_checksum_type => %w(environment) do
6
6
  User.current = User.anonymous_admin
7
7
 
8
- Katello::Repository.yum_type.find_each do |repo|
9
- repo.transaction do
8
+ Katello::RootRepository.yum_type.find_each do |root_repo|
9
+ root_repo.transaction do
10
10
  begin
11
- if repo.on_demand? && repo.url.present?
12
- repo.update_attribute(:checksum_type, nil)
11
+ if root_repo.on_demand? && root_repo.url.present?
12
+ root_repo.update_attribute(:checksum_type, nil)
13
13
 
14
- if repo.find_distributor[:config]&.delete(:checksum_type)
15
- Katello.pulp_server.resources.repository.update_distributor(
16
- repo.pulp_id, repo.find_distributor[:id], repo.find_distributor[:config])
17
- end
18
- end
14
+ root_repo.repositories.each do |repo|
15
+ begin
16
+ repo.update_attribute(:saved_checksum_type, nil)
19
17
 
20
- if repo.library_instance?
21
- repo.update_attributes!(
22
- source_repo_checksum_type: repo.pulp_scratchpad_checksum_type)
18
+ if repo.find_distributor[:config]&.delete(:checksum_type)
19
+ SmartProxy.pulp_master.pulp_api.resources.repository.update_distributor(
20
+ repo.pulp_id, repo.find_distributor[:id], repo.find_distributor[:config])
21
+ end
22
+ # rubocop:disable HandleExceptions
23
+ rescue RestClient::ResourceNotFound
24
+ end
25
+ end
23
26
  end
24
- # rubocop:disable HandleExceptions
25
- rescue RestClient::ResourceNotFound
26
27
  end
27
28
  end
28
29
  end
@@ -1,3 +1,3 @@
1
1
  module Katello
2
- VERSION = "3.10.0".freeze
2
+ VERSION = "3.10.1".freeze
3
3
  end
@@ -31,7 +31,7 @@ export const links = [
31
31
  },
32
32
  {
33
33
  // eslint-disable-next-line no-useless-escape
34
- path: 'subscriptions/:id([0-9]*$)',
34
+ path: 'subscriptions/:id([0-9]+)',
35
35
  component: withHeader(SubscriptionDetails, { title: __('Subscription Details') }),
36
36
  },
37
37
  {
@@ -43,7 +43,7 @@ export const links = [
43
43
  component: withHeader(ModuleStreams, { title: __('Module Streams') }),
44
44
  },
45
45
  {
46
- path: 'module_streams/:id([0-9]*$)',
46
+ path: 'module_streams/:id([0-9]+)',
47
47
  component: withHeader(ModuleStreamDetails, { title: __('Module Stream Details') }),
48
48
  },
49
49
  ];
@@ -16,6 +16,7 @@ exports[`Enabled Repositories Component should render 1`] = `
16
16
  description="some label"
17
17
  heading="foo "
18
18
  hideCloseIcon={false}
19
+ initExpanded={false}
19
20
  key="1"
20
21
  leftContent={
21
22
  <RepositoryTypeIcon
@@ -61,6 +61,7 @@ exports[`RepositorySetRepository Component should render 1`] = `
61
61
  </span>
62
62
  }
63
63
  hideCloseIcon={false}
64
+ initExpanded={false}
64
65
  leftContent={null}
65
66
  onCloseCompoundExpand={[Function]}
66
67
  onExpand={[Function]}
@@ -137,6 +137,11 @@ SubscriptionDetails.propTypes = {
137
137
  loadProducts: PropTypes.func.isRequired,
138
138
  subscriptionDetails: PropTypes.shape({}).isRequired,
139
139
  history: PropTypes.shape({ push: PropTypes.func.isRequired }).isRequired,
140
+ match: PropTypes.shape({
141
+ params: PropTypes.shape({
142
+ id: PropTypes.string.isRequired,
143
+ }).isRequired,
144
+ }).isRequired,
140
145
  };
141
146
 
142
147
  export default SubscriptionDetails;
@@ -14,7 +14,7 @@ jest.mock('../../../../move_to_foreman/foreman_toast_notifications');
14
14
 
15
15
  describe('subscriptions details page', () => {
16
16
  it('should render and contain appropiate components', async () => {
17
- const match = { params: { id: 1 } };
17
+ const match = { params: { id: '1' } };
18
18
  const noop = () => {};
19
19
 
20
20
  const wrapper = shallow(<SubscriptionDetails
@@ -89,4 +89,6 @@ export const SUBSCRIPTION_TABLE_DEFAULT_COLUMNS = [
89
89
  'contract_number',
90
90
  'start_date',
91
91
  'end_date',
92
+ 'consumed',
93
+ 'quantity',
92
94
  ];
@@ -78,7 +78,7 @@ class SubscriptionsPage extends Component {
78
78
  }
79
79
  }
80
80
 
81
- if (!isEqual(organization.owner_details, prevProps.organization.owner_details)) {
81
+ if (!isEqual(organization, prevProps.organization)) {
82
82
  this.pollTasks();
83
83
  }
84
84
  }
@@ -104,11 +104,13 @@ class SubscriptionsPage extends Component {
104
104
  pollTasks() {
105
105
  const { pollBulkSearch, organization } = this.props;
106
106
 
107
- pollBulkSearch({
108
- action: `organization '${organization.owner_details.displayName}'`,
109
- result: 'pending',
110
- label: BLOCKING_FOREMAN_TASK_TYPES.join(' or '),
111
- }, BULK_TASK_SEARCH_INTERVAL, organization.id);
107
+ if (organization && organization.owner_details) {
108
+ pollBulkSearch({
109
+ action: `organization '${organization.owner_details.displayName}'`,
110
+ result: 'pending',
111
+ label: BLOCKING_FOREMAN_TASK_TYPES.join(' or '),
112
+ }, BULK_TASK_SEARCH_INTERVAL, organization.id);
113
+ }
112
114
 
113
115
  this.props.loadSetting('content_disconnected');
114
116
  this.props.loadSubscriptions();
@@ -15,32 +15,44 @@ const loadTables = () => new Promise((resolve) => {
15
15
  describe('subscriptions page', () => {
16
16
  const noop = () => {};
17
17
  const organization = { owner_details: { upstreamConsumer: 'blah' } };
18
+ const page = shallow(<SubscriptionsPage
19
+ organization={organization}
20
+ subscriptions={successState}
21
+ subscriptionTableSettings={settingsSuccessState}
22
+ loadSetting={loadSetting}
23
+ loadTables={loadTables}
24
+ loadTableColumns={loadTableColumns}
25
+ createColumns={createColumns}
26
+ updateColumns={updateColumns}
27
+ loadSubscriptions={loadSubscriptions}
28
+ updateQuantity={updateQuantity}
29
+ pollTaskUntilDone={noop}
30
+ pollBulkSearch={noop}
31
+ deleteSubscriptions={() => {}}
32
+ resetTasks={noop}
33
+ uploadManifest={noop}
34
+ deleteManifest={noop}
35
+ refreshManifest={noop}
36
+ updateSearchQuery={noop}
37
+ openManageManifestModal={noop}
38
+ closeManageManifestModal={noop}
39
+ openDeleteModal={noop}
40
+ closeDeleteModal={noop}
41
+ openTaskModal={noop}
42
+ closeTaskModal={noop}
43
+ disableDeleteButton={noop}
44
+ enableDeleteButton={noop}
45
+ />);
18
46
 
19
47
  it('should render', async () => {
20
- const page = shallow(<SubscriptionsPage
21
- organization={organization}
22
- subscriptions={successState}
23
- subscriptionTableSettings={settingsSuccessState}
24
- loadSetting={loadSetting}
25
- loadTables={loadTables}
26
- loadTableColumns={loadTableColumns}
27
- createColumns={createColumns}
28
- updateColumns={updateColumns}
29
- loadSubscriptions={loadSubscriptions}
30
- updateQuantity={updateQuantity}
31
- pollTaskUntilDone={noop}
32
- pollBulkSearch={noop}
33
- deleteSubscriptions={() => {}}
34
- resetTasks={noop}
35
- uploadManifest={noop}
36
- deleteManifest={noop}
37
- refreshManifest={noop}
38
- updateSearchQuery={noop}
39
- openManageManifestModal={noop}
40
- closeManageManifestModal={noop}
41
- openDeleteModal={noop}
42
- closeDeleteModal={noop}
43
- />);
44
48
  expect(toJson(page)).toMatchSnapshot();
45
49
  });
50
+
51
+ it('should poll tasks when org changes', async () => {
52
+ jest.spyOn(page.instance(), 'pollTasks');
53
+
54
+ page.setProps({ organization: { id: 1 } });
55
+
56
+ expect(page.instance().pollTasks).toHaveBeenCalled();
57
+ });
46
58
  });
@@ -421,12 +421,12 @@ export const tableColumns = [
421
421
  {
422
422
  key: 'consumed',
423
423
  label: 'Consumed',
424
- value: false,
424
+ value: true,
425
425
  },
426
426
  {
427
427
  key: 'quantity',
428
428
  label: 'Entitlements',
429
- value: false,
429
+ value: true,
430
430
  },
431
431
  ];
432
432
  export const loadTableColumnsSuccessAction = [
@@ -439,6 +439,8 @@ export const loadTableColumnsSuccessAction = [
439
439
  'contract_number',
440
440
  'start_date',
441
441
  'end_date',
442
+ 'consumed',
443
+ 'quantity',
442
444
  ],
443
445
  },
444
446
  },
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katello
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.0
4
+ version: 3.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - N/A
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-15 00:00:00.000000000 Z
11
+ date: 2019-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -104,6 +104,9 @@ dependencies:
104
104
  name: foreman_docker
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
+ - - "<"
108
+ - !ruby/object:Gem::Version
109
+ version: 4.1.1
107
110
  - - ">="
108
111
  - !ruby/object:Gem::Version
109
112
  version: 0.2.0
@@ -111,6 +114,9 @@ dependencies:
111
114
  prerelease: false
112
115
  version_requirements: !ruby/object:Gem::Requirement
113
116
  requirements:
117
+ - - "<"
118
+ - !ruby/object:Gem::Version
119
+ version: 4.1.1
114
120
  - - ">="
115
121
  - !ruby/object:Gem::Version
116
122
  version: 0.2.0
@@ -165,7 +171,7 @@ dependencies:
165
171
  version: 2.10.0
166
172
  - - "<"
167
173
  - !ruby/object:Gem::Version
168
- version: 3.0.0
174
+ version: 2.11.0
169
175
  type: :runtime
170
176
  prerelease: false
171
177
  version_requirements: !ruby/object:Gem::Requirement
@@ -175,7 +181,7 @@ dependencies:
175
181
  version: 2.10.0
176
182
  - - "<"
177
183
  - !ruby/object:Gem::Version
178
- version: 3.0.0
184
+ version: 2.11.0
179
185
  - !ruby/object:Gem::Dependency
180
186
  name: anemone
181
187
  requirement: !ruby/object:Gem::Requirement
@@ -1626,6 +1632,7 @@ files:
1626
1632
  - db/migrate/20181008201422_add_modules_to_errata_packages.rb
1627
1633
  - db/migrate/20181017181806_available_module_streams.rb
1628
1634
  - db/migrate/20181027014323_add_applicable_modules.rb
1635
+ - db/migrate/20190326145039_remove_version_date_from_ostree_branch.rb
1629
1636
  - db/seeds.d/101-locations.rb
1630
1637
  - db/seeds.d/102-organizations.rb
1631
1638
  - db/seeds.d/104-proxy.rb
@@ -2229,6 +2236,7 @@ files:
2229
2236
  - lib/katello/tasks/update_subscription_facet_backend_data.rake
2230
2237
  - lib/katello/tasks/upgrade_check.rake
2231
2238
  - lib/katello/tasks/upgrades/3.10/clear_invalid_repo_credentials.rake
2239
+ - lib/katello/tasks/upgrades/3.11/update_puppet_repos.rake
2232
2240
  - lib/katello/tasks/upgrades/3.8/clear_checksum_type.rake
2233
2241
  - lib/katello/tasks/upgrades/3.9/migrate_sync_plans.rake
2234
2242
  - lib/katello/tasks/virt_who_report.rake