katello 4.11.0.rc1 → 4.11.0

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 (87) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +15 -2
  3. data/app/controllers/katello/api/v2/simple_content_access_controller.rb +1 -1
  4. data/app/controllers/katello/concerns/organizations_controller_extensions.rb +1 -1
  5. data/app/lib/katello/util/cvecf_migrator.rb +34 -0
  6. data/app/models/katello/concerns/host_managed_extensions.rb +9 -4
  7. data/app/models/katello/concerns/smart_proxy_extensions.rb +21 -0
  8. data/app/models/katello/content.rb +1 -1
  9. data/app/services/katello/product_content_importer.rb +5 -45
  10. data/db/migrate/20220929204746_add_content_view_environment_content_facet.rb +37 -4
  11. data/lib/katello/version.rb +1 -1
  12. data/lib/katello.rb +1 -0
  13. data/locale/bn/katello.po.time_stamp +0 -0
  14. data/locale/bn_IN/katello.po.time_stamp +0 -0
  15. data/locale/ca/katello.po.time_stamp +0 -0
  16. data/locale/cs/katello.po.time_stamp +0 -0
  17. data/locale/cs_CZ/katello.po.time_stamp +0 -0
  18. data/locale/de/katello.po.time_stamp +0 -0
  19. data/locale/de_AT/katello.po.time_stamp +0 -0
  20. data/locale/de_DE/katello.po.time_stamp +0 -0
  21. data/locale/el/katello.po.time_stamp +0 -0
  22. data/locale/en/katello.po.time_stamp +0 -0
  23. data/locale/en_GB/katello.po.time_stamp +0 -0
  24. data/locale/en_US/katello.po.time_stamp +0 -0
  25. data/locale/es/katello.po.time_stamp +0 -0
  26. data/locale/et_EE/katello.po.time_stamp +0 -0
  27. data/locale/fr/katello.po.time_stamp +0 -0
  28. data/locale/gl/katello.po.time_stamp +0 -0
  29. data/locale/gu/katello.po.time_stamp +0 -0
  30. data/locale/he_IL/katello.po.time_stamp +0 -0
  31. data/locale/hi/katello.po.time_stamp +0 -0
  32. data/locale/id/katello.po.time_stamp +0 -0
  33. data/locale/it/katello.po.time_stamp +0 -0
  34. data/locale/ja/katello.po.time_stamp +0 -0
  35. data/locale/ka/katello.po.time_stamp +0 -0
  36. data/locale/kn/katello.po.time_stamp +0 -0
  37. data/locale/ko/katello.po.time_stamp +0 -0
  38. data/locale/ml_IN/katello.po.time_stamp +0 -0
  39. data/locale/mr/katello.po.time_stamp +0 -0
  40. data/locale/nl_NL/katello.po.time_stamp +0 -0
  41. data/locale/or/katello.po.time_stamp +0 -0
  42. data/locale/pa/katello.po.time_stamp +0 -0
  43. data/locale/pl/katello.po.time_stamp +0 -0
  44. data/locale/pl_PL/katello.po.time_stamp +0 -0
  45. data/locale/pt/katello.po.time_stamp +0 -0
  46. data/locale/pt_BR/katello.po.time_stamp +0 -0
  47. data/locale/ro/katello.po.time_stamp +0 -0
  48. data/locale/ro_RO/katello.po.time_stamp +0 -0
  49. data/locale/ru/katello.po.time_stamp +0 -0
  50. data/locale/sl/katello.po.time_stamp +0 -0
  51. data/locale/sv_SE/katello.po.time_stamp +0 -0
  52. data/locale/ta/katello.po.time_stamp +0 -0
  53. data/locale/ta_IN/katello.po.time_stamp +0 -0
  54. data/locale/te/katello.po.time_stamp +0 -0
  55. data/locale/tr/katello.po.time_stamp +0 -0
  56. data/locale/vi/katello.po.time_stamp +0 -0
  57. data/locale/vi_VN/katello.po.time_stamp +0 -0
  58. data/locale/zh/katello.po.time_stamp +0 -0
  59. data/locale/zh_CN/katello.po.time_stamp +0 -0
  60. data/locale/zh_TW/katello.po.time_stamp +0 -0
  61. data/package.json +1 -1
  62. data/webpack/components/Content/Details/ContentDetails.js +3 -3
  63. data/webpack/components/Content/Details/__tests__/__snapshots__/ContentDetails.test.js.snap +0 -4
  64. data/webpack/components/SelectOrg/SetOrganization.js +0 -1
  65. data/webpack/components/TooltipButton/TooltipButton.js +2 -2
  66. data/webpack/components/TooltipButton/__snapshots__/TooltipButton.test.js.snap +0 -3
  67. data/webpack/components/pf3Table/components/Table.js +0 -1
  68. data/webpack/scenes/ContentViews/Details/Repositories/RepoIcon.js +1 -1
  69. data/webpack/scenes/RedHatRepositories/__tests__/__snapshots__/RedHatRepositoriesPage.test.js.snap +0 -1
  70. data/webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js +0 -1
  71. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepositories.js +1 -1
  72. data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/RecommendedRepositorySetsToggler.test.js.snap +0 -1
  73. data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/RepositorySetRepositories.test.js.snap +0 -1
  74. data/webpack/scenes/RedHatRepositories/helpers.js +0 -2
  75. data/webpack/scenes/SmartProxy/AdditionalCapsuleContent.js +17 -9
  76. data/webpack/scenes/SmartProxy/ExpandedSmartProxyRepositories.js +3 -3
  77. data/webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.fixtures.json +7 -7
  78. data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +4 -4
  79. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +0 -4
  80. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +4 -8
  81. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +1 -1
  82. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +1 -2
  83. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +0 -2
  84. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +0 -1
  85. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +2 -5
  86. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +0 -10
  87. metadata +53 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff2ec07cb634ffb6ddacf126df2d61f0db72a530b1cc8fae166fda6a3cfe68de
