foreman_remote_execution 4.5.6 → 5.0.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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby_ci.yml +7 -0
- data/.rubocop_todo.yml +1 -0
- data/app/controllers/api/v2/job_invocations_controller.rb +16 -1
- data/app/controllers/ui_job_wizard_controller.rb +16 -4
- data/app/graphql/mutations/job_invocations/create.rb +43 -0
- data/app/graphql/types/job_invocation.rb +16 -0
- data/app/graphql/types/job_invocation_input.rb +13 -0
- data/app/graphql/types/recurrence_input.rb +8 -0
- data/app/graphql/types/scheduling_input.rb +6 -0
- data/app/graphql/types/targeting_enum.rb +7 -0
- data/app/lib/actions/remote_execution/run_host_job.rb +6 -1
- data/app/lib/actions/remote_execution/run_hosts_job.rb +57 -3
- data/app/mailers/rex_job_mailer.rb +15 -0
- data/app/models/concerns/foreman_remote_execution/host_extensions.rb +8 -0
- data/app/models/job_invocation.rb +4 -0
- data/app/models/job_invocation_composer.rb +21 -13
- data/app/models/job_template.rb +1 -1
- data/app/models/remote_execution_provider.rb +17 -2
- data/app/models/rex_mail_notification.rb +13 -0
- data/app/models/targeting.rb +2 -2
- data/app/services/ui_notifications/remote_execution_jobs/base_job_finish.rb +2 -1
- data/app/views/dashboard/_latest-jobs.html.erb +21 -0
- data/app/views/job_invocations/refresh.js.erb +1 -0
- data/app/views/rex_job_mailer/job_finished.html.erb +24 -0
- data/app/views/rex_job_mailer/job_finished.text.erb +9 -0
- data/app/views/template_invocations/show.html.erb +2 -1
- data/config/routes.rb +1 -0
- data/db/migrate/20210816100932_rex_setting_category_to_dsl.rb +5 -0
- data/db/seeds.d/50-notification_blueprints.rb +14 -0
- data/db/seeds.d/95-mail_notifications.rb +24 -0
- data/foreman_remote_execution.gemspec +2 -4
- data/lib/foreman_remote_execution/engine.rb +114 -6
- data/lib/foreman_remote_execution/version.rb +1 -1
- data/package.json +6 -6
- data/test/functional/api/v2/job_invocations_controller_test.rb +20 -0
- data/test/functional/cockpit_controller_test.rb +0 -1
- data/test/graphql/mutations/job_invocations/create.rb +58 -0
- data/test/graphql/queries/job_invocation_query_test.rb +31 -0
- data/test/graphql/queries/job_invocations_query_test.rb +35 -0
- data/test/helpers/remote_execution_helper_test.rb +0 -1
- data/test/unit/actions/run_host_job_test.rb +21 -0
- data/test/unit/actions/run_hosts_job_test.rb +99 -4
- data/test/unit/concerns/host_extensions_test.rb +40 -7
- data/test/unit/input_template_renderer_test.rb +1 -89
- data/test/unit/job_invocation_composer_test.rb +4 -17
- data/test/unit/job_invocation_report_template_test.rb +16 -13
- data/test/unit/job_template_effective_user_test.rb +0 -4
- data/test/unit/remote_execution_provider_test.rb +34 -4
- data/test/unit/targeting_test.rb +68 -1
- data/webpack/JobWizard/JobWizard.js +106 -15
- data/webpack/JobWizard/JobWizard.scss +73 -39
- data/webpack/JobWizard/JobWizardConstants.js +36 -0
- data/webpack/JobWizard/JobWizardSelectors.js +32 -0
- data/webpack/JobWizard/__tests__/fixtures.js +81 -6
- data/webpack/JobWizard/__tests__/integration.test.js +26 -15
- data/webpack/JobWizard/__tests__/validation.test.js +141 -0
- data/webpack/JobWizard/autofill.js +38 -0
- data/webpack/JobWizard/index.js +7 -0
- data/webpack/JobWizard/steps/AdvancedFields/AdvancedFields.js +7 -4
- data/webpack/JobWizard/steps/AdvancedFields/DescriptionField.js +32 -9
- data/webpack/JobWizard/steps/AdvancedFields/__tests__/AdvancedFields.test.js +216 -12
- data/webpack/JobWizard/steps/AdvancedFields/__tests__/__snapshots__/AdvancedFields.test.js.snap +82 -0
- data/webpack/JobWizard/steps/CategoryAndTemplate/CategoryAndTemplate.js +1 -0
- data/webpack/JobWizard/steps/CategoryAndTemplate/index.js +3 -2
- data/webpack/JobWizard/steps/HostsAndInputs/HostPreviewModal.js +62 -0
- data/webpack/JobWizard/steps/HostsAndInputs/HostSearch.js +54 -0
- data/webpack/JobWizard/steps/HostsAndInputs/SelectAPI.js +33 -0
- data/webpack/JobWizard/steps/HostsAndInputs/SelectGQL.js +52 -0
- data/webpack/JobWizard/steps/HostsAndInputs/SelectedChips.js +82 -7
- data/webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js +151 -0
- data/webpack/JobWizard/steps/HostsAndInputs/__tests__/TemplateInputs.test.js +7 -4
- data/webpack/JobWizard/steps/HostsAndInputs/buildHostQuery.js +18 -0
- data/webpack/JobWizard/steps/HostsAndInputs/hostgroups.gql +8 -0
- data/webpack/JobWizard/steps/HostsAndInputs/hosts.gql +8 -0
- data/webpack/JobWizard/steps/HostsAndInputs/index.js +182 -34
- data/webpack/JobWizard/steps/ReviewDetails/index.js +193 -0
- data/webpack/JobWizard/steps/Schedule/PurposeField.js +31 -0
- data/webpack/JobWizard/steps/Schedule/QueryType.js +46 -43
- data/webpack/JobWizard/steps/Schedule/RepeatCron.js +53 -0
- data/webpack/JobWizard/steps/Schedule/RepeatDaily.js +37 -0
- data/webpack/JobWizard/steps/Schedule/RepeatHour.js +54 -0
- data/webpack/JobWizard/steps/Schedule/RepeatMonth.js +46 -0
- data/webpack/JobWizard/steps/Schedule/RepeatOn.js +95 -31
- data/webpack/JobWizard/steps/Schedule/RepeatWeek.js +70 -0
- data/webpack/JobWizard/steps/Schedule/ScheduleType.js +24 -21
- data/webpack/JobWizard/steps/Schedule/StartEndDates.js +78 -23
- data/webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js +402 -0
- data/webpack/JobWizard/steps/Schedule/__tests__/StartEndDates.test.js +20 -10
- data/webpack/JobWizard/steps/Schedule/index.js +153 -19
- data/webpack/JobWizard/steps/form/DateTimePicker.js +126 -0
- data/webpack/JobWizard/steps/form/FormHelpers.js +4 -0
- data/webpack/JobWizard/steps/form/Formatter.js +39 -8
- data/webpack/JobWizard/steps/form/NumberInput.js +3 -2
- data/webpack/JobWizard/steps/form/ResourceSelect.js +29 -0
- data/webpack/JobWizard/steps/form/SearchSelect.js +121 -0
- data/webpack/JobWizard/steps/form/SelectField.js +14 -3
- data/webpack/JobWizard/steps/form/__tests__/SelectSearch.test.js +33 -0
- data/webpack/JobWizard/submit.js +120 -0
- data/webpack/JobWizard/validation.js +53 -0
- data/webpack/__mocks__/foremanReact/Root/Context/ForemanContext/index.js +2 -0
- data/webpack/__mocks__/foremanReact/common/I18n.js +2 -0
- data/webpack/__mocks__/foremanReact/components/AutoComplete/AutoCompleteActions.js +1 -0
- data/webpack/__mocks__/foremanReact/components/AutoComplete/AutoCompleteConstants.js +1 -0
- data/webpack/__mocks__/foremanReact/routes/RouterSelector.js +1 -0
- data/webpack/helpers.js +1 -0
- data/webpack/react_app/components/RecentJobsCard/JobStatusIcon.js +43 -0
- data/webpack/react_app/components/RecentJobsCard/RecentJobsCard.js +73 -66
- data/webpack/react_app/components/RecentJobsCard/RecentJobsTable.js +98 -0
- data/webpack/react_app/components/RecentJobsCard/constants.js +11 -0
- data/webpack/react_app/components/RecentJobsCard/styles.scss +11 -0
- data/webpack/react_app/extend/fillRecentJobsCard.js +1 -1
- metadata +56 -23
- data/app/models/setting/remote_execution.rb +0 -88
- data/webpack/JobWizard/steps/AdvancedFields/__tests__/DescriptionField.test.js +0 -23
- data/webpack/JobWizard/steps/HostsAndInputs/__tests__/SelectedChips.test.js +0 -37
- data/webpack/JobWizard/steps/form/__tests__/Formatter.test.js.example +0 -76
- data/webpack/react_app/components/RecentJobsCard/styles.css +0 -15
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:
|
|
4
|
+
version: 5.0.0
|
|
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: 2021-
|
|
11
|
+
date: 2021-11-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: deface
|
|
@@ -44,34 +44,20 @@ dependencies:
|
|
|
44
44
|
- - "<"
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
46
|
version: 2.0.0
|
|
47
|
-
- !ruby/object:Gem::Dependency
|
|
48
|
-
name: foreman_remote_execution_core
|
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
|
50
|
-
requirements:
|
|
51
|
-
- - ">="
|
|
52
|
-
- !ruby/object:Gem::Version
|
|
53
|
-
version: '0'
|
|
54
|
-
type: :runtime
|
|
55
|
-
prerelease: false
|
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
-
requirements:
|
|
58
|
-
- - ">="
|
|
59
|
-
- !ruby/object:Gem::Version
|
|
60
|
-
version: '0'
|
|
61
47
|
- !ruby/object:Gem::Dependency
|
|
62
48
|
name: foreman-tasks
|
|
63
49
|
requirement: !ruby/object:Gem::Requirement
|
|
64
50
|
requirements:
|
|
65
51
|
- - ">="
|
|
66
52
|
- !ruby/object:Gem::Version
|
|
67
|
-
version:
|
|
53
|
+
version: 5.1.0
|
|
68
54
|
type: :runtime
|
|
69
55
|
prerelease: false
|
|
70
56
|
version_requirements: !ruby/object:Gem::Requirement
|
|
71
57
|
requirements:
|
|
72
58
|
- - ">="
|
|
73
59
|
- !ruby/object:Gem::Version
|
|
74
|
-
version:
|
|
60
|
+
version: 5.1.0
|
|
75
61
|
- !ruby/object:Gem::Dependency
|
|
76
62
|
name: factory_bot_rails
|
|
77
63
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -150,6 +136,12 @@ files:
|
|
|
150
136
|
- app/controllers/remote_execution_features_controller.rb
|
|
151
137
|
- app/controllers/template_invocations_controller.rb
|
|
152
138
|
- app/controllers/ui_job_wizard_controller.rb
|
|
139
|
+
- app/graphql/mutations/job_invocations/create.rb
|
|
140
|
+
- app/graphql/types/job_invocation.rb
|
|
141
|
+
- app/graphql/types/job_invocation_input.rb
|
|
142
|
+
- app/graphql/types/recurrence_input.rb
|
|
143
|
+
- app/graphql/types/scheduling_input.rb
|
|
144
|
+
- app/graphql/types/targeting_enum.rb
|
|
153
145
|
- app/helpers/concerns/foreman_remote_execution/hosts_helper_extensions.rb
|
|
154
146
|
- app/helpers/concerns/foreman_remote_execution/job_templates_extensions.rb
|
|
155
147
|
- app/helpers/job_invocation_output_helper.rb
|
|
@@ -163,6 +155,7 @@ files:
|
|
|
163
155
|
- app/lib/foreman_remote_execution/renderer/scope/input.rb
|
|
164
156
|
- app/lib/proxy_api/remote_execution_ssh.rb
|
|
165
157
|
- app/mailers/.gitkeep
|
|
158
|
+
- app/mailers/rex_job_mailer.rb
|
|
166
159
|
- app/models/concerns/api/v2/interfaces_controller_extensions.rb
|
|
167
160
|
- app/models/concerns/foreman_remote_execution/bookmark_extensions.rb
|
|
168
161
|
- app/models/concerns/foreman_remote_execution/errors_flattener.rb
|
|
@@ -190,7 +183,7 @@ files:
|
|
|
190
183
|
- app/models/job_template_effective_user.rb
|
|
191
184
|
- app/models/remote_execution_feature.rb
|
|
192
185
|
- app/models/remote_execution_provider.rb
|
|
193
|
-
- app/models/
|
|
186
|
+
- app/models/rex_mail_notification.rb
|
|
194
187
|
- app/models/ssh_execution_provider.rb
|
|
195
188
|
- app/models/target_remote_execution_proxy.rb
|
|
196
189
|
- app/models/targeting.rb
|
|
@@ -229,6 +222,7 @@ files:
|
|
|
229
222
|
- app/views/api/v2/template_invocations/base.json.rabl
|
|
230
223
|
- app/views/api/v2/template_invocations/template_invocations.json.rabl
|
|
231
224
|
- app/views/dashboard/.gitkeep
|
|
225
|
+
- app/views/dashboard/_latest-jobs.html.erb
|
|
232
226
|
- app/views/job_invocation_task_groups/_job_invocation_task_groups.html.erb
|
|
233
227
|
- app/views/job_invocations/_card_results.html.erb
|
|
234
228
|
- app/views/job_invocations/_card_schedule.html.erb
|
|
@@ -262,6 +256,8 @@ files:
|
|
|
262
256
|
- app/views/remote_execution_features/_form.html.erb
|
|
263
257
|
- app/views/remote_execution_features/index.html.erb
|
|
264
258
|
- app/views/remote_execution_features/show.html.erb
|
|
259
|
+
- app/views/rex_job_mailer/job_finished.html.erb
|
|
260
|
+
- app/views/rex_job_mailer/job_finished.text.erb
|
|
265
261
|
- app/views/template_inputs/_foreign_input_set_form.html.erb
|
|
266
262
|
- app/views/template_invocations/_output_line_set.html.erb
|
|
267
263
|
- app/views/template_invocations/_refresh.js.erb
|
|
@@ -325,12 +321,14 @@ files:
|
|
|
325
321
|
- db/migrate/20200820122057_add_proxy_selector_override_to_remote_execution_feature.rb
|
|
326
322
|
- db/migrate/20210312074713_add_provider_inputs.rb
|
|
327
323
|
- db/migrate/2021051713291621250977_add_host_proxy_invocations.rb
|
|
324
|
+
- db/migrate/20210816100932_rex_setting_category_to_dsl.rb
|
|
328
325
|
- db/seeds.d/100-assign_features_with_templates.rb
|
|
329
326
|
- db/seeds.d/20-permissions.rb
|
|
330
327
|
- db/seeds.d/50-notification_blueprints.rb
|
|
331
328
|
- db/seeds.d/60-ssh_proxy_feature.rb
|
|
332
329
|
- db/seeds.d/70-job_templates.rb
|
|
333
330
|
- db/seeds.d/90-bookmarks.rb
|
|
331
|
+
- db/seeds.d/95-mail_notifications.rb
|
|
334
332
|
- extra/cockpit/cockpit.conf.example
|
|
335
333
|
- extra/cockpit/foreman-cockpit-session
|
|
336
334
|
- extra/cockpit/foreman-cockpit.service
|
|
@@ -380,6 +378,9 @@ files:
|
|
|
380
378
|
- test/functional/job_invocations_controller_test.rb
|
|
381
379
|
- test/functional/job_templates_controller_test.rb
|
|
382
380
|
- test/functional/ui_job_wizard_controller_test.rb
|
|
381
|
+
- test/graphql/mutations/job_invocations/create.rb
|
|
382
|
+
- test/graphql/queries/job_invocation_query_test.rb
|
|
383
|
+
- test/graphql/queries/job_invocations_query_test.rb
|
|
383
384
|
- test/helpers/remote_execution_helper_test.rb
|
|
384
385
|
- test/support/remote_execution_helper.rb
|
|
385
386
|
- test/test_plugin_helper.rb
|
|
@@ -407,36 +408,61 @@ files:
|
|
|
407
408
|
- webpack/JobWizard/__tests__/__snapshots__/integration.test.js.snap
|
|
408
409
|
- webpack/JobWizard/__tests__/fixtures.js
|
|
409
410
|
- webpack/JobWizard/__tests__/integration.test.js
|
|
411
|
+
- webpack/JobWizard/__tests__/validation.test.js
|
|
412
|
+
- webpack/JobWizard/autofill.js
|
|
410
413
|
- webpack/JobWizard/index.js
|
|
411
414
|
- webpack/JobWizard/steps/AdvancedFields/AdvancedFields.js
|
|
412
415
|
- webpack/JobWizard/steps/AdvancedFields/DescriptionField.js
|
|
413
416
|
- webpack/JobWizard/steps/AdvancedFields/Fields.js
|
|
414
417
|
- webpack/JobWizard/steps/AdvancedFields/__tests__/AdvancedFields.test.js
|
|
415
|
-
- webpack/JobWizard/steps/AdvancedFields/__tests__/
|
|
418
|
+
- webpack/JobWizard/steps/AdvancedFields/__tests__/__snapshots__/AdvancedFields.test.js.snap
|
|
416
419
|
- webpack/JobWizard/steps/CategoryAndTemplate/CategoryAndTemplate.js
|
|
417
420
|
- webpack/JobWizard/steps/CategoryAndTemplate/CategoryAndTemplate.test.js
|
|
418
421
|
- webpack/JobWizard/steps/CategoryAndTemplate/index.js
|
|
422
|
+
- webpack/JobWizard/steps/HostsAndInputs/HostPreviewModal.js
|
|
423
|
+
- webpack/JobWizard/steps/HostsAndInputs/HostSearch.js
|
|
424
|
+
- webpack/JobWizard/steps/HostsAndInputs/SelectAPI.js
|
|
425
|
+
- webpack/JobWizard/steps/HostsAndInputs/SelectGQL.js
|
|
419
426
|
- webpack/JobWizard/steps/HostsAndInputs/SelectedChips.js
|
|
420
427
|
- webpack/JobWizard/steps/HostsAndInputs/TemplateInputs.js
|
|
421
|
-
- webpack/JobWizard/steps/HostsAndInputs/__tests__/
|
|
428
|
+
- webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js
|
|
422
429
|
- webpack/JobWizard/steps/HostsAndInputs/__tests__/TemplateInputs.test.js
|
|
430
|
+
- webpack/JobWizard/steps/HostsAndInputs/buildHostQuery.js
|
|
431
|
+
- webpack/JobWizard/steps/HostsAndInputs/hostgroups.gql
|
|
432
|
+
- webpack/JobWizard/steps/HostsAndInputs/hosts.gql
|
|
423
433
|
- webpack/JobWizard/steps/HostsAndInputs/index.js
|
|
434
|
+
- webpack/JobWizard/steps/ReviewDetails/index.js
|
|
435
|
+
- webpack/JobWizard/steps/Schedule/PurposeField.js
|
|
424
436
|
- webpack/JobWizard/steps/Schedule/QueryType.js
|
|
437
|
+
- webpack/JobWizard/steps/Schedule/RepeatCron.js
|
|
438
|
+
- webpack/JobWizard/steps/Schedule/RepeatDaily.js
|
|
439
|
+
- webpack/JobWizard/steps/Schedule/RepeatHour.js
|
|
440
|
+
- webpack/JobWizard/steps/Schedule/RepeatMonth.js
|
|
425
441
|
- webpack/JobWizard/steps/Schedule/RepeatOn.js
|
|
442
|
+
- webpack/JobWizard/steps/Schedule/RepeatWeek.js
|
|
426
443
|
- webpack/JobWizard/steps/Schedule/ScheduleType.js
|
|
427
444
|
- webpack/JobWizard/steps/Schedule/StartEndDates.js
|
|
445
|
+
- webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js
|
|
428
446
|
- webpack/JobWizard/steps/Schedule/__tests__/StartEndDates.test.js
|
|
429
447
|
- webpack/JobWizard/steps/Schedule/index.js
|
|
448
|
+
- webpack/JobWizard/steps/form/DateTimePicker.js
|
|
430
449
|
- webpack/JobWizard/steps/form/FormHelpers.js
|
|
431
450
|
- webpack/JobWizard/steps/form/Formatter.js
|
|
432
451
|
- webpack/JobWizard/steps/form/GroupedSelectField.js
|
|
433
452
|
- webpack/JobWizard/steps/form/NumberInput.js
|
|
453
|
+
- webpack/JobWizard/steps/form/ResourceSelect.js
|
|
454
|
+
- webpack/JobWizard/steps/form/SearchSelect.js
|
|
434
455
|
- webpack/JobWizard/steps/form/SelectField.js
|
|
435
456
|
- webpack/JobWizard/steps/form/WizardTitle.js
|
|
436
|
-
- webpack/JobWizard/steps/form/__tests__/
|
|
457
|
+
- webpack/JobWizard/steps/form/__tests__/SelectSearch.test.js
|
|
458
|
+
- webpack/JobWizard/submit.js
|
|
459
|
+
- webpack/JobWizard/validation.js
|
|
437
460
|
- webpack/Routes/routes.js
|
|
461
|
+
- webpack/__mocks__/foremanReact/Root/Context/ForemanContext/index.js
|
|
438
462
|
- webpack/__mocks__/foremanReact/common/I18n.js
|
|
439
463
|
- webpack/__mocks__/foremanReact/common/helpers.js
|
|
464
|
+
- webpack/__mocks__/foremanReact/components/AutoComplete/AutoCompleteActions.js
|
|
465
|
+
- webpack/__mocks__/foremanReact/components/AutoComplete/AutoCompleteConstants.js
|
|
440
466
|
- webpack/__mocks__/foremanReact/components/Pagination/PaginationWrapper.js
|
|
441
467
|
- webpack/__mocks__/foremanReact/components/SearchBar.js
|
|
442
468
|
- webpack/__mocks__/foremanReact/components/common/ActionButtons/ActionButtons.js
|
|
@@ -445,13 +471,17 @@ files:
|
|
|
445
471
|
- webpack/__mocks__/foremanReact/redux/API/APISelectors.js
|
|
446
472
|
- webpack/__mocks__/foremanReact/redux/API/index.js
|
|
447
473
|
- webpack/__mocks__/foremanReact/redux/middlewares/IntervalMiddleware/IntervalSelectors.js
|
|
474
|
+
- webpack/__mocks__/foremanReact/routes/RouterSelector.js
|
|
448
475
|
- webpack/__mocks__/foremanReact/routes/common/PageLayout/PageLayout.js
|
|
449
476
|
- webpack/global_index.js
|
|
477
|
+
- webpack/helpers.js
|
|
450
478
|
- webpack/index.js
|
|
479
|
+
- webpack/react_app/components/RecentJobsCard/JobStatusIcon.js
|
|
451
480
|
- webpack/react_app/components/RecentJobsCard/RecentJobsCard.js
|
|
481
|
+
- webpack/react_app/components/RecentJobsCard/RecentJobsTable.js
|
|
452
482
|
- webpack/react_app/components/RecentJobsCard/constants.js
|
|
453
483
|
- webpack/react_app/components/RecentJobsCard/index.js
|
|
454
|
-
- webpack/react_app/components/RecentJobsCard/styles.
|
|
484
|
+
- webpack/react_app/components/RecentJobsCard/styles.scss
|
|
455
485
|
- webpack/react_app/components/RegistrationExtension/RexInterface.js
|
|
456
486
|
- webpack/react_app/components/RegistrationExtension/__tests__/RexInterface.test.js
|
|
457
487
|
- webpack/react_app/components/RegistrationExtension/__tests__/__snapshots__/RexInterface.test.js.snap
|
|
@@ -526,6 +556,9 @@ test_files:
|
|
|
526
556
|
- test/functional/job_invocations_controller_test.rb
|
|
527
557
|
- test/functional/job_templates_controller_test.rb
|
|
528
558
|
- test/functional/ui_job_wizard_controller_test.rb
|
|
559
|
+
- test/graphql/mutations/job_invocations/create.rb
|
|
560
|
+
- test/graphql/queries/job_invocation_query_test.rb
|
|
561
|
+
- test/graphql/queries/job_invocations_query_test.rb
|
|
529
562
|
- test/helpers/remote_execution_helper_test.rb
|
|
530
563
|
- test/support/remote_execution_helper.rb
|
|
531
564
|
- test/test_plugin_helper.rb
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
class Setting::RemoteExecution < Setting
|
|
2
|
-
|
|
3
|
-
::Setting::BLANK_ATTRS.concat %w{remote_execution_ssh_password remote_execution_ssh_key_passphrase remote_execution_sudo_password remote_execution_effective_user_password remote_execution_cockpit_url remote_execution_form_job_template}
|
|
4
|
-
|
|
5
|
-
def self.default_settings
|
|
6
|
-
[
|
|
7
|
-
self.set('remote_execution_fallback_proxy',
|
|
8
|
-
N_('Search the host for any proxy with Remote Execution, useful when the host has no subnet or the subnet does not have an execution proxy'),
|
|
9
|
-
false,
|
|
10
|
-
N_('Fallback to Any Proxy')),
|
|
11
|
-
self.set('remote_execution_global_proxy',
|
|
12
|
-
N_('Search for remote execution proxy outside of the proxies assigned to the host. ' +
|
|
13
|
-
"The search will be limited to the host's organization and location."),
|
|
14
|
-
true,
|
|
15
|
-
N_('Enable Global Proxy')),
|
|
16
|
-
self.set('remote_execution_ssh_user',
|
|
17
|
-
N_('Default user to use for SSH. You may override per host by setting a parameter called remote_execution_ssh_user.'),
|
|
18
|
-
'root',
|
|
19
|
-
N_('SSH User')),
|
|
20
|
-
self.set('remote_execution_effective_user',
|
|
21
|
-
N_('Default user to use for executing the script. If the user differs from the SSH user, su or sudo is used to switch the user.'),
|
|
22
|
-
'root',
|
|
23
|
-
N_('Effective User')),
|
|
24
|
-
self.set('remote_execution_effective_user_method',
|
|
25
|
-
N_('What command should be used to switch to the effective user. One of %s') % SSHExecutionProvider::EFFECTIVE_USER_METHODS.inspect,
|
|
26
|
-
'sudo',
|
|
27
|
-
N_('Effective User Method'),
|
|
28
|
-
nil,
|
|
29
|
-
{ :collection => proc { Hash[SSHExecutionProvider::EFFECTIVE_USER_METHODS.map { |method| [method, method] }] } }),
|
|
30
|
-
self.set('remote_execution_effective_user_password', N_("Effective user password"), '', N_("Effective user password"), nil, {:encrypted => true}),
|
|
31
|
-
self.set('remote_execution_sync_templates',
|
|
32
|
-
N_('Whether we should sync templates from disk when running db:seed.'),
|
|
33
|
-
true,
|
|
34
|
-
N_('Sync Job Templates')),
|
|
35
|
-
self.set('remote_execution_ssh_port',
|
|
36
|
-
N_('Port to use for SSH communication. Default port 22. You may override per host by setting a parameter called remote_execution_ssh_port.'),
|
|
37
|
-
'22',
|
|
38
|
-
N_('SSH Port')),
|
|
39
|
-
self.set('remote_execution_connect_by_ip',
|
|
40
|
-
N_('Should the ip addresses on host interfaces be preferred over the fqdn? '\
|
|
41
|
-
'It is useful when DNS not resolving the fqdns properly. You may override this per host by setting a parameter called remote_execution_connect_by_ip. '\
|
|
42
|
-
'This setting only applies to IPv4. When the host has only an IPv6 address on the interface used for remote execution, hostname will be used even if this setting is set to true.'),
|
|
43
|
-
false,
|
|
44
|
-
N_('Connect by IP')),
|
|
45
|
-
self.set('remote_execution_ssh_password',
|
|
46
|
-
N_('Default password to use for SSH. You may override per host by setting a parameter called remote_execution_ssh_password'),
|
|
47
|
-
nil,
|
|
48
|
-
N_('Default SSH password'),
|
|
49
|
-
nil,
|
|
50
|
-
{ :encrypted => true }),
|
|
51
|
-
self.set('remote_execution_ssh_key_passphrase',
|
|
52
|
-
N_('Default key passphrase to use for SSH. You may override per host by setting a parameter called remote_execution_ssh_key_passphrase'),
|
|
53
|
-
nil,
|
|
54
|
-
N_('Default SSH key passphrase'),
|
|
55
|
-
nil,
|
|
56
|
-
{ :encrypted => true }),
|
|
57
|
-
self.set('remote_execution_workers_pool_size',
|
|
58
|
-
N_('Amount of workers in the pool to handle the execution of the remote execution jobs. Restart of the dynflowd/foreman-tasks service is required.'),
|
|
59
|
-
5,
|
|
60
|
-
N_('Workers pool size')),
|
|
61
|
-
self.set('remote_execution_cleanup_working_dirs',
|
|
62
|
-
N_('When enabled, working directories will be removed after task completion. You may override this per host by setting a parameter called remote_execution_cleanup_working_dirs.'),
|
|
63
|
-
true,
|
|
64
|
-
N_('Cleanup working directories')),
|
|
65
|
-
self.set('remote_execution_cockpit_url',
|
|
66
|
-
N_('Where to find the Cockpit instance for the Web Console button. By default, no button is shown.'),
|
|
67
|
-
nil,
|
|
68
|
-
N_('Cockpit URL'),
|
|
69
|
-
nil),
|
|
70
|
-
self.set('remote_execution_form_job_template',
|
|
71
|
-
N_('Choose a job template that is pre-selected in job invocation form'),
|
|
72
|
-
'Run Command - SSH Default',
|
|
73
|
-
N_('Form Job Template'),
|
|
74
|
-
nil,
|
|
75
|
-
{ :collection => proc { Hash[JobTemplate.unscoped.map { |template| [template.name, template.name] }] } }),
|
|
76
|
-
self.set('remote_execution_job_invocation_report_template',
|
|
77
|
-
N_('Select a report template used for generating a report for a particular remote execution job'),
|
|
78
|
-
'Jobs - Invocation report template',
|
|
79
|
-
N_('Job Invocation Report Template'),
|
|
80
|
-
nil,
|
|
81
|
-
{ :collection => proc { self.job_invocation_report_templates_select } }),
|
|
82
|
-
]
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
def self.job_invocation_report_templates_select
|
|
86
|
-
Hash[ReportTemplate.unscoped.joins(:template_inputs).where(template_inputs: TemplateInput.where(name: 'job_id')).map { |template| [template.name, template.name] }]
|
|
87
|
-
end
|
|
88
|
-
end
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { mount } from '@theforeman/test';
|
|
3
|
-
import { DescriptionField } from '../DescriptionField';
|
|
4
|
-
|
|
5
|
-
describe('DescriptionField', () => {
|
|
6
|
-
it('rendring', () => {
|
|
7
|
-
const component = mount(
|
|
8
|
-
<DescriptionField
|
|
9
|
-
inputs={[{ name: 'command' }]}
|
|
10
|
-
value="Run %{command}"
|
|
11
|
-
setValue={jest.fn()}
|
|
12
|
-
/>
|
|
13
|
-
);
|
|
14
|
-
const preview = component.find('#description-preview').hostNodes();
|
|
15
|
-
const findLink = () => component.find('.pf-m-link.pf-m-inline');
|
|
16
|
-
expect(findLink().text()).toEqual('Edit job description template');
|
|
17
|
-
expect(preview.props().value).toEqual('Run command');
|
|
18
|
-
findLink().simulate('click');
|
|
19
|
-
const description = component.find('#description').hostNodes();
|
|
20
|
-
expect(description.props().value).toEqual('Run %{command}');
|
|
21
|
-
expect(findLink().text()).toEqual('Preview job description');
|
|
22
|
-
});
|
|
23
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Provider } from 'react-redux';
|
|
3
|
-
import { fireEvent, screen, render, act } from '@testing-library/react';
|
|
4
|
-
import * as api from 'foremanReact/redux/API';
|
|
5
|
-
import { JobWizard } from '../../../JobWizard';
|
|
6
|
-
import * as selectors from '../../../JobWizardSelectors';
|
|
7
|
-
import { testSetup, mockApi } from '../../../__tests__/fixtures';
|
|
8
|
-
|
|
9
|
-
const store = testSetup(selectors, api);
|
|
10
|
-
mockApi(api);
|
|
11
|
-
|
|
12
|
-
describe('TemplateInputs', () => {
|
|
13
|
-
it('should save data between steps for template input fields', async () => {
|
|
14
|
-
render(
|
|
15
|
-
<Provider store={store}>
|
|
16
|
-
<JobWizard advancedValues={{}} setAdvancedValues={jest.fn()} />
|
|
17
|
-
</Provider>
|
|
18
|
-
);
|
|
19
|
-
await act(async () => {
|
|
20
|
-
await fireEvent.click(
|
|
21
|
-
screen.getByText('Target hosts and inputs', { selector: 'button' })
|
|
22
|
-
);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
expect(
|
|
26
|
-
screen.getAllByLabelText('host2', { selector: 'button' })
|
|
27
|
-
).toHaveLength(1);
|
|
28
|
-
const chip1 = screen.getByLabelText('host1', { selector: 'button' });
|
|
29
|
-
fireEvent.click(chip1);
|
|
30
|
-
expect(
|
|
31
|
-
screen.queryAllByLabelText('host1', { selector: 'button' })
|
|
32
|
-
).toHaveLength(0);
|
|
33
|
-
expect(
|
|
34
|
-
screen.queryAllByLabelText('host2', { selector: 'button' })
|
|
35
|
-
).toHaveLength(1);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Provider } from 'react-redux';
|
|
3
|
-
import configureMockStore from 'redux-mock-store';
|
|
4
|
-
import * as patternfly from '@patternfly/react-core';
|
|
5
|
-
import { mount, shallow } from '@theforeman/test';
|
|
6
|
-
import { formatter } from '../Formatter';
|
|
7
|
-
|
|
8
|
-
jest.spyOn(patternfly, 'Select');
|
|
9
|
-
jest.spyOn(patternfly, 'SelectOption');
|
|
10
|
-
jest.spyOn(patternfly, 'FormGroup');
|
|
11
|
-
patternfly.Select.mockImplementation(props => <div props={props} />);
|
|
12
|
-
patternfly.SelectOption.mockImplementation(props => <div props={props} />);
|
|
13
|
-
patternfly.FormGroup.mockImplementation(props => <div props={props} />);
|
|
14
|
-
const mockStore = configureMockStore([]);
|
|
15
|
-
const store = mockStore({});
|
|
16
|
-
|
|
17
|
-
describe('formatter', () => {
|
|
18
|
-
it('render date input', () => {
|
|
19
|
-
const props = {
|
|
20
|
-
name: 'date adv',
|
|
21
|
-
required: false,
|
|
22
|
-
options: '',
|
|
23
|
-
advanced: true,
|
|
24
|
-
value_type: 'date',
|
|
25
|
-
resource_type: 'ansible_roles',
|
|
26
|
-
default: '',
|
|
27
|
-
hidden_value: false,
|
|
28
|
-
};
|
|
29
|
-
expect(shallow(formatter(props, {}, jest.fn()))).toMatchSnapshot();
|
|
30
|
-
});
|
|
31
|
-
it('render text input', () => {
|
|
32
|
-
const props = {
|
|
33
|
-
name: 'plain adv hidden',
|
|
34
|
-
required: true,
|
|
35
|
-
description: 'some Description',
|
|
36
|
-
options: '',
|
|
37
|
-
advanced: true,
|
|
38
|
-
value_type: 'plain',
|
|
39
|
-
resource_type: 'ansible_roles',
|
|
40
|
-
default: 'Default val',
|
|
41
|
-
hidden_value: true,
|
|
42
|
-
};
|
|
43
|
-
expect(shallow(formatter(props, {}, jest.fn()))).toMatchSnapshot();
|
|
44
|
-
});
|
|
45
|
-
it('render select input', () => {
|
|
46
|
-
const props = {
|
|
47
|
-
name: 'adv plain search',
|
|
48
|
-
required: false,
|
|
49
|
-
input_type: 'user',
|
|
50
|
-
options: 'option 1\r\noption 2\r\noption 3\r\noption 4',
|
|
51
|
-
advanced: true,
|
|
52
|
-
value_type: 'plain',
|
|
53
|
-
resource_type: 'ansible_roles',
|
|
54
|
-
default: '',
|
|
55
|
-
hidden_value: false,
|
|
56
|
-
};
|
|
57
|
-
expect(shallow(formatter(props, {}, jest.fn()))).toMatchSnapshot();
|
|
58
|
-
});
|
|
59
|
-
it('render search input', () => {
|
|
60
|
-
const props = {
|
|
61
|
-
name: 'search adv',
|
|
62
|
-
required: false,
|
|
63
|
-
options: '',
|
|
64
|
-
advanced: true,
|
|
65
|
-
value_type: 'search',
|
|
66
|
-
resource_type: 'foreman_tasks/tasks',
|
|
67
|
-
default: '',
|
|
68
|
-
hidden_value: false,
|
|
69
|
-
};
|
|
70
|
-
expect(
|
|
71
|
-
mount(
|
|
72
|
-
<Provider store={store}>{formatter(props, {}, jest.fn())}</Provider>
|
|
73
|
-
)
|
|
74
|
-
).toMatchSnapshot();
|
|
75
|
-
});
|
|
76
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
.properties-side-panel-pf-property-value {
|
|
2
|
-
font-size: 14px !important;
|
|
3
|
-
margin-top: 8px;
|
|
4
|
-
word-break: break-word;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.properties-side-panel-pf-property-label {
|
|
8
|
-
font-weight: 700 !important;
|
|
9
|
-
font-size: 14px !important;
|
|
10
|
-
margin: 0 !important;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.properties-side-panel-pf-property {
|
|
14
|
-
margin-top: 24px;
|
|
15
|
-
}
|