foreman_remote_execution 3.0.2 → 3.2.2

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 (112) hide show
  1. checksums.yaml +4 -4
  2. data/.hound.yml +2 -1
  3. data/.rubocop.yml +80 -50
  4. data/.rubocop_todo.yml +113 -73
  5. data/Gemfile +4 -0
  6. data/app/controllers/api/v2/foreign_input_sets_controller.rb +3 -2
  7. data/app/controllers/api/v2/job_invocations_controller.rb +12 -7
  8. data/app/controllers/api/v2/job_templates_controller.rb +3 -2
  9. data/app/controllers/api/v2/remote_execution_features_controller.rb +3 -2
  10. data/app/controllers/api/v2/template_invocations_controller.rb +5 -2
  11. data/app/controllers/cockpit_controller.rb +1 -0
  12. data/app/controllers/concerns/foreman/controller/parameters/foreign_input_set.rb +1 -1
  13. data/app/controllers/concerns/foreman/controller/parameters/job_template.rb +4 -4
  14. data/app/controllers/job_invocations_controller.rb +10 -6
  15. data/app/controllers/job_templates_controller.rb +1 -1
  16. data/app/controllers/remote_execution_features_controller.rb +3 -2
  17. data/app/helpers/concerns/foreman_remote_execution/hosts_helper_extensions.rb +16 -5
  18. data/app/helpers/job_invocations_chart_helper.rb +13 -10
  19. data/app/helpers/job_invocations_helper.rb +19 -6
  20. data/app/helpers/remote_execution_helper.rb +49 -48
  21. data/app/lib/actions/remote_execution/run_host_job.rb +5 -6
  22. data/app/lib/actions/remote_execution/run_hosts_job.rb +2 -2
  23. data/app/lib/foreman_remote_execution/renderer/scope/input.rb +1 -0
  24. data/app/lib/proxy_api/remote_execution_ssh.rb +6 -0
  25. data/app/models/concerns/foreman_remote_execution/errors_flattener.rb +0 -2
  26. data/app/models/concerns/foreman_remote_execution/host_extensions.rb +4 -6
  27. data/app/models/concerns/foreman_remote_execution/nic_extensions.rb +1 -0
  28. data/app/models/concerns/foreman_remote_execution/orchestration/ssh.rb +63 -0
  29. data/app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb +5 -0
  30. data/app/models/foreign_input_set.rb +3 -2
  31. data/app/models/host_status/execution_status.rb +9 -1
  32. data/app/models/input_template_renderer.rb +1 -1
  33. data/app/models/job_invocation.rb +10 -12
  34. data/app/models/job_invocation_composer.rb +20 -14
  35. data/app/models/job_invocation_task_group.rb +1 -1
  36. data/app/models/job_template.rb +3 -3
  37. data/app/models/remote_execution_feature.rb +0 -2
  38. data/app/models/remote_execution_provider.rb +4 -2
  39. data/app/models/setting/remote_execution.rb +54 -56
  40. data/app/models/ssh_execution_provider.rb +2 -2
  41. data/app/models/targeting.rb +1 -0
  42. data/app/models/template_invocation.rb +2 -3
  43. data/app/views/api/v2/job_invocations/base.json.rabl +1 -1
  44. data/app/views/api/v2/job_invocations/main.json.rabl +7 -4
  45. data/app/views/job_invocations/_card_results.html.erb +1 -0
  46. data/app/views/job_invocations/_card_target_hosts.html.erb +12 -0
  47. data/app/views/job_invocations/_card_user_input.html.erb +1 -1
  48. data/app/views/job_invocations/_form.html.erb +3 -2
  49. data/app/views/job_invocations/_host_status_td.html.erb +1 -1
  50. data/app/views/job_invocations/_rerun_taxonomies.html.erb +22 -0
  51. data/app/views/job_invocations/_tab_overview.html.erb +1 -1
  52. data/app/views/job_invocations/_user_input.html.erb +1 -1
  53. data/app/views/job_invocations/show.html.erb +3 -1
  54. data/config/routes.rb +2 -1
  55. data/db/migrate/20151215114631_add_host_id_to_template_invocation.rb +1 -0
  56. data/db/migrate/20180110104432_rename_template_invocation_permission.rb +1 -0
  57. data/db/seeds.d/50-notification_blueprints.rb +4 -4
  58. data/db/seeds.d/90-bookmarks.rb +1 -0
  59. data/extra/cockpit/foreman-cockpit-session +7 -2
  60. data/foreman_remote_execution.gemspec +1 -1
  61. data/lib/foreman_remote_execution/engine.rb +20 -17
  62. data/lib/foreman_remote_execution/version.rb +1 -1
  63. data/locale/action_names.rb +4 -3
  64. data/locale/de/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  65. data/locale/de/foreman_remote_execution.po +65 -16
  66. data/locale/en/foreman_remote_execution.po +63 -15
  67. data/locale/en_GB/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  68. data/locale/en_GB/foreman_remote_execution.po +64 -15
  69. data/locale/es/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  70. data/locale/es/foreman_remote_execution.po +66 -17
  71. data/locale/foreman_remote_execution.pot +193 -148
  72. data/locale/fr/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  73. data/locale/fr/foreman_remote_execution.po +66 -17
  74. data/locale/ja/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  75. data/locale/ja/foreman_remote_execution.po +66 -17
  76. data/locale/ko/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  77. data/locale/ko/foreman_remote_execution.po +65 -15
  78. data/locale/pt_BR/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  79. data/locale/pt_BR/foreman_remote_execution.po +66 -17
  80. data/locale/ru/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  81. data/locale/ru/foreman_remote_execution.po +65 -18
  82. data/locale/zh_CN/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  83. data/locale/zh_CN/foreman_remote_execution.po +66 -17
  84. data/locale/zh_TW/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  85. data/locale/zh_TW/foreman_remote_execution.po +65 -16
  86. data/package.json +2 -3
  87. data/test/benchmark/run_hosts_job_benchmark.rb +1 -1
  88. data/test/factories/foreman_remote_execution_factories.rb +1 -1
  89. data/test/functional/api/v2/job_invocations_controller_test.rb +51 -23
  90. data/test/functional/api/v2/job_templates_controller_test.rb +1 -1
  91. data/test/functional/api/v2/remote_execution_features_controller_test.rb +2 -2
  92. data/test/functional/api/v2/template_invocations_controller_test.rb +4 -4
  93. data/test/functional/job_invocations_controller_test.rb +23 -11
  94. data/test/functional/job_templates_controller_test.rb +1 -1
  95. data/test/models/orchestration/ssh_test.rb +56 -0
  96. data/test/unit/actions/run_hosts_job_test.rb +8 -8
  97. data/test/unit/concerns/foreman_tasks_cleaner_extensions_test.rb +3 -3
  98. data/test/unit/concerns/host_extensions_test.rb +26 -19
  99. data/test/unit/concerns/nic_extensions_test.rb +1 -1
  100. data/test/unit/execution_task_status_mapper_test.rb +10 -10
  101. data/test/unit/input_template_renderer_test.rb +77 -77
  102. data/test/unit/job_invocation_composer_test.rb +100 -96
  103. data/test/unit/job_invocation_test.rb +29 -29
  104. data/test/unit/job_template_effective_user_test.rb +3 -3
  105. data/test/unit/job_template_test.rb +31 -31
  106. data/test/unit/remote_execution_feature_test.rb +19 -19
  107. data/test/unit/remote_execution_provider_test.rb +33 -30
  108. data/test/unit/renderer_scope_input.rb +6 -6
  109. data/test/unit/targeting_test.rb +6 -6
  110. data/test/unit/template_invocation_input_value_test.rb +3 -3
  111. data/webpack/index.js +0 -15
  112. metadata +8 -4