4
- data.tar.gz: e29532e23032690a5a310f52d25065049292bded4221fc469aafae208e114c05
3
+ metadata.gz: 338456e8404dcc70c487c85c1d1ce10a52faf40c5ba3d19b6969250ec977cd93
4
+ data.tar.gz: eb9e87fddfde9dbe5c5cf8c094b2fad23d2128e96b360d2b2de0ee7a6e00e8c4
5
5
  SHA512:
6
- metadata.gz: 1c7f69a4d82aa99c9c79b7d91cb78be4979edd6db9739b71ea7791b0988d34eb70f3aa3e641d34dae6d1432f14d824005b201bab392ee3ba60ebcf54fe333eac
7
- data.tar.gz: d00aa557dbf348d30f1ee18e393f57029fd832901acdddad48af2db0d444413f9b3b361be66f2c2cd07b83ed41d8b7bbfffd895b077364ee7ed632b6bfb15cc7
6
+ metadata.gz: 73da7aa80f8aca8c4ffb4461d43d555418b13a1cbb4deddc13a3dda620a5572ae31049d890e03d9743b3854d0dc3027de8ac0933956c02250a80c679eb07a980
7
+ data.tar.gz: bbd2fa44e5938e913d958f89190d6091ae6d00a1a156f553ce1c5ddbd243f20872f48c340fb0eb9eca0c6d5e0f0b23820d9bc750dd0de6b3571b0578b716b1d7
@@ -276,7 +276,7 @@ module Katello
276
276
  end
277
277
 
278
278
  def get_content_source_id(hostname)
279
- proxies = SmartProxy.authorized.filter do |sp|
279
+ proxies = SmartProxy.unscoped.authorized.filter do |sp|
280
280
  hostname == URI.parse(sp.url).hostname
281
281
  end
282
282
  return nil if proxies.length != 1
@@ -474,7 +474,20 @@ module Katello
474
474
  def update_host_registered_through(host, headers)
