foreman_rh_cloud 11.2.0 → 11.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/foreman_rh_cloud/locale/fr/foreman_rh_cloud.js +50 -50
  3. data/app/assets/javascripts/foreman_rh_cloud/locale/ja/foreman_rh_cloud.js +52 -52
  4. data/app/assets/javascripts/foreman_rh_cloud/locale/ko/foreman_rh_cloud.js +50 -50
  5. data/app/assets/javascripts/foreman_rh_cloud/locale/zh_CN/foreman_rh_cloud.js +50 -50
  6. data/app/controllers/insights_cloud/api/machine_telemetries_controller.rb +2 -0
  7. data/app/services/foreman_rh_cloud/cloud_request_forwarder.rb +1 -1
  8. data/lib/foreman_rh_cloud/engine.rb +1 -1
  9. data/lib/foreman_rh_cloud/version.rb +1 -1
  10. data/lib/insights_cloud/async/insights_full_sync.rb +14 -9
  11. data/lib/insights_cloud/async/insights_resolutions_sync.rb +5 -1
  12. data/locale/foreman_rh_cloud.pot +2 -2
  13. data/locale/fr/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  14. data/locale/fr/foreman_rh_cloud.po +53 -53
  15. data/locale/ja/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  16. data/locale/ja/foreman_rh_cloud.po +54 -53
  17. data/locale/ka/foreman_rh_cloud.po +1 -0
  18. data/locale/ko/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  19. data/locale/ko/foreman_rh_cloud.po +53 -52
  20. data/locale/zh_CN/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  21. data/locale/zh_CN/foreman_rh_cloud.po +53 -52
  22. data/package.json +1 -1
  23. data/test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb +13 -0
  24. data/test/jobs/insights_full_sync_test.rb +28 -0
  25. data/test/jobs/insights_resolutions_sync_test.rb +22 -0
  26. metadata +2 -5
  27. data/app/assets/javascripts/foreman_rh_cloud/locale/en/foreman_rh_cloud.js +0 -589
  28. data/locale/en/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  29. data/locale/en/foreman_rh_cloud.po +0 -585
@@ -65,6 +65,8 @@ class InsightsFullSyncTest < ActiveSupport::TestCase
65
65
  end
66
66
 
67
67
  test 'Hits data is replaced with data from cloud' do
68
+ Organization.any_instance.stubs(:manifest_expired?).returns(false)
69
+ Katello::UpstreamConnectionChecker.any_instance.stubs(:can_connect?).returns(true)
68
70
  InsightsCloud::Async::InsightsFullSync.any_instance.expects(:query_insights_hits).returns(@hits)
69
71
 
70
72
  InsightsCloud::Async::InsightsFullSync.any_instance.expects(:plan_hosts_sync)
@@ -79,7 +81,31 @@ class InsightsFullSyncTest < ActiveSupport::TestCase
79
81
  assert_equal 1, @host2.insights.hits.count
80
82
  end
81
83
 
84
+ test 'Manifest is expired do not run task steps' do
85
+ Organization.any_instance.stubs(:manifest_expired?).returns(true)
86
+ Katello::UpstreamConnectionChecker.any_instance.stubs(:can_connect?).returns(true)
87
+
88
+ InsightsCloud::Async::InsightsFullSync.any_instance.expects(:query_insights_hits).never
89
+ InsightsCloud::Async::InsightsFullSync.any_instance.expects(:plan_hosts_sync).never
90
+ InsightsCloud::Async::InsightsFullSync.any_instance.expects(:plan_self).never
91
+
92
+ ForemanTasks.sync_task(InsightsCloud::Async::InsightsFullSync, [@host1.organization])
93
+ end
94
+
95
+ test 'Manifest is deleted do not run task steps' do
96
+ Organization.any_instance.stubs(:manifest_expired?).returns(false)
97
+ Katello::UpstreamConnectionChecker.any_instance.stubs(:can_connect?).returns(false)
98
+
99
+ InsightsCloud::Async::InsightsFullSync.any_instance.expects(:query_insights_hits).never
100
+ InsightsCloud::Async::InsightsFullSync.any_instance.expects(:plan_hosts_sync).never
101
+ InsightsCloud::Async::InsightsFullSync.any_instance.expects(:plan_self).never
102
+
103
+ ForemanTasks.sync_task(InsightsCloud::Async::InsightsFullSync, [@host1.organization])
104
+ end
105
+
82
106
  test 'Hits counters are reset correctly' do