@@ -13,15 +13,15 @@ class RendererScopeInputTest < ActiveSupport::TestCase
13
13
  it 'caches the value under given key' do
14
14
  i = 1
15
15
  result = input.cached('some_key') { i }
16
- result.must_equal 1
16
+ _(result).must_equal 1
17
17
 
18
18
  i += 1
19
19
  result = input.cached('some_key') { i }
20
- result.must_equal 1
20
+ _(result).must_equal 1
21
21
 
22
22
  i += 1
23
23
  result = input.cached('different_key') { i }
24
- result.must_equal 3
24
+ _(result).must_equal 3
25
25
  end
26
26
  end
27
27
 
@@ -35,15 +35,15 @@ class RendererScopeInputTest < ActiveSupport::TestCase
35
35
  it 'does not cache the value' do
36
36
  i = 1
37
37
  result = input.cached('some_key') { i }
38
- result.must_equal 1
38
+ _(result).must_equal 1
39
39
 
40
40
  i += 1
41
41
  result = input.cached('some_key') { i }
42
- result.must_equal 2
42
+ _(result).must_equal 2
43
43
 
44
44
  i += 1
45
45
  result = input.cached('different_key') { i }
46
- result.must_equal 3
46
+ _(result).must_equal 3
47
47
  end
48
48
  end
49
49
  end
@@ -51,7 +51,7 @@ class TargetingTest < ActiveSupport::TestCase
51
51
  targeting.resolve_hosts!
52
52
  end
53
53
 
54
- it { targeting.hosts.must_include(host) }
54
+ it { _(targeting.hosts).must_include(host) }
55
55
  end
56
56
 
57
57
  context 'can delete a user' do
@@ -74,7 +74,7 @@ class TargetingTest < ActiveSupport::TestCase
74
74
  host.destroy
75
75
  end
76
76
 
77
- it { targeting.reload.hosts.must_be_empty }
77
+ it { _(targeting.reload.hosts).must_be_empty }
78
78
  end
79
79
 
80
80
  describe '#build_query_from_hosts(ids)' do
@@ -89,9 +89,9 @@ class TargetingTest < ActiveSupport::TestCase
89
89
  let(:query) { Targeting.build_query_from_hosts([ host.id, second_host.id ]) }
90
90
 
91
91
  it 'builds query using host names joining inside ^' do
92
- query.must_include host.name
93
- query.must_include second_host.name
94
- query.must_include 'name ^'
92
+ _(query).must_include host.name
93
+ _(query).must_include second_host.name
94
+ _(query).must_include 'name ^'
95
95
 
96
96
  Host.search_for(query).must_include host
97
97
  Host.search_for(query).must_include second_host
@@ -102,7 +102,7 @@ class TargetingTest < ActiveSupport::TestCase
102
102
  let(:query) { Targeting.build_query_from_hosts([ host.id ]) }
103
103
 
104
104
  it 'builds query using host name' do
105
- query.must_equal "name ^ (#{host.name})"
105
+ _(query).must_equal "name ^ (#{host.name})"
106
106
  Host.search_for(query).must_include host
107
107
  Host.search_for(query).wont_include second_host
108
108
  end
@@ -31,8 +31,8 @@ class TemplateInvocationInputTest < ActiveSupport::TestCase
31
31
  template.template_inputs << FactoryBot.build(:template_input, :name => 'service_name',
32
32
  :input_type => 'user', :required => true)
33
33
  assert_valid FactoryBot.create(:template_invocation_input_value,
34
- :template_invocation => template_invocation,
35
- :template_input => template.template_inputs.first,
36
- :value => 'foreman' * 1_000_000)
34
+ :template_invocation => template_invocation,
35
+ :template_input => template.template_inputs.first,
36
+ :value => 'foreman' * 1_000_000)
37
37
  end
38
38
  end
@@ -12,18 +12,3 @@ componentRegistry.register({
12
12
  });
13
13
 
14
14
  registerReducer('foremanRemoteExecutionReducers', rootReducer);
15
-
16
- if (window.location.href.match(/job_invocations/)) {
17
- const jobInvocationId = parseInt(
18
- new URI(window.location.href).filename(),
19
- 10,
20
- );
21
-
22
- const mountJobInvocationContainer = () => {
23
- mount('JobInvocationContainer', '#status_chart', {
24
- url: `/job_invocations/chart?id=${jobInvocationId}`,
25
- });
26
- };
27
-
28
- document.addEventListener('page:change', mountJobInvocationContainer);
29
- }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_remote_execution
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Remote Execution team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-20 00:00:00.000000000 Z
11
+ date: 2020-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.0.1
33
+ version: 1.0.2
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: 2.0.0
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 1.0.1
43
+ version: 1.0.2
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: 2.0.0
@@ -178,6 +178,7 @@ files:
178
178
  - app/models/concerns/foreman_remote_execution/foreman_tasks_triggering_extensions.rb
179
179
  - app/models/concerns/foreman_remote_execution/host_extensions.rb
180
180
  - app/models/concerns/foreman_remote_execution/nic_extensions.rb
181
+ - app/models/concerns/foreman_remote_execution/orchestration/ssh.rb
181
182
  - app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb
182
183
  - app/models/concerns/foreman_remote_execution/subnet_extensions.rb
183
184
  - app/models/concerns/foreman_remote_execution/taxonomy_extensions.rb
@@ -242,6 +243,7 @@ files:
242
243
  - app/views/job_invocations/_host_status_td.html.erb
243
244
  - app/views/job_invocations/_preview_hosts_list.html.erb
244
245
  - app/views/job_invocations/_preview_hosts_modal.html.erb
246
+ - app/views/job_invocations/_rerun_taxonomies.html.erb
245
247
  - app/views/job_invocations/_tab_hosts.html.erb
246
248
  - app/views/job_invocations/_tab_overview.html.erb
247
249
  - app/views/job_invocations/_tab_preview_templates.html.erb
@@ -376,6 +378,7 @@ files:
376
378
  - test/functional/job_invocations_controller_test.rb
377
379
  - test/functional/job_templates_controller_test.rb
378
380
  - test/helpers/remote_execution_helper_test.rb
381
+ - test/models/orchestration/ssh_test.rb
379
382
  - test/test_plugin_helper.rb
380
383
  - test/unit/actions/run_host_job_test.rb
381
384
  - test/unit/actions/run_hosts_job_test.rb
@@ -441,6 +444,7 @@ test_files:
441
444
  - test/functional/job_invocations_controller_test.rb
442
445
  - test/functional/job_templates_controller_test.rb
443
446
  - test/helpers/remote_execution_helper_test.rb
447
+ - test/models/orchestration/ssh_test.rb
444
448
  - test/test_plugin_helper.rb
445
449
  - test/unit/actions/run_host_job_test.rb
446
450
  - test/unit/actions/run_hosts_job_test.rb