475
475
  parent_host = get_parent_host(headers)
476
476
  host.subscription_facet.update_attribute(:registered_through, parent_host)
477
- content_source_id = get_content_source_id(parent_host)
477
+ set_host_content_source(host, parent_host)
478
+ end
479
+
480
+ def registering_thru_load_balancer?(hostname)
481
+ ::SmartProxy.behind_load_balancer(hostname).present?
482
+ end
483
+
484
+ def set_host_content_source(host, content_source_hostname)
485
+ content_source_id = get_content_source_id(content_source_hostname)
486
+ if registering_thru_load_balancer?(content_source_hostname)
487
+ Rails.logger.info "Host %s registered through load balancer %s" % [host.name, content_source_hostname]
488
+ content_source_id = ::SmartProxy.behind_load_balancer(content_source_hostname)&.first&.id
489
+ end
490
+ Rails.logger.warn "Host %s registered through unknown proxy %s" % [host.name, content_source_hostname] if content_source_id.nil?
478
491
  host.content_facet.update_attribute(:content_source_id, content_source_id)
479
492
  end
480
493
 
@@ -10,7 +10,7 @@ module Katello
10
10
  api :GET, "/organizations/:organization_id/simple_content_access/eligible",
11
11
  N_("Check if the specified organization is eligible for Simple Content Access. %s") % sca_only_deprecation_text, deprecated: true
12
12
  def eligible
13
- ::Foreman::Deprecation.api_deprecation_warning("This endpoint is deprecated and will be removed in Katello 4.12. All organizations are now eligible for Simple Content Access.")
13
+ ::Foreman::Deprecation.api_deprecation_warning(N_("This endpoint is deprecated and will be removed in Katello 4.12. All organizations are now eligible for Simple Content Access."))
14
14
  eligible = @organization.simple_content_access_eligible?
15
15
  render json: { simple_content_access_eligible: eligible }
16
16
  end
@@ -25,7 +25,7 @@ module Katello
25
25
  begin
26
26
  @taxonomy = Organization.new(resource_params)
27
27
  sca = ::Foreman::Cast.to_bool(params[:simple_content_access])
28
- ::Foreman::Deprecation.api_deprecation_warning("Simple Content Access will be required for all organizations in Katello 4.12.")
28
+ ::Foreman::Deprecation.api_deprecation_warning(N_("Simple Content Access will be required for all organizations in Katello 4.12."))
29
29
  ::Katello::OrganizationCreator.new(@taxonomy, sca: sca).create!
30
30
  @taxonomy.reload
31
31
  switch_taxonomy
@@ -0,0 +1,34 @@
1
+ module Katello
2
+ module Util
3
+ class CVECFMigrator # used in db/migrate/20220929204746_add_content_view_environment_content_facet.rb
4
+ def execute!
5
+ hosts_with_no_cve = []
6
+ hosts_with_missing_cve = []
7
+
8
+ ::Host::Managed.all.each do |host|
9
+ next if host.content_facet.blank?
10
+ if ::Katello::ContentView.exists?(id: host.content_facet.content_view_id) && ::Katello::KTEnvironment.exists?(host.content_facet.lifecycle_environment_id)
11
+ cve = ::Katello::ContentViewEnvironment.find_by(content_view_id: host.content_facet.content_view_id, environment_id: host.content_facet.lifecycle_environment_id)
12
+ if cve.blank?
13
+ hosts_with_no_cve << host
14
+ end
15
+ else
16
+ hosts_with_missing_cve << host
17
+ end
18
+ end
19
+
20
+ if hosts_with_missing_cve.present? || hosts_with_no_cve.present?
21
+ Rails.logger.warn "Found #{hosts_with_no_cve.count} hosts whose lifecycle environment does not have a corresponding ContentViewEnvironment"
22
+ Rails.logger.warn "Found #{hosts_with_missing_cve.count} hosts whose content facet is missing either content_view_id or lifecycle_environment_id"
23
+ Rails.logger.info "You may want to change the content view / lifecycle environment for these hosts manually."
24
+ end
25
+ (hosts_with_no_cve + hosts_with_missing_cve).each do |host|
26
+ default_content_view = host.organization.default_content_view
27
+ library = host.organization.library
28
+ Rails.logger.info "Updating host #{host.name} with default content_view_id and lifecycle_environment_id"
29
+ host.content_facet&.update_columns(content_view_id: default_content_view&.id, lifecycle_environment_id: library&.id)
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -91,12 +91,17 @@ module Katello
91
91
 
92
92
  def remote_execution_proxies(provider, *_rest)
93
93
  proxies = super
94
- if (name = subscription_facet&.registered_through)
95
- registered_through = SmartProxy.with_features(provider)
94
+ name = subscription_facet&.registered_through
95
+ result = []
96
+ if name.present?
97
+ result = SmartProxy.with_features(provider)
96
98
  .authorized
97
99
  .where(name: name)
100
+ if result.blank?
101
+ result = SmartProxy.authorized.behind_load_balancer(name)
102
+ end
98
103
  end
99
- proxies[:registered_through] = registered_through || []
104
+ proxies[:registered_through] = result
100
105
  proxies
101
106
  end
102
107
  end
@@ -193,7 +198,7 @@ module Katello
193
198
  property :content_views, 'ContentView', desc: 'Returns content views associated with the host'
194
199
  property :installed_packages, array_of: 'InstalledPackage', desc: 'Returns a list of packages installed on the host'
195
200
  end
196
- end
201
+ end # of included block
197
202
 
198
203
  def check_host_registration
199
204
  if subscription_facet
@@ -68,6 +68,18 @@ module Katello
68
68
  }
69
69
  scope :with_content, -> { with_features(PULP_FEATURE, PULP_NODE_FEATURE, PULP3_FEATURE) }
70
70
 
71
+ def self.load_balanced
72
+ proxies = unscoped.with_content # load balancing is only supported for pulp proxies
73
+ ids = proxies.select { |proxy| proxy.load_balanced? }.map(&:id)
74
+ proxies.where(id: ids)
75
+ end
76
+
77
+ def self.behind_load_balancer(load_balancer_hostname)
78
+ proxies = unscoped.with_content
79
+ ids = proxies.select { |proxy| proxy.load_balanced? && proxy.registration_host == load_balancer_hostname }.map(&:id)
80
+ proxies.where(id: ids)
81
+ end
82
+
71
83
  def self.with_repo(repo)
72
84
  joins(:capsule_lifecycle_environments).
73
85
  where("#{Katello::CapsuleLifecycleEnvironment.table_name}.lifecycle_environment_id" => repo.environment_id)
@@ -121,6 +133,15 @@ module Katello
121
133
  SmartProxy.joins(:smart_proxy_alternate_content_sources).where('katello_smart_proxy_alternate_content_sources.smart_proxy_id' => self.id)
122
134
  end
123
135
 
136
+ def registration_host
137
+ url = self.setting('Registration', 'registration_url').presence || self.url
138
+ URI.parse(url).host
139
+ end
140
+
141
+ def load_balanced?
142
+ URI.parse(self.url).host != self.registration_host
143
+ end
144
+
124
145
  def update_content_counts!
125
146
  # {:content_view_versions=>{87=>{:repositories=>{1=>{:metadata=>{},:counts=>{:rpms=>98, :module_streams=>9898}}}}}
126
147
  new_content_counts = { content_view_versions: {} }
@@ -50,7 +50,7 @@ module Katello
50
50
  cp_products = ::Katello::Resources::Candlepin::Product.all(org.label, [:id, :productContent])
51
51
  product_hash = cp_products.group_by { |prod| prod['id'] }
52
52
 
53
- prod_content_importer = Katello::ProductContentImporter.new(product_hash)
53
+ prod_content_importer = Katello::ProductContentImporter.new(cp_products)
54
54
  org.products.each do |product|
55
55
  product_json = product_hash[product.cp_id]&.first
56
56
 
@@ -21,46 +21,6 @@ module Katello
21
21
  # "enabled":false
22
22
  # }
23
23
  #
24
- #Example cp_products json structure (key:values where values are arrays and productContent is an array of contents inside value array)
25
- # {
26
- # "230"=>
27
- # [{"id"=>"230",
28
- # "productContent"=>
29
- # [{"content"=>
30
- # {"created"=>"2023-11-01T18:02:54+0000",
31
- # "updated"=>"2023-11-01T18:02:54+0000",
32
- # "uuid"=>"ff8080818b715841018b8c0d76d90190",
33
- # "id"=>"3996",
34
- # "type"=>"yum",
35
- # "label"=>"rhel-7-server-rt-htb-rpms",
36
- # "name"=>"Red Hat Enterprise Linux for Real Time HTB (RHEL 7 Server) (RPMs)",
37
- # "vendor"=>"Red Hat",
38
- # "contentUrl"=>"/content/htb/rhel/server/7/$basearch/rt/os",
39
- # "requiredTags"=>"rhel-7-server",
40
- # "releaseVer"=>nil,
41
- # "gpgUrl"=>"file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
42
- # "modifiedProductIds"=>[],
43
- # "arches"=>nil,
44
- # "metadataExpire"=>1},
45
- # "enabled"=>false},
46
- # {"content"=>
47
- # {"created"=>"2023-11-01T18:02:54+0000",
48
- # "updated"=>"2023-11-01T18:02:54+0000",
49
- # "uuid"=>"ff8080818b715841018b8c0d76d90181",
50
- # "id"=>"2165",
51
- # "type"=>"yum",
52
- # "label"=>"rhel-7-server-optional-htb-debug-rpms",
53
- # "name"=>"Red Hat Enterprise Linux 7 Server - Optional HTB (Debug RPMs)",
54
- # "vendor"=>"Red Hat",
55
- # "contentUrl"=>"/content/htb/rhel/server/7/$basearch/optional/debug",
56
- # "requiredTags"=>"rhel-7-server",
57
- # "releaseVer"=>nil,
58
- # "gpgUrl"=>"file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
59
- # "modifiedProductIds"=>[],
60
- # "arches"=>nil,
61
- # "metadataExpire"=>1},
62
- # "enabled"=>false}]}]
63
- # }
64
24
  attr_reader :content_url_updated
65
25
 
66
26
  def initialize(cp_products = [])
@@ -76,13 +36,13 @@ module Katello
76
36
  end
77
37
 
78
38
  def find_product_for_content(content_id)
79
- #Hash.find converts hash into enumerable iterating over each key,value pair which we can capture based on find result
80
- cp_product_id, __cp_product_value = @cp_products.find do |prod_json|
81
- prod_json&.last&.first&.[]('productContent')&.any? do |product_content_json|
82
- product_content_json["content"]["id"] == content_id
39
+ prod = @cp_products.find do |prod_json|
40
+ next if prod_json&.[]('productContent').blank?
41
+ prod_json['productContent'].any? do |product_content_json|
42
+ product_content_json&.dig("content", "id") == content_id
83
43
  end
84
44
  end
85
- ::Katello::Product.find_by(cp_id: cp_product_id)
45
+ ::Katello::Product.find_by(cp_id: prod["id"]) if prod
86
46
  end
87
47
 
88
48
  def fetch_product_contents_to_move(product, prod_contents_json)
@@ -8,12 +8,13 @@ class AddContentViewEnvironmentContentFacet < ActiveRecord::Migration[6.1]
8
8
  t.references :content_view_environment, :null => false, :index => false, :foreign_key => { :to_table => 'katello_content_view_environments' }
9
9
  t.references :content_facet, :null => false, :index => false, :foreign_key => { :to_table => 'katello_content_facets' }
10
10
  end
11
+ ::Katello::Util::CVECFMigrator.new.execute!
11
12
  FakeContentFacet.all.each do |content_facet|
12
13
  cve_id = ::Katello::KTEnvironment.find(content_facet.lifecycle_environment_id)
13
14
  .content_view_environments
14
15
  .find_by(content_view_id: content_facet.content_view_id)
15
- .id
16
- unless ::Katello::ContentViewEnvironmentContentFacet.create(
16
+ &.id
17
+ unless cve_id.present? && ::Katello::ContentViewEnvironmentContentFacet.create(
17
18
  content_facet_id: content_facet.id,
18
19
  content_view_environment_id: cve_id
19
20
  )
@@ -39,14 +40,46 @@ class AddContentViewEnvironmentContentFacet < ActiveRecord::Migration[6.1]
39
40
 
40
41
  ::Katello::ContentViewEnvironmentContentFacet.all.each do |cvecf|
41
42
  content_facet = cvecf.content_facet
42
- content_facet.content_view_id = cvecf.content_view_environment.content_view_id
43
- content_facet.lifecycle_environment_id = cvecf.content_view_environment.environment_id
43
+ cve = cvecf.content_view_environment
44
+ default_org = cve.environment&.organization
45
+ default_cv_id = default_org&.default_content_view&.id
46
+ default_lce_id = default_org&.library&.id
47
+ cv_id = cvecf.content_view_environment.content_view_id || default_cv_id
48
+ lce_id = cvecf.content_view_environment.environment_id || default_lce_id
49
+ say "Updating content_facet #{content_facet.id} with cv_id #{cv_id} and lce_id #{lce_id}"
50
+ content_facet.content_view_id = cv_id
51
+ content_facet.lifecycle_environment_id = lce_id
44
52
  content_facet.save(validate: false)
45
53
  end
46
54
 
55
+ ensure_no_null_cv_lce
47
56
  change_column :katello_content_facets, :content_view_id, :integer, :null => false
48
57
  change_column :katello_content_facets, :lifecycle_environment_id, :integer, :null => false
49
58
 
50
59
  drop_table :katello_content_view_environment_content_facets
51
60
  end
61
+
62
+ def ensure_no_null_cv_lce
63
+ # The following is to try to prevent PG::NotNullViolation: ERROR: column "content_view_id" contains null values
64
+ # since we add null constraints to the columns in the next step
65
+ content_facets_without_cv = ::Katello::Host::ContentFacet.where(content_view_id: nil)
66
+ if content_facets_without_cv.any?
67
+ say "Found #{content_facets_without_cv.count} content_facets with nil content_view_id"
68
+ content_facets_without_cv.each do |content_facet|
69
+ say "reassigning bad content_facet #{content_facet.id} to default content view"
70
+ content_facet.content_view_id = content_facet.host&.organization&.default_content_view&.id
71
+ content_facet.save(validate: false)
72
+ end
73
+ end
74
+
75
+ content_facets_without_lce = ::Katello::Host::ContentFacet.where(lifecycle_environment_id: nil)
76
+ if content_facets_without_lce.any?
77
+ say "Found #{content_facets_without_lce.count} content_facets with nil lifecycle_environment_id"
78
+ content_facets_without_lce.each do |content_facet|
79
+ say "reassigning bad content_facet #{content_facet.id} to default lifecycle environment"
80
+ content_facet.lifecycle_environment_id = content_facet.host&.organization&.library&.id
81
+ content_facet.save(validate: false)
82
+ end
83
+ end
84
+ end
52
85
  end
@@ -1,3 +1,3 @@
1
1
  module Katello
2
- VERSION = "4.11.0.rc1".freeze
2
+ VERSION = "4.11.0".freeze
3
3
  end
data/lib/katello.rb CHANGED
@@ -6,6 +6,7 @@ require "rabl"
6
6
  require "oauth"
7
7
  require "gettext_i18n_rails"
8
8
  require "foreman-tasks"
9
+ require "foreman_remote_execution"
9
10
  require "rest_client"
10
11
  require "anemone"
11
12
  require "securerandom"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/package.json CHANGED
@@ -31,7 +31,7 @@
31
31
  "@testing-library/user-event": "^13.5.0",
32
32
  "@theforeman/builder": ">= 6.0.0",
33
33
  "@theforeman/find-foreman": "^4.8.0",
34
- "@theforeman/eslint-plugin-rules": "^12.0.1",
34
+ "@theforeman/eslint-plugin-rules": "^12.2.0",
35
35
  "axios-mock-adapter": "^1.10.0",
36
36
  "eslint": "^6.2.2",
37
37
  "eslint-config-airbnb": "^16.0.0",
@@ -10,7 +10,7 @@ const ContentDetails = (props) => {
10
10
 
11
11
  const tabHeaders = () => {
12
12
  const tabs = schema.map(node => (
13
- <NavItem key={node.key} eventKey={node.key} ouiaId={`${node.key}-nav-item`}>
13
+ <NavItem key={node.key} eventKey={node.key}>
14
14
  <div>{node.tabHeader}</div>
15
15
  </NavItem>
16
16
  ));
@@ -40,12 +40,12 @@ const ContentDetails = (props) => {
40
40
  <Grid>
41
41
  <Row>
42
42
  <Col sm={12}>
43
- <Nav id="content-nav-container" bsClass="nav nav-tabs" ouiaId="content-details-nav">
43
+ <Nav id="content-nav-container" bsClass="nav nav-tabs">
44
44
  {schema && tabHeaders()}
45
45
  </Nav>
46
46
  </Col>
47
47
  </Row>
48
- <TabContent animation={false} ouiaId="content-details-tab-content">
48
+ <TabContent animation={false}>
49
49
  {schema && tabPanes()}
50
50
  </TabContent>
51
51
  </Grid>
@@ -35,7 +35,6 @@ exports[`Content Details Info should render and contain appropriate components 1
35
35
  bsClass="nav nav-tabs"
36
36
  id="content-nav-container"
37
37
  justified={false}
38
- ouiaId="content-details-nav"
39
38
  pullLeft={false}
40
39
  pullRight={false}
41
40
  stacked={false}
@@ -45,7 +44,6 @@ exports[`Content Details Info should render and contain appropriate components 1
45
44
  disabled={false}
46
45
  eventKey={1}
47
46
  key="1"
48
- ouiaId="1-nav-item"
49
47
  >
50
48
  <div>
51
49
  Details
@@ -56,7 +54,6 @@ exports[`Content Details Info should render and contain appropriate components 1
56
54
  disabled={false}
57
55
  eventKey={2}
58
56
  key="2"
59
- ouiaId="2-nav-item"
60
57
  >
61
58
  <div>
62
59
  Repositories
@@ -70,7 +67,6 @@ exports[`Content Details Info should render and contain appropriate components 1
70
67
  bsClass="tab"
71
68
  componentClass="div"
72
69
  mountOnEnter={false}
73
- ouiaId="content-details-tab-content"
74
70
  unmountOnExit={false}
75
71
  >
76
72
  <TabPane
@@ -74,7 +74,6 @@ class SetOrganization extends Component {
74
74
  <div className="col-sm-3">
75
75
  <a href={`/organizations/${id}/select`}>
76
76
  <Button
77
- ouiaId="select-org-button"
78
77
  disabled={this.state.disabled}
79
78
  className="btn btn-primary"
80
79
  onClick={this.onSend}
@@ -6,7 +6,7 @@ import './TooltipButton.scss';
6
6
  const TooltipButton = ({
7
7
  disabled, title, tooltipText, tooltipId, tooltipPlacement, renderedButton, ...props
8
8
  }) => {
9
- if (!disabled) return renderedButton || (<Button {...props} ouiaId="tooltip-button">{title}</Button>);
9
+ if (!disabled) return renderedButton || (<Button {...props}>{title}</Button>);
10
10
  return (
11
11
  <OverlayTrigger
12
12
  placement={tooltipPlacement}
@@ -14,7 +14,7 @@ const TooltipButton = ({
14
14
  overlay={<Tooltip id={tooltipId}>{tooltipText}</Tooltip>}
15
15
  >
16
16
  <div className="tooltip-button-helper">
17
- {renderedButton || (<Button {...props} disabled ouiaId="tooltip-disabled-button">{title}</Button>)}
17
+ {renderedButton || (<Button {...props} disabled>{title}</Button>)}
18
18
  </div>
19
19
  </OverlayTrigger>
20
20
  );
@@ -30,7 +30,6 @@ exports[`TooltipButton renders disabled TooltipButton 1`] = `
30
30
  bsClass="btn"
31
31
  bsStyle="default"
32
32
  disabled={true}
33
- ouiaId="tooltip-disabled-button"
34
33
  >
35
34
  some-title
36
35
  </Button>
@@ -74,7 +73,6 @@ exports[`TooltipButton renders enabled TooltipButton 1`] = `
74
73
  bsClass="btn"
75
74
  bsStyle="default"
76
75
  disabled={false}
77
- ouiaId="tooltip-button"
78
76
  >
79
77
  some-title
80
78
  </Button>
@@ -89,6 +87,5 @@ exports[`TooltipButton renders minimal TooltipButton 1`] = `
89
87
  bsClass="btn"
90
88
  bsStyle="default"
91
89
  disabled={false}
92
- ouiaId="tooltip-button"
93
90
  />
94
91
  `;
@@ -42,7 +42,6 @@ const Table = ({
42
42
  {body}
43
43
  </PfTable.PfProvider>
44
44
  {shouldRenderPagination && (
45
- // eslint-disable-next-line @theforeman/rules/require-ouiaid
46
45
  <Pagination
47
46
  itemCount={itemCount}
48
47
  onChange={onPaginationChange}
@@ -14,7 +14,7 @@ const RepoIcon = ({ type }) => {
14
14
  };
15
15
  const Icon = iconMap[type] || BoxIcon;
16
16
 
17
- return <Tooltip content={<div>{type}</div>}><Icon /></Tooltip>;
17
+ return <Tooltip content={<div>{type}</div>}><Icon aria-label={`${type}_type_icon`} /></Tooltip>;
18
18
  };
19
19
 
20
20
  RepoIcon.propTypes = {
@@ -119,7 +119,6 @@ exports[`RedHatRepositories page should render 1`] = `
119
119
  onChange={[Function]}
120
120
  onPerPageSelect={null}
121
121
  onSetPage={null}
122
- ouiaId="enabled-repos-pagination"
123
122
  page={1}
124
123
  perPage={null}
125
124
  updateParamsByUrl={true}
@@ -19,7 +19,6 @@ const RecommendedRepositorySetsToggler = ({
19
19
  return (
20
20
  <div className={classes} {...props}>
21
21
  <Switch
22
- ouiaId="enabled-repo-set-switch"
23
22
  bsSize="mini"
24
23
  value={enabled}
25
24
  onChange={() => onChange(!enabled)}
@@ -53,7 +53,7 @@ export class RepositorySetRepositories extends Component {
53
53
 
54
54
  if (data.error) {
55
55
  return (
56
- <Alert type="danger" ouiaId="repo-set-alert">
56
+ <Alert type="danger">
57
57
  <span>{data.error.displayMessage}</span>
58
58
  </Alert>
59
59
  );
@@ -19,7 +19,6 @@ exports[`RecommendedRepositorySetsToggler rendering renders recommended-reposito
19
19
  onChange={[Function]}
20
20
  onColor="primary"
21
21
  onText="ON"
22
- ouiaId="enabled-repo-set-switch"
23
22
  readonly={false}
24
23
  tristate={false}
25
24
  value={true}
@@ -18,7 +18,6 @@ exports[`RepositorySetRepositories Component should render with error 1`] = `
18
18
  <Alert
19
19
  className=""
20
20
  onDismiss={null}
21
- ouiaId="repo-set-alert"
22
21
  type="danger"
23
22
  >
24
23
  <span>