foreman_rh_cloud 4.0.25.1 → 4.0.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/api/v2/rh_cloud/inventory_controller.rb +4 -1
  3. data/app/controllers/insights_cloud/api/machine_telemetries_controller.rb +8 -0
  4. data/app/services/foreman_rh_cloud/cloud_request_forwarder.rb +14 -2
  5. data/config/Gemfile.lock.gh_test +169 -152
  6. data/config/database.yml.example +2 -2
  7. data/config/package-lock.json +41822 -0
  8. data/config/routes.rb +1 -1
  9. data/lib/foreman_inventory_upload/generators/queries.rb +1 -0
  10. data/lib/foreman_inventory_upload/generators/tags.rb +9 -3
  11. data/lib/foreman_rh_cloud/engine.rb +2 -0
  12. data/lib/foreman_rh_cloud/version.rb +1 -1
  13. data/lib/foreman_rh_cloud.rb +12 -1
  14. data/lib/insights_cloud/async/insights_client_status_aging.rb +4 -0
  15. data/lib/insights_cloud/async/insights_full_sync.rb +4 -0
  16. data/lib/insights_cloud/async/insights_generate_notifications.rb +4 -0
  17. data/lib/insights_cloud/async/insights_resolutions_sync.rb +7 -2
  18. data/lib/insights_cloud/async/insights_rules_sync.rb +10 -2
  19. data/lib/inventory_sync/async/host_result.rb +0 -5
  20. data/lib/inventory_sync/async/inventory_full_sync.rb +18 -9
  21. data/lib/inventory_sync/async/inventory_hosts_sync.rb +6 -6
  22. data/lib/inventory_sync/async/inventory_scheduled_sync.rb +4 -0
  23. data/lib/inventory_sync/async/inventory_self_host_sync.rb +4 -0
  24. data/lib/inventory_sync/async/query_inventory_job.rb +4 -0
  25. data/package.json +2 -2
  26. data/test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb +16 -39
  27. data/test/factories/inventory_upload_factories.rb +14 -0
  28. data/test/jobs/insights_resolutions_sync_test.rb +10 -1
  29. data/test/jobs/inventory_full_sync_test.rb +28 -2
  30. data/test/jobs/inventory_hosts_sync_test.rb +15 -0
  31. data/test/unit/foreman_rh_cloud_self_host_test.rb +28 -0
  32. data/test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb +26 -0
  33. data/test/unit/slice_generator_test.rb +36 -4
  34. data/test/unit/tags_generator_test.rb +31 -16
  35. data/webpack/InsightsCloudSync/Components/InsightsHeader/index.js +0 -2
  36. data/webpack/InsightsCloudSync/Components/InsightsSettings/insightsSettings.scss +1 -0
  37. data/webpack/InsightsCloudSync/Components/__tests__/__snapshots__/InsightsHeader.test.js.snap +0 -1
  38. data/webpack/InsightsCloudSync/InsightsCloudSync.js +2 -0
  39. data/webpack/InsightsCloudSync/__snapshots__/InsightsCloudSync.test.js.snap +1 -0
  40. data/webpack/common/Switcher/HelpLabel.js +1 -1
  41. data/webpack/common/Switcher/__tests__/__snapshots__/HelpLabel.test.js.snap +1 -1
  42. metadata +6 -3
@@ -65,14 +65,14 @@ class TagsGeneratorTest < ActiveSupport::TestCase
65
65
  test 'generates parameter tags' do
66
66
  FactoryBot.create(:setting, :name => 'include_parameter_tags', :settings_type => "boolean", :category => "Setting::RhCloud", :default => false, :value => true)
67
67
 
68
- @host.stubs(:host_inherited_params_objects).returns(
69
- [
70
- OpenStruct.new(name: 'bool_param', value: true),
71
- OpenStruct.new(name: 'false_param', value: false),
72
- OpenStruct.new(name: 'int_param', value: 1),
73
- OpenStruct.new(name: 'empty_param', value: nil),
74
- OpenStruct.new(name: 'empty_str_param', value: ''),
75
- ]
68
+ @host.stubs(:host_params).returns(
69
+ {
70
+ 'bool_param' => true,
71
+ 'false_param' => false,
72
+ 'int_param' => 1,
73
+ 'empty_param' => nil,
74
+ 'empty_str_param' => '',
75
+ }
76
76
  )
77
77
 
78
78
  generator = create_generator
@@ -87,14 +87,14 @@ class TagsGeneratorTest < ActiveSupport::TestCase
87
87
  test 'skips parameter tags if include_parameter_tags setting is off' do
88
88
  FactoryBot.create(:setting, :name => 'include_parameter_tags', :settings_type => "boolean", :category => "Setting::RhCloud", :default => false, :value => false)
89
89
 
90
- @host.stubs(:host_inherited_params_objects).returns(
91
- [
92
- OpenStruct.new(name: 'bool_param', value: true),
93
- OpenStruct.new(name: 'false_param', value: false),
94
- OpenStruct.new(name: 'int_param', value: 1),
95
- OpenStruct.new(name: 'empty_param', value: nil),
96
- OpenStruct.new(name: 'empty_str_param', value: ''),
97
- ]
90
+ @host.stubs(:host_params).returns(
91
+ {
92
+ 'bool_param' => true,
93
+ 'false_param' => false,
94
+ 'int_param' => 1,
95
+ 'empty_param' => nil,
96
+ 'empty_str_param' => '',
97
+ }
98
98
  )
99
99
 
100
100
  generator = create_generator
@@ -103,6 +103,21 @@ class TagsGeneratorTest < ActiveSupport::TestCase
103
103
  assert_equal 0, actual.count
104
104
  end
105
105
 
106
+ test 'truncates parameter tags' do
107
+ Setting[:include_parameter_tags] = true
108
+
109
+ @host.stubs(:host_params).returns(
110
+ {
111
+ 'str_param' => 'a' * 251,
112
+ }
113
+ )
114
+
115
+ generator = create_generator
116
+ actual = Hash[generator.generate_parameters]
117
+
118
+ assert_equal 'Original value exceeds 250 characters', actual['str_param']
119
+ end
120
+
106
121
  private
107
122
 
108
123
  def create_generator
@@ -1,12 +1,10 @@
1
1
  import React from 'react';
2
2
  import { Text, TextVariants } from '@patternfly/react-core';
3
3
  import { translate as __ } from 'foremanReact/common/I18n';
4
- import InsightsSettings from '../InsightsSettings';
5
4
  import './InsightsHeader.scss';
6
5
 
7
6
  const InsightsHeader = () => (
8
7
  <div className="insights-header">
9
- <InsightsSettings />
10
8
  <Text component={TextVariants.p}>
11
9
  {__(
12
10
  'Insights synchronization process is used to provide Insights recommendations output for hosts managed here.'
@@ -1,3 +1,4 @@
1
1
  .insights_settings {
2
2
  float: right;
3
+ margin-top: 22px;
3
4
  }
@@ -4,7 +4,6 @@ exports[`InsightsHeader render 1`] = `
4
4
  <div
5
5
  className="insights-header"
6
6
  >
7
- <Connect(InsightsSettings) />
8
7
  <Text
9
8
  component="p"
10
9
  >
@@ -12,6 +12,7 @@ import {
12
12
  import './InsightsCloudSync.scss';
13
13
  import Pagination from './Components/InsightsTable/Pagination';
14
14
  import ToolbarDropdown from './Components/ToolbarDropdown';
15
+ import InsightsSettings from './Components/InsightsSettings';
15
16
 
16
17
  const InsightsCloudSync = ({
17
18
  syncInsights,
@@ -42,6 +43,7 @@ const InsightsCloudSync = ({
42
43
 
43
44
  return (
44
45
  <div className="rh-cloud-insights">
46
+ <InsightsSettings />
45
47
  <PageLayout
46
48
  searchable
47
49
  searchProps={INSIGHTS_SEARCH_PROPS}
@@ -4,6 +4,7 @@ exports[`InsightsCloudSync render 1`] = `
4
4
  <div
5
5
  className="rh-cloud-insights"
6
6
  >
7
+ <Connect(InsightsSettings) />
7
8
  <PageLayout
8
9
  beforeToolbarComponent={<InsightsHeader />}
9
10
  header="Red Hat Insights"
@@ -11,7 +11,7 @@ export const HelpLabel = ({ text, id, className }) => {
11
11
  onClick={e => e.preventDefault()}
12
12
  className={`pf-c-form__group-label-help ${className}`}
13
13
  >
14
- <HelpIcon noVerticalAlign />
14
+ <HelpIcon />
15
15
  </button>
16
16
  </Popover>
17
17
  );
@@ -12,7 +12,7 @@ exports[`InsightsCloudSync helpers should return insights cloud Url 1`] = `
12
12
  >
13
13
  <HelpIcon
14
14
  color="currentColor"
15
- noVerticalAlign={true}
15
+ noVerticalAlign={false}
16
16
  size="sm"
17
17
  />
18
18
  </button>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.25.1
4
+ version: 4.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-05 00:00:00.000000000 Z
11
+ date: 2022-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: katello
@@ -174,6 +174,7 @@ files:
174
174
  - app/views/layouts/foreman_rh_cloud/application.html.erb
175
175
  - config/Gemfile.lock.gh_test
176
176
  - config/database.yml.example
177
+ - config/package-lock.json
177
178
  - config/package-lock.json.gh_test
178
179
  - config/package-lock.json.plugin
179
180
  - config/rh_cert-api_chain.pem
@@ -255,6 +256,7 @@ files:
255
256
  - test/test_plugin_helper.rb
256
257
  - test/unit/archived_report_generator_test.rb
257
258
  - test/unit/fact_helpers_test.rb
259
+ - test/unit/foreman_rh_cloud_self_host_test.rb
258
260
  - test/unit/insights_facet_test.rb
259
261
  - test/unit/metadata_generator_test.rb
260
262
  - test/unit/rh_cloud_http_proxy_test.rb
@@ -657,7 +659,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
657
659
  - !ruby/object:Gem::Version
658
660
  version: '0'
659
661
  requirements: []
660
- rubygems_version: 3.2.15
662
+ rubygems_version: 3.2.22
661
663
  signing_key:
662
664
  specification_version: 4
663
665
  summary: Summary of ForemanRhCloud.
@@ -685,6 +687,7 @@ test_files:
685
687
  - test/test_plugin_helper.rb
686
688
  - test/unit/archived_report_generator_test.rb
687
689
  - test/unit/fact_helpers_test.rb
690
+ - test/unit/foreman_rh_cloud_self_host_test.rb
688
691
  - test/unit/insights_facet_test.rb
689
692
  - test/unit/metadata_generator_test.rb
690
693
  - test/unit/rh_cloud_http_proxy_test.rb