107
+ Organization.any_instance.stubs(:manifest_expired?).returns(false)
108
+ Katello::UpstreamConnectionChecker.any_instance.stubs(:can_connect?).returns(true)
83
109
  InsightsCloud::Async::InsightsFullSync.any_instance.expects(:query_insights_hits).returns(@hits).twice
84
110
 
85
111
  InsightsCloud::Async::InsightsFullSync.any_instance.stubs(:plan_hosts_sync)
@@ -97,6 +123,8 @@ class InsightsFullSyncTest < ActiveSupport::TestCase
97
123
  end
98
124
 
99
125
  test 'Hits ignoring non-existent hosts' do
126
+ Organization.any_instance.stubs(:manifest_expired?).returns(false)
127
+ Katello::UpstreamConnectionChecker.any_instance.stubs(:can_connect?).returns(true)
100
128
  hits_json = <<-HITS_JSON
101
129
  [
102
130
  {
@@ -73,6 +73,7 @@ class InsightsResolutionsSyncTest < ActiveSupport::TestCase
73
73
  end
74
74
 
75
75
  test 'Resolutions data is replaced with data from cloud' do
76
+ Katello::UpstreamConnectionChecker.any_instance.stubs(:can_connect?).returns(true)
76
77
  InsightsCloud::Async::InsightsResolutionsSync.any_instance.stubs(:query_insights_resolutions).returns(@resolutions)
77
78
 
78
79
  ForemanTasks.sync_task(InsightsCloud::Async::InsightsResolutionsSync)
@@ -82,7 +83,28 @@ class InsightsResolutionsSyncTest < ActiveSupport::TestCase
82
83
  assert_equal 2, @rule.resolutions.count
83
84
  end
84
85
 
86
+ test 'Manifest is deleted do not run task steps' do
87
+ Organization.any_instance.stubs(:manifest_expired?).returns(false)
88
+ Katello::UpstreamConnectionChecker.any_instance.stubs(:can_connect?).returns(false)
89
+ InsightsCloud::Async::InsightsResolutionsSync.any_instance.expects(:query_insights_resolutions).never
90
+
91
+ ForemanTasks.sync_task(InsightsCloud::Async::InsightsResolutionsSync)
92
+
93
+ assert_equal 0, InsightsResolution.all.count
94
+ end
95
+
96
+ test 'Manifest is expired do not run task steps' do
97
+ Organization.any_instance.stubs(:manifest_expired?).returns(true)
98
+ Katello::UpstreamConnectionChecker.any_instance.stubs(:can_connect?).returns(true)
99
+ InsightsCloud::Async::InsightsResolutionsSync.any_instance.expects(:query_insights_resolutions).never
100
+
101
+ ForemanTasks.sync_task(InsightsCloud::Async::InsightsResolutionsSync)
102
+
103
+ assert_equal 0, InsightsResolution.all.count
104
+ end
105
+
85
106
  test 'Skips pinging the cloud if no rule ids were found' do
107
+ Katello::UpstreamConnectionChecker.any_instance.stubs(:can_connect?).returns(true)
86
108
  InsightsCloud::Async::InsightsResolutionsSync.any_instance.expects(:query_insights_resolutions).never
87
109
  InsightsRule.all.delete_all
88
110
 
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: 11.2.0
4
+ version: 11.3.0
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: 2025-03-10 00:00:00.000000000 Z
11
+ date: 2025-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman_ansible
@@ -90,7 +90,6 @@ files:
90
90
  - LICENSE
91
91
  - README.md
92
92
  - Rakefile
93
- - app/assets/javascripts/foreman_rh_cloud/locale/en/foreman_rh_cloud.js
94
93
  - app/assets/javascripts/foreman_rh_cloud/locale/fr/foreman_rh_cloud.js
95
94
  - app/assets/javascripts/foreman_rh_cloud/locale/ja/foreman_rh_cloud.js
96
95
  - app/assets/javascripts/foreman_rh_cloud/locale/ka/foreman_rh_cloud.js
@@ -220,8 +219,6 @@ files:
220
219
  - lib/tasks/insights.rake
221
220
  - lib/tasks/rh_cloud_inventory.rake
222
221
  - locale/Makefile
223
- - locale/en/LC_MESSAGES/foreman_rh_cloud.mo
224
- - locale/en/foreman_rh_cloud.po
225
222
  - locale/foreman_rh_cloud.pot
226
223
  - locale/fr/LC_MESSAGES/foreman_rh_cloud.mo
227
224
  - locale/fr/foreman_rh_cloud.po
@@ -1,589 +0,0 @@
1
- locales['foreman_rh_cloud'] = locales['foreman_rh_cloud'] || {}; locales['foreman_rh_cloud']['en'] = {
2
- "domain": "foreman_rh_cloud",
3
- "locale_data": {
4
- "foreman_rh_cloud": {
5
- "": {
6
- "Project-Id-Version": "foreman_rh_cloud 1.0.0",
7
- "Report-Msgid-Bugs-To": "",
8
- "PO-Revision-Date": "2025-02-10 20:07+0100",
9
- "Last-Translator": "FULL NAME <EMAIL@ADDRESS>",
10
- "Language-Team": "LANGUAGE <LL@li.org>",
11
- "Language": "",
12
- "MIME-Version": "1.0",
13
- "Content-Type": "text/plain; charset=UTF-8",
14
- "Content-Transfer-Encoding": "8bit",
15
- "Plural-Forms": "nplurals=INTEGER; plural=EXPRESSION;",
16
- "lang": "en",
17
- "domain": "foreman_rh_cloud",
18
- "plural_forms": "nplurals=INTEGER; plural=EXPRESSION;"
19
- },
20
- " Sync all inventory status": [
21
- ""
22
- ],
23
- "%s organizations": [
24
- ""
25
- ],
26
- "About subscription watch": [
27
- ""
28
- ],
29
- "Actions history": [
30
- ""
31
- ],
32
- "Advanced Inventory Settings": [
33
- ""
34
- ],
35
- "All recommendations are now selected.": [
36
- ""
37
- ],
38
- "Any Organization": [
39
- ""
40
- ],
41
- "Apply Insights recommendations": [
42
- ""
43
- ],
44
- "Automatic inventory upload": [
45
- ""
46
- ],
47
- "Automatic mismatch deletion": [
48
- ""
49
- ],
50
- "Cancel": [
51
- ""
52
- ],
53
- "Clear": [
54
- ""
55
- ],
56
- "Clear Selection": [
57
- ""
58
- ],
59
- "Cloud Connector has been configured however obfuscating host names setting is enabled, it's recommended to disable it": [
60
- ""
61
- ],
62
- "Cloud Connector has been configured however the inventory auto-upload is disabled, it's recommended to enable it": [
63
- ""
64
- ],
65
- "Cloud Connector is in progress": [
66
- ""
67
- ],
68
- "Cloud connector job link": [
69
- ""
70
- ],
71
- "Cloud connector setup has failed: ": [
72
- ""
73
- ],
74
- "Cloud connector setup has started: ": [
75
- ""
76
- ],
77
- "Cloud connector setup is in progress now: ": [
78
- ""
79
- ],
80
- "Completed": [
81
- ""
82
- ],
83
- "Configure": [
84
- ""
85
- ],
86
- "Configure Cloud Connector on given hosts": [
87
- ""
88
- ],
89
- "Configure cloud connector": [
90
- ""
91
- ],
92
- "Connectivity test": [
93
- ""
94
- ],
95
- "Critical": [
96
- ""
97
- ],
98
- "Current page": [
99
- ""
100
- ],
101
- "Disconnected hosts: ": [
102
- ""
103
- ],
104
- "Displays manifest statuses per accessible organizations.": [
105
- ""
106
- ],
107
- "Documentation": [
108
- ""
109
- ],
110
- "Download Report": [
111
- ""
112
- ],
113
- "Download latest report": [
114
- ""
115
- ],
116
- "Enable automatic deletion of mismatched host records from the Red Hat cloud": [
117
- ""
118
- ],
119
- "Enable automatic synchronization of Insights recommendations from the Red Hat cloud": [
120
- ""
121
- ],
122
- "Enable automatic upload of your host inventory to the Red Hat cloud": [
123
- ""
124
- ],
125
- "Enable automatic upload of your hosts inventory to the Red Hat cloud": [
126
- ""
127
- ],
128
- "Enable cloud connector": [
129
- ""
130
- ],
131
- "Enable inventory upload": [
132
- ""
133
- ],
134
- "Encountered an error while trying to access the server:": [
135
- ""
136
- ],
137
- "Exclude installed Packages": [
138
- ""
139
- ],
140
- "Exclude installed packages from being uploaded to the Red Hat cloud": [
141
- ""
142
- ],
143
- "Exclude packages": [
144
- ""
145
- ],
146
- "Exclude packages from being uploaded to the Red Hat cloud": [
147
- ""
148
- ],
149
- "Exit Code: %s": [
150
- ""
151
- ],
152
- "Fetch Insights-related host details": [
153
- ""
154
- ],
155
- "Fetching data about your accounts": [
156
- ""
157
- ],
158
- "Filter..": [
159
- ""
160
- ],
161
- "Fix host": [
162
- ""
163
- ],
164
- "For more info, please visit the": [
165
- ""
166
- ],
167
- "For more information about Insights and Cloud Connector, see:": [
168
- ""
169
- ],
170
- "For more information about the Subscriptions service, see:": [
171
- ""
172
- ],
173
- "Foreman plugin that process & upload data to Red Hat Cloud": [
174
- ""
175
- ],
176
- "Full Screen": [
177
- ""
178
- ],
179
- "Generate and upload report": [
180
- ""
181
- ],
182
- "Generate the report, but do not upload": [
183
- ""
184
- ],
185
- "Generating": [
186
- ""
187
- ],
188
- "Go to Foreman Insights page": [
189
- ""
190
- ],
191
- "Go to first page": [
192
- ""
193
- ],
194
- "Go to last page": [
195
- ""
196
- ],
197
- "Go to next page": [
198
- ""
199
- ],
200
- "Go to previous page": [
201
- ""
202
- ],
203
- "Grab hosts that are missing in RH Cloud": [
204
- ""
205
- ],
206
- "Host Insights recommendations": [
207
- ""
208
- ],
209
- "Host was not uploaded to your RH cloud inventory": [
210
- ""
211
- ],
212
- "Hostname": [
213
- ""
214
- ],
215
- "Hosts with subscription in organization: ": [
216
- ""
217
- ],
218
- "ID of the RHC(Yggdrasil) daemon": [
219
- ""
220
- ],
221
- "Important": [
222
- ""
223
- ],
224
- "Include parameters in insights-client reports": [
225
- ""
226
- ],
227
- "Insights": [
228
- ""
229
- ],
230
- "Inventory": [
231
- ""
232
- ],
233
- "Inventory Auto Upload": [
234
- ""
235
- ],
236
- "Inventory Upload": [
237
- ""
238
- ],
239
- "Inventory sync has failed: ": [
240
- ""
241
- ],
242
- "Inventory sync has started:": [
243
- ""
244
- ],
245
- "Items per page": [
246
- ""
247
- ],
248
- "Knowledgebase article": [
249
- ""
250
- ],
251
- "List of host UUIDs": [
252
- ""
253
- ],
254
- "Loading": [
255
- ""
256
- ],
257
- "Loading...": [
258
- ""
259
- ],
260
- "Low": [
261
- ""
262
- ],
263
- "Manual": [
264
- ""
265
- ],
266
- "Moderate": [
267
- ""
268
- ],
269
- "More details can be found in": [
270
- ""
271
- ],
272
- "Next run: ": [
273
- ""
274
- ],
275
- "No": [
276
- ""
277
- ],
278
- "No recommendations were found for this host!": [
279
- ""
280
- ],
281
- "No results found": [
282
- ""
283
- ],
284
- "No task was found": [
285
- ""
286
- ],
287
- "Not reporting": [
288
- ""
289
- ],
290
- "Nothing to sync, there are no hosts with subscription for this organization.": [
291
- ""
292
- ],
293
- "Notice": [
294
- ""
295
- ],
296
- "Obfuscate IPs": [
297
- ""
298
- ],
299
- "Obfuscate host ipv4 addresses": [
300
- ""
301
- ],
302
- "Obfuscate host names": [
303
- ""
304
- ],
305
- "Obfuscate host names sent to the Red Hat cloud": [
306
- ""
307
- ],
308
- "Obfuscate ipv4 addresses sent to the Red Hat cloud": [
309
- ""
310
- ],
311
- "Oops! Couldn't find organization that matches your query": [
312
- ""
313
- ],
314
- "Organization status": [
315
- ""
316
- ],
317
- "Pagination": [
318
- ""
319
- ],
320
- "Playbook": [
321
- ""
322
- ],
323
- "RH Cloud": [
324
- ""
325
- ],
326
- "RHC daemon id": [
327
- ""
328
- ],
329
- "RHCloud": [
330
- ""
331
- ],
332
- "Read more about it in RH cloud insights": [
333
- ""
334
- ],
335
- "Reboot Required": [
336
- ""
337
- ],
338
- "Recommendation": [
339
- ""
340
- ],
341
- "Recommendation sync has failed: ": [
342
- ""
343
- ],
344
- "Recommendation sync has started: ": [
345
- ""
346
- ],
347
- "Recommendations": [
348
- ""
349
- ],
350
- "Recommendations selected: %s.": [
351
- ""
352
- ],
353
- "Recommendations synced successfully": [
354
- ""
355
- ],
356
- "Reconfigure cloud connector": [
357
- ""
358
- ],
359
- "Red Hat Cloud Inventory": [
360
- ""
361
- ],
362
- "Red Hat Insights": [
363
- ""
364
- ],
365
- "Red Hat Insights Data and Application Security": [
366
- ""
367
- ],
368
- "Red Hat Inventory": [
369
- ""
370
- ],
371
- "Remain": [
372
- ""
373
- ],
374
- "Remediate": [
375
- ""
376
- ],
377
- "Remediation summary": [
378
- ""
379
- ],
380
- "Reporting": [
381
- ""
382
- ],
383
- "Resolution": [
384
- ""
385
- ],
386
- "Run RH Cloud playbook": [
387
- ""
388
- ],
389
- "Run playbook genrated by Red Hat remediations app": [
390
- ""
391
- ],
392
- "Run remediation playbook generated by Insights": [
393
- ""
394
- ],
395
- "Satellite server has %{hits_count} recommendations by Red Hat": [
396
- ""
397
- ],
398
- "Scoped search string for host removal": [
399
- ""
400
- ],
401
- "Select recommendations from all pages": [
402
- ""
403
- ],
404
- "Set the current organization context for the request": [
405
- ""
406
- ],
407
- "Settings": [
408
- ""
409
- ],
410
- "Should import include parameter tags from Foreman?": [
411
- ""
412
- ],
413
- "Show Advanced Settings": [
414
- ""
415
- ],
416
- "Show if system is configured to use local iop-advisor-engine.": [
417
- ""
418
- ],
419
- "Start inventory synchronization": [
420
- ""
421
- ],
422
- "Start report generation": [
423
- ""
424
- ],
425
- "Successfully synced hosts: ": [
426
- ""
427
- ],
428
- "Successfully uploaded to your RH cloud inventory": [
429
- ""
430
- ],
431
- "Sync automatically": [
432
- ""
433
- ],
434
- "Sync recommendations": [
435
- ""
436
- ],
437
- "Synchronize recommendations Automatically": [
438
- ""
439
- ],
440
- "The Foreman inventory upload plugin automatically uploads Foreman host inventory data to the Inventory service of Insights, where it can also be used by the Subscriptions service for subscription reporting. If you use the Subscriptions service, enabling inventory uploads is required.": [
441
- ""
442
- ],
443
- "The Red Hat Hybrid Cloud Console provides a set of cloud services, including Red Hat Insights and Subscriptions, that provide predictive analysis, remediation of issues, and unified subscription reporting for this Foreman instance.": [
444
- ""
445
- ],
446
- "The report file %{filename} doesn't exist": [
447
- ""
448
- ],
449
- "The scheduled process is disabled because this Foreman is configured with the use_local_advisor_engine option.": [
450
- ""
451
- ],
452
- "The server returned the following error: %s": [
453
- ""
454
- ],
455
- "The task failed with the following error:": [
456
- ""
457
- ],
458
- "There are no recommendations for your hosts": [
459
- ""
460
- ],
461
- "This action will also enable automatic reports upload": [
462
- ""
463
- ],
464
- "To enable this reporting for all Foreman organizations, set {uploadButtonName} to on. The data will be reported automatically once per day.": [
465
- ""
466
- ],
467
- "To manually upload the data for a specific organization, select an organization and click {restartButtonName}.": [
468
- ""
469
- ],
470
- "Total risk": [
471
- ""
472
- ],
473
- "Total risks": [
474
- ""
475
- ],
476
- "Upload hits from iop-advisor-engine": [
477
- ""
478
- ],
479
- "Upload hits information": [
480
- ""
481
- ],
482
- "Upload rules related to the hits": [
483
- ""
484
- ],
485
- "Uploading": [
486
- ""
487
- ],
488
- "Value %{value} is not a valid UUID": [
489
- ""
490
- ],
491
- "View all recommendations": [
492
- ""
493
- ],
494
- "View in Red Hat Insights": [
495
- ""
496
- ],
497
- "Wait and %s": [
498
- ""
499
- ],
500
- "Whether the resolution requires reboot": [
501
- ""
502
- ],
503
- "category name": [
504
- ""
505
- ],
506
- "generic": [
507
- ""
508
- ],
509
- "hosts page": [
510
- ""
511
- ],
512
- "impact name": [
513
- ""
514
- ],
515
- "iop payload including resolutions, rules, hits": [
516
- ""
517
- ],
518
- "items": [
519
- ""
520
- ],
521
- "likelihood number": [
522
- ""
523
- ],
524
- "more info": [
525
- ""
526
- ],
527
- "page": [
528
- ""
529
- ],
530
- "per page": [
531
- ""
532
- ],
533
- "publish date (YYYY-MM-DD)": [
534
- ""
535
- ],
536
- "rating": [
537
- ""
538
- ],
539
- "reason": [
540
- ""
541
- ],
542
- "reboot required": [
543
- ""
544
- ],
545
- "resolution description": [
546
- ""
547
- ],
548
- "resolution risk": [
549
- ""
550
- ],
551
- "result url": [
552
- ""
553
- ],
554
- "rule description": [
555
- ""
556
- ],
557
- "rule id": [
558
- ""
559
- ],
560
- "rule title": [
561
- ""
562
- ],
563
- "solution url": [
564
- ""
565
- ],
566
- "summary": [
567
- ""
568
- ],
569
- "total risk": [
570
- ""
571
- ],
572
- "type": [
573
- ""
574
- ],
575
- "upload hits details json": [
576
- ""
577
- ],
578
- "upload resolutions related to the hits": [
579
- ""
580
- ],
581
- "view the job in progress": [
582
- ""
583
- ],
584
- "view the task page for more details": [
585
- ""
586
- ]
587
- }
588
- }
589
- };