foreman_patch 1.1.4 → 1.1.6.alpha4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/foreman_patch/concerns/hosts_controller_extensions.rb +35 -41
  3. data/app/controllers/foreman_patch/react_controller.rb +12 -0
  4. data/app/lib/actions/foreman_patch/cycle/create.rb +5 -1
  5. data/app/lib/actions/foreman_patch/cycle/initiate.rb +5 -1
  6. data/app/lib/actions/foreman_patch/invocation/action.rb +23 -29
  7. data/app/lib/actions/foreman_patch/invocation/patch.rb +16 -7
  8. data/app/lib/actions/foreman_patch/invocation/process_logging.rb +44 -0
  9. data/app/lib/actions/foreman_patch/invocation/proxy_action.rb +52 -0
  10. data/app/lib/actions/foreman_patch/invocation/wait_for_host.rb +4 -29
  11. data/app/lib/actions/foreman_patch/round/patch.rb +5 -1
  12. data/app/lib/actions/foreman_patch/window/publish.rb +5 -1
  13. data/app/lib/actions/foreman_patch/window/resolve_hosts.rb +5 -1
  14. data/app/models/foreman_patch/event.rb +13 -0
  15. data/app/models/foreman_patch/invocation.rb +2 -4
  16. data/app/views/foreman_patch/api/v2/invocations/base.json.rabl +1 -1
  17. data/app/views/foreman_patch/api/v2/invocations/event.json.rabl +3 -0
  18. data/app/views/foreman_patch/api/v2/invocations/show.json.rabl +2 -2
  19. data/app/views/foreman_patch/groups/index.html.erb +1 -1
  20. data/app/views/foreman_patch/layouts/react.html.erb +1 -1
  21. data/config/api_routes.rb +26 -28
  22. data/config/routes.rb +40 -29
  23. data/db/migrate/20230706092400_nullify_group_on_delete.rb +11 -0
  24. data/db/migrate/20230707102800_create_invocation_events.rb +16 -0
  25. data/db/seeds.d/100-assign_features_with_templates.rb +6 -12
  26. data/lib/foreman_patch/engine.rb +11 -46
  27. data/lib/foreman_patch/register.rb +119 -0
  28. data/lib/foreman_patch/version.rb +1 -1
  29. data/locale/en/foreman_patch.po +1 -1
  30. data/locale/foreman_patch.pot +1 -1
  31. data/locale/gemspec.rb +1 -1
  32. data/package.json +20 -9
  33. data/public/assets/foreman_patch/calendar-b5391efda77239c4a4894e9f03f34610f6c8e2e748b2a147febfea814b857cdc.scss.gz +0 -0
  34. data/public/assets/foreman_patch/cycle_plans-e5667e178ba389908f5c815b24ec0ea77c340849d56bc39c5ce72bb626bd446a.scss +6 -0
  35. data/public/assets/foreman_patch/cycle_plans-e5667e178ba389908f5c815b24ec0ea77c340849d56bc39c5ce72bb626bd446a.scss.gz +0 -0
  36. data/public/assets/foreman_patch/cycle_plans-ff3d252119622a68828ff70f4a97328303963002237dbf850e92d6a706e93667.scss +6 -0
  37. data/public/assets/foreman_patch/cycle_plans-ff3d252119622a68828ff70f4a97328303963002237dbf850e92d6a706e93667.scss.gz +0 -0
  38. data/public/assets/foreman_patch/foreman_patch-410cf04bf9b09e65fee034cc3f2dd74acf2524abf881c6d6e559d5c62a615faf.css +11 -0
  39. data/public/assets/foreman_patch/foreman_patch-410cf04bf9b09e65fee034cc3f2dd74acf2524abf881c6d6e559d5c62a615faf.css.gz +0 -0
  40. data/public/assets/foreman_patch/foreman_patch-84845e54f06d3a11189828e656432d587c7312358cdf694753da7b78b7dabcee.css +11 -0
  41. data/public/assets/foreman_patch/foreman_patch-84845e54f06d3a11189828e656432d587c7312358cdf694753da7b78b7dabcee.css.gz +0 -0
  42. data/public/assets/foreman_patch/foreman_patch-a76c5fd10a5795e97c5ae4c222bfdf4ab88da49d6a7659175dba79f8fc62ab47.css +82 -0
  43. data/public/assets/foreman_patch/foreman_patch-a76c5fd10a5795e97c5ae4c222bfdf4ab88da49d6a7659175dba79f8fc62ab47.css.gz +0 -0
  44. data/public/assets/foreman_patch/foreman_patch.json +1 -0
  45. data/public/assets/foreman_patch/plan_edit_windows-2eb04c7e83fa62797b0a14364d3ff5b3c4336983603fdc5a276b5464eeba7e60.js +9 -0
  46. data/public/assets/foreman_patch/plan_edit_windows-2eb04c7e83fa62797b0a14364d3ff5b3c4336983603fdc5a276b5464eeba7e60.js.gz +0 -0
  47. data/public/assets/foreman_patch/plan_edit_windows-ddedd3e70fb6ef761f636be2b7b35286e86d68e126bfc37294f9365a5171a928.js +9 -0
  48. data/public/assets/foreman_patch/plan_edit_windows-ddedd3e70fb6ef761f636be2b7b35286e86d68e126bfc37294f9365a5171a928.js.gz +0 -0
  49. data/public/webpack/foreman_patch/bundle.css +1 -0
  50. data/public/webpack/foreman_patch/bundle.js +34173 -0
  51. data/public/webpack/foreman_patch/foreman_patch.css +1 -0
  52. data/public/webpack/foreman_patch/foreman_patch.js +34366 -0
  53. data/public/webpack/foreman_patch/foreman_patch:global.css +1 -0
  54. data/public/webpack/foreman_patch/foreman_patch:global.js +32098 -0
  55. data/public/webpack/foreman_patch/manifest.json +25 -0
  56. data/public/webpack/foreman_patch/vendor.js +5201 -0
  57. data/webpack/components/Invocations/InvocationsPage.js +1 -1
  58. data/webpack/components/Invocations/index.js +6 -6
  59. data/webpack/components/common/Calendar/Calendar.css +76 -0
  60. data/webpack/components/common/Calendar/Calendar.js +5 -4
  61. data/webpack/components/common/Table/index.js +28 -0
  62. data/webpack/global_index.js +16 -0
  63. data/webpack/index.js +3 -8
  64. data/webpack/src/Components/Invocation/Invocation.js +67 -0
  65. data/webpack/src/Components/Invocation/InvocationLogFooter.js +30 -0
  66. data/webpack/src/Components/Invocation/InvocationLogToolbar.js +80 -0
  67. data/webpack/{components → src/Components}/Invocation/InvocationSelectors.js +0 -3
  68. data/webpack/src/Components/Invocation/index.js +62 -0
  69. data/webpack/src/Components/InvocationStatus.js +50 -0
  70. data/webpack/src/Components/Loading.js +51 -0
  71. data/webpack/src/Extends/index.js +15 -0
  72. data/webpack/src/Router/routes.js +4 -2
  73. data/webpack/src/reducers.js +1 -1
  74. metadata +57 -88
  75. data/app/lib/actions/foreman_patch/cycle/complete.rb +0 -41
  76. data/app/lib/actions/foreman_patch/cycle/plan.rb +0 -73
  77. data/app/lib/actions/foreman_patch/round/plan.rb +0 -33
  78. data/app/lib/actions/foreman_patch/window/plan.rb +0 -43
  79. data/app/models/setting/patching.rb +0 -57
  80. data/app/views/foreman_patch/api/v2/invocations/phase.json.rabl +0 -7
  81. data/config/routes/mount_engine.rb +0 -3
  82. data/config/routes/overrides.rb +0 -10
  83. data/lib/foreman_patch/plugin.rb +0 -47
  84. data/webpack/components/Invocation/Invocation.js +0 -47
  85. data/webpack/components/Invocation/index.js +0 -36
  86. data/webpack/components/common/Terminal/OutputLine.js +0 -26
  87. data/webpack/components/common/Terminal/Terminal.js +0 -115
  88. data/webpack/components/common/Terminal/Terminal.scss +0 -47
  89. data/webpack/src/ForemanPatch.js +0 -11
  90. data/webpack/src/Router/index.js +0 -14
  91. data/webpack/src/index.js +0 -1
  92. /data/{webpack/components/common/Calendar/Calendar.scss → public/assets/foreman_patch/calendar-b5391efda77239c4a4894e9f03f34610f6c8e2e748b2a147febfea814b857cdc.scss} +0 -0
  93. /data/webpack/components/Invocations/{Invocations.scss → Invocations.css} +0 -0
  94. /data/webpack/{components → src/Components}/Invocation/InvocationActions.js +0 -0
  95. /data/webpack/{components → src/Components}/Invocation/InvocationConsts.js +0 -0
metadata CHANGED
@@ -1,71 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_patch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.6.alpha4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Galens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-28 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: katello
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '4.1'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '4.1'
27
- - !ruby/object:Gem::Dependency
28
- name: foreman-tasks
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '4.0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '4.0'
41
- - !ruby/object:Gem::Dependency
42
- name: foreman_remote_execution
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '4.0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '4.0'
55
- - !ruby/object:Gem::Dependency
56
- name: rubocop
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: 0.80.0
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: 0.80.0
11
+ date: 2023-07-19 00:00:00.000000000 Z
12
+ dependencies: []
69
13
  description: Foreman Plugin for Managing Patching.
70
14
  email:
71
15
  - bogey.jlg@gmail.com
@@ -95,6 +39,7 @@ files:
95
39
  - app/controllers/foreman_patch/groups_controller.rb
96
40
  - app/controllers/foreman_patch/invocations_controller.rb
97
41
  - app/controllers/foreman_patch/plans_controller.rb
42
+ - app/controllers/foreman_patch/react_controller.rb
98
43
  - app/controllers/foreman_patch/rounds_controller.rb
99
44
  - app/controllers/foreman_patch/ticket_fields_controller.rb
100
45
  - app/controllers/foreman_patch/window_plans_controller.rb
@@ -108,24 +53,22 @@ files:
108
53
  - app/helpers/foreman_patch/window_patching_helper.rb
109
54
  - app/helpers/foreman_patch/window_plans_helper.rb
110
55
  - app/helpers/foreman_patch/windows_helper.rb
111
- - app/lib/actions/foreman_patch/cycle/complete.rb
112
56
  - app/lib/actions/foreman_patch/cycle/create.rb
113
57
  - app/lib/actions/foreman_patch/cycle/initiate.rb
114
- - app/lib/actions/foreman_patch/cycle/plan.rb
115
58
  - app/lib/actions/foreman_patch/cycle/prepare_content.rb
116
59
  - app/lib/actions/foreman_patch/host/reschedule.rb
117
60
  - app/lib/actions/foreman_patch/invocation/action.rb
118
61
  - app/lib/actions/foreman_patch/invocation/patch.rb
62
+ - app/lib/actions/foreman_patch/invocation/process_logging.rb
63
+ - app/lib/actions/foreman_patch/invocation/proxy_action.rb
119
64
  - app/lib/actions/foreman_patch/invocation/reschedule.rb
120
65
  - app/lib/actions/foreman_patch/invocation/wait_for_host.rb
121
66
  - app/lib/actions/foreman_patch/round/add_missing_hosts.rb
122
67
  - app/lib/actions/foreman_patch/round/create.rb
123
68
  - app/lib/actions/foreman_patch/round/patch.rb
124
- - app/lib/actions/foreman_patch/round/plan.rb
125
69
  - app/lib/actions/foreman_patch/round/resolve_hosts.rb
126
70
  - app/lib/actions/foreman_patch/window/create.rb
127
71
  - app/lib/actions/foreman_patch/window/patch.rb
128
- - app/lib/actions/foreman_patch/window/plan.rb
129
72
  - app/lib/actions/foreman_patch/window/publish.rb
130
73
  - app/lib/actions/foreman_patch/window/resolve_hosts.rb
131
74
  - app/lib/actions/middleware/check_exit_status.rb
@@ -135,6 +78,7 @@ files:
135
78
  - app/models/foreman_patch/concerns/group_facet_host_extensions.rb
136
79
  - app/models/foreman_patch/concerns/host_managed_extensions.rb
137
80
  - app/models/foreman_patch/cycle.rb
81
+ - app/models/foreman_patch/event.rb
138
82
  - app/models/foreman_patch/group.rb
139
83
  - app/models/foreman_patch/host/group_facet.rb
140
84
  - app/models/foreman_patch/invocation.rb
@@ -145,7 +89,6 @@ files:
145
89
  - app/models/foreman_patch/window.rb
146
90
  - app/models/foreman_patch/window_plan.rb
147
91
  - app/models/foreman_patch/window_task_group.rb
148
- - app/models/setting/patching.rb
149
92
  - app/services/foreman_patch/cycle_name_generator.rb
150
93
  - app/services/foreman_patch/ticket.rb
151
94
  - app/services/foreman_patch/ticket/affected_items.rb
@@ -168,8 +111,8 @@ files:
168
111
  - app/views/foreman_patch/api/v2/groups/show.json.rabl
169
112
  - app/views/foreman_patch/api/v2/groups/update.json.rabl
170
113
  - app/views/foreman_patch/api/v2/invocations/base.json.rabl
114
+ - app/views/foreman_patch/api/v2/invocations/event.json.rabl
171
115
  - app/views/foreman_patch/api/v2/invocations/index.json.rabl
172
- - app/views/foreman_patch/api/v2/invocations/phase.json.rabl
173
116
  - app/views/foreman_patch/api/v2/invocations/show.json.rabl
174
117
  - app/views/foreman_patch/api/v2/plans/base.json.rabl
175
118
  - app/views/foreman_patch/api/v2/plans/create.json.rabl
@@ -250,8 +193,6 @@ files:
250
193
  - config/initializers/pagelets.rb
251
194
  - config/initializers/safemode_jail.rb
252
195
  - config/routes.rb
253
- - config/routes/mount_engine.rb
254
- - config/routes/overrides.rb
255
196
  - db/migrate/20210202161304_create_foreman_patch_plans.rb
256
197
  - db/migrate/20210202163323_create_foreman_patch_cycles.rb
257
198
  - db/migrate/20210202164301_create_foreman_patch_groups.rb
@@ -274,12 +215,14 @@ files:
274
215
  - db/migrate/20220406110705_add_window_state.rb
275
216
  - db/migrate/20220407161120_add_round_status.rb
276
217
  - db/migrate/20220902134800_add_invocation_status.rb
218
+ - db/migrate/20230706092400_nullify_group_on_delete.rb
219
+ - db/migrate/20230707102800_create_invocation_events.rb
277
220
  - db/seeds.d/100-assign_features_with_templates.rb
278
221
  - db/seeds.d/160-mail_notifications.rb
279
222
  - db/seeds.d/75-job_templates.rb
280
223
  - lib/foreman_patch.rb
281
224
  - lib/foreman_patch/engine.rb
282
- - lib/foreman_patch/plugin.rb
225
+ - lib/foreman_patch/register.rb
283
226
  - lib/foreman_patch/version.rb
284
227
  - lib/tasks/foreman_patch_tasks.rake
285
228
  - locale/Makefile
@@ -287,6 +230,31 @@ files:
287
230
  - locale/foreman_patch.pot
288
231
  - locale/gemspec.rb
289
232
  - package.json
233
+ - public/assets/foreman_patch/calendar-b5391efda77239c4a4894e9f03f34610f6c8e2e748b2a147febfea814b857cdc.scss
234
+ - public/assets/foreman_patch/calendar-b5391efda77239c4a4894e9f03f34610f6c8e2e748b2a147febfea814b857cdc.scss.gz
235
+ - public/assets/foreman_patch/cycle_plans-e5667e178ba389908f5c815b24ec0ea77c340849d56bc39c5ce72bb626bd446a.scss
236
+ - public/assets/foreman_patch/cycle_plans-e5667e178ba389908f5c815b24ec0ea77c340849d56bc39c5ce72bb626bd446a.scss.gz
237
+ - public/assets/foreman_patch/cycle_plans-ff3d252119622a68828ff70f4a97328303963002237dbf850e92d6a706e93667.scss
238
+ - public/assets/foreman_patch/cycle_plans-ff3d252119622a68828ff70f4a97328303963002237dbf850e92d6a706e93667.scss.gz
239
+ - public/assets/foreman_patch/foreman_patch-410cf04bf9b09e65fee034cc3f2dd74acf2524abf881c6d6e559d5c62a615faf.css
240
+ - public/assets/foreman_patch/foreman_patch-410cf04bf9b09e65fee034cc3f2dd74acf2524abf881c6d6e559d5c62a615faf.css.gz
241
+ - public/assets/foreman_patch/foreman_patch-84845e54f06d3a11189828e656432d587c7312358cdf694753da7b78b7dabcee.css
242
+ - public/assets/foreman_patch/foreman_patch-84845e54f06d3a11189828e656432d587c7312358cdf694753da7b78b7dabcee.css.gz
243
+ - public/assets/foreman_patch/foreman_patch-a76c5fd10a5795e97c5ae4c222bfdf4ab88da49d6a7659175dba79f8fc62ab47.css
244
+ - public/assets/foreman_patch/foreman_patch-a76c5fd10a5795e97c5ae4c222bfdf4ab88da49d6a7659175dba79f8fc62ab47.css.gz
245
+ - public/assets/foreman_patch/foreman_patch.json
246
+ - public/assets/foreman_patch/plan_edit_windows-2eb04c7e83fa62797b0a14364d3ff5b3c4336983603fdc5a276b5464eeba7e60.js
247
+ - public/assets/foreman_patch/plan_edit_windows-2eb04c7e83fa62797b0a14364d3ff5b3c4336983603fdc5a276b5464eeba7e60.js.gz
248
+ - public/assets/foreman_patch/plan_edit_windows-ddedd3e70fb6ef761f636be2b7b35286e86d68e126bfc37294f9365a5171a928.js
249
+ - public/assets/foreman_patch/plan_edit_windows-ddedd3e70fb6ef761f636be2b7b35286e86d68e126bfc37294f9365a5171a928.js.gz
250
+ - public/webpack/foreman_patch/bundle.css
251
+ - public/webpack/foreman_patch/bundle.js
252
+ - public/webpack/foreman_patch/foreman_patch.css
253
+ - public/webpack/foreman_patch/foreman_patch.js
254
+ - public/webpack/foreman_patch/foreman_patch:global.css
255
+ - public/webpack/foreman_patch/foreman_patch:global.js
256
+ - public/webpack/foreman_patch/manifest.json
257
+ - public/webpack/foreman_patch/vendor.js
290
258
  - test/factories/foreman_patch_factories.rb
291
259
  - test/test_plugin_helper.rb
292
260
  - test/unit/foreman_patch_test.rb
@@ -301,13 +269,8 @@ files:
301
269
  - webpack/components/Groups/Groups.js
302
270
  - webpack/components/Groups/GroupsHelpers.js
303
271
  - webpack/components/Groups/Priority.js
304
- - webpack/components/Invocation/Invocation.js
305
- - webpack/components/Invocation/InvocationActions.js
306
- - webpack/components/Invocation/InvocationConsts.js
307
- - webpack/components/Invocation/InvocationSelectors.js
308
- - webpack/components/Invocation/index.js
272
+ - webpack/components/Invocations/Invocations.css
309
273
  - webpack/components/Invocations/Invocations.js
310
- - webpack/components/Invocations/Invocations.scss
311
274
  - webpack/components/Invocations/InvocationsConstants.js
312
275
  - webpack/components/Invocations/InvocationsHelpers.js
313
276
  - webpack/components/Invocations/InvocationsPage.js
@@ -336,8 +299,8 @@ files:
336
299
  - webpack/components/Rounds/components/RoundItem.js
337
300
  - webpack/components/Rounds/components/RoundStatus.js
338
301
  - webpack/components/Rounds/index.js
302
+ - webpack/components/common/Calendar/Calendar.css
339
303
  - webpack/components/common/Calendar/Calendar.js
340
- - webpack/components/common/Calendar/Calendar.scss
341
304
  - webpack/components/common/Calendar/CalendarConstants.js
342
305
  - webpack/components/common/Calendar/CalendarHelpers.js
343
306
  - webpack/components/common/Calendar/Day/index.js
@@ -349,14 +312,20 @@ files:
349
312
  - webpack/components/common/Calendar/View.js
350
313
  - webpack/components/common/Calendar/Week/index.js
351
314
  - webpack/components/common/Calendar/index.js
352
- - webpack/components/common/Terminal/OutputLine.js
353
- - webpack/components/common/Terminal/Terminal.js
354
- - webpack/components/common/Terminal/Terminal.scss
315
+ - webpack/components/common/Table/index.js
316
+ - webpack/global_index.js
355
317
  - webpack/index.js
356
- - webpack/src/ForemanPatch.js
357
- - webpack/src/Router/index.js
318
+ - webpack/src/Components/Invocation/Invocation.js
319
+ - webpack/src/Components/Invocation/InvocationActions.js
320
+ - webpack/src/Components/Invocation/InvocationConsts.js
321
+ - webpack/src/Components/Invocation/InvocationLogFooter.js
322
+ - webpack/src/Components/Invocation/InvocationLogToolbar.js
323
+ - webpack/src/Components/Invocation/InvocationSelectors.js
324
+ - webpack/src/Components/Invocation/index.js
325
+ - webpack/src/Components/InvocationStatus.js
326
+ - webpack/src/Components/Loading.js
327
+ - webpack/src/Extends/index.js
358
328
  - webpack/src/Router/routes.js
359
- - webpack/src/index.js
360
329
  - webpack/src/reducers.js
361
330
  homepage: https://github.com/ludovicus3/foreman_patch
362
331
  licenses:
@@ -368,20 +337,20 @@ require_paths:
368
337
  - lib
369
338
  required_ruby_version: !ruby/object:Gem::Requirement
370
339
  requirements:
371
- - - "~>"
340
+ - - ">="
372
341
  - !ruby/object:Gem::Version
373
- version: '2.5'
342
+ version: '0'
374
343
  required_rubygems_version: !ruby/object:Gem::Requirement
375
344
  requirements:
376
- - - ">="
345
+ - - ">"
377
346
  - !ruby/object:Gem::Version
378
- version: '0'
347
+ version: 1.3.1
379
348
  requirements: []
380
- rubygems_version: 3.3.25
349
+ rubygems_version: 3.1.6
381
350
  signing_key:
382
351
  specification_version: 4
383
352
  summary: Foreman Plugin for Managing Patching
384
353
  test_files:
385
- - test/test_plugin_helper.rb
386
- - test/factories/foreman_patch_factories.rb
387
354
  - test/unit/foreman_patch_test.rb
355
+ - test/factories/foreman_patch_factories.rb
356
+ - test/test_plugin_helper.rb
@@ -1,41 +0,0 @@
1
- module Actions
2
- module ForemanPatch
3
- module Cycle
4
- class Complete < Actions::EntryAction
5
-
6
- def delay(delay_options, cycle)
7
- action_subject(cycle)
8
-
9
- super delay_options, cycle
10
- end
11
-
12
- def plan(cycle)
13
- action_subject(cycle)
14
-
15
- plan_self
16
- end
17
-
18
- def finalize
19
- users = ::User.select { |user| user.receives?(:patch_cycle_completed) }.compact
20
-
21
- begin
22
- MailNotification[:patch_cycle_completed].deliver(users: users, cycle: cycle) unless users.blank?
23
- rescue => error
24
- Rails.logger.error(error)
25
- end
26
- end
27
-
28
- def humanized_name
29
- _('Complete Patch Cycle: %s') % input[:cycle][:name]
30
- end
31
-
32
- private
33
-
34
- def cycle
35
- @cycle ||= ::ForemanPatch::Cycle.find(input[:cycle][:id])
36
- end
37
-
38
- end
39
- end
40
- end
41
- end
@@ -1,73 +0,0 @@
1
- module Actions
2
- module ForemanPatch
3
- module Cycle
4
- class Plan < Actions::EntryAction
5
-
6
- def delay(delay_options, plan)
7
- input.update serialize_args(plan: plan)
8
- add_missing_task_group(plan)
9
-
10
- super delay_options, plan
11
- end
12
-
13
- def plan(plan)
14
- input.update serialize_args(plan: plan)
15
- add_missing_task_group(plan)
16
-
17
- sequence do
18
- creation = plan_action(::Actions::ForemanPatch::Cycle::Create, params(plan))
19
-
20
- concurrence do
21
- plan.window_plans.each do |window_plan|
22
- plan_action(::Actions::ForemanPatch::Window::Plan, window_plan, creation.output[:cycle])
23
- end
24
- end
25
-
26
- plan_self
27
- end
28
- end
29
-
30
- def run
31
- cycle_plan.start_date = cycle_plan.next_cycle_start
32
- cycle_plan.save!
33
- end
34
-
35
- def finalize
36
- cycle_plan.iterate if cycle_plan.active_count > 0
37
- end
38
-
39
- def humanized_name
40
- _('Plan cycle: %s') % input[:plan][:name]
41
- end
42
-
43
- private
44
-
45
- def cycle_plan
46
- @cycle_plan ||= ::ForemanPatch::Plan.find(input[:plan][:id])
47
- end
48
-
49
- def cycle
50
- @cycle ||= ::ForemanPatch::Cycle.find(input[:cycle][:id])
51
- end
52
-
53
- def params(plan)
54
- {
55
- plan_id: plan.id,
56
- name: ::ForemanPatch::CycleNameGenerator.generate(plan),
57
- start_date: plan.start_date.to_s,
58
- end_date: (plan.next_cycle_start - 1.day).to_s,
59
- }
60
- end
61
-
62
- def add_missing_task_group(plan)
63
- if plan.task_group.nil?
64
- plan.task_group = ::ForemanPatch::PlanTaskGroup.create!
65
- plan.save!
66
- end
67
- task.add_missing_task_groups(plan.task_group)
68
- end
69
-
70
- end
71
- end
72
- end
73
- end
@@ -1,33 +0,0 @@
1
- module Actions
2
- module ForemanPatch
3
- module Round
4
- class Plan < Actions::EntryAction
5
-
6
- def resource_locks
7
- :link
8
- end
9
-
10
- def plan(group, window)
11
- action_subject(group, window: window)
12
-
13
- action = plan_action(::Actions::ForemanPatch::Round::Create, params(group, window))
14
- plan_action(::Actions::ForemanPatch::Round::ResolveHosts, action.output[:round])
15
- end
16
-
17
- private
18
-
19
- def params(group, window)
20
- {
21
- window: window,
22
- group: group.to_action_input,
23
- name: group.name,
24
- description: group.description,
25
- priority: group.priority,
26
- max_unavailable: group.max_unavailable,
27
- }
28
- end
29
-
30
- end
31
- end
32
- end
33
- end
@@ -1,43 +0,0 @@
1
- module Actions
2
- module ForemanPatch
3
- module Window
4
- class Plan < Actions::EntryAction
5
-
6
- def plan(window_plan, cycle)
7
- input.update serialize_args(window_plan: window_plan, cycle: cycle)
8
-
9
- sequence do
10
- action = plan_action(::Actions::ForemanPatch::Window::Create, params(window_plan, cycle))
11
-
12
- concurrence do
13
- window_plan.groups.each do |group|
14
- plan_action(::Actions::ForemanPatch::Round::Plan, group, action.output[:window])
15
- end
16
- end
17
-
18
- plan_action(::Actions::ForemanPatch::Window::Publish, action.output[:window])
19
- end
20
- end
21
-
22
- def humanized_name
23
- _('Plan window: %s') % input[:window_plan][:name]
24
- end
25
-
26
- private
27
-
28
- def params(window_plan, cycle)
29
- {
30
- cycle: cycle,
31
- name: window_plan.name,
32
- description: window_plan.description,
33
- start_at: window_plan.start_at.to_s,
34
- end_by: window_plan.end_by.to_s,
35
- }
36
- end
37
-
38
- end
39
- end
40
- end
41
- end
42
-
43
-
@@ -1,57 +0,0 @@
1
- class Setting::Patching < ::Setting
2
- def self.default_settings
3
- http_proxy_select = [{
4
- name: _('Http Proxies'),
5
- class: 'HttpProxy',
6
- scope: 'all',
7
- value_method: 'name',
8
- text_method: 'name_and_url',
9
- }]
10
-
11
- time_zone_select = [{
12
- name: _('Time Zones'),
13
- class: 'ActiveSupport::TimeZone',
14
- scope: 'all',
15
- value_method: 'name',
16
- text_method: 'name',
17
- }]
18
-
19
- # set(name, description, default, fullname, value, { options })
20
- [
21
- self.set('host_max_wait_for_up', N_("Maximum seconds to wait for a host after patching restart."),
22
- 600, N_("Max wait for host up")),
23
- self.set('host_patch_timeout', N_("Maximum seconds for a patching invocation to run before timing out"),
24
- nil, N_('Patch Timeout')),
25
- self.set('patch_schedule_time_zone', N_('Time zone used to base patch window scheduling off of.'),
26
- 'UTC', N_('Patch Schedule Time Zone'), nil,
27
- collection: proc { time_zone_select }),
28
- self.set('ticket_api_host', N_('Host used for change management tickets'),
29
- nil, N_('Ticket API host')),
30
- self.set('ticket_api_proxy', N_('HTTP Proxy to access ticket API host'),
31
- nil, N_('Ticket API HTTP proxy'), nil,
32
- collection: proc { http_proxy_select }, include_blank: N_('no proxy')),
33
- self.set('ticket_api_user', N_('User with access to ticket API'),
34
- nil, N_('Ticket API user')),
35
- self.set('ticket_api_password', N_('Password for ticket API user'),
36
- nil, N_('Ticket API password'), nil, { encrypted: true }),
37
- self.set('ticket_api_path', N_('Ticket API path for REST/CRUD operations'),
38
- '/api/now/table/change_request', N_('Ticket API path')),
39
- self.set('ticket_web_ui_path', N_('Path for opening a ticket in the web UI'),
40
- '/change_request.do?sys_id=:id', N_('Ticket Web UI path')),
41
- self.set('ticket_label_field', N_('Name of the field used for the ticket label'),
42
- 'number', N_('Ticket label field')),
43
- self.set('ticket_id_field', N_('Name of the field used for the ticket id'),
44
- 'sys_id', N_('Ticket ID field')),
45
- self.set('skip_broken_patches', N_('Skip broken dependencies during patching'), true, N_('Skip broken patches'))
46
- ]
47
- end
48
-
49
- def self.humanized_category
50
- N_('Patching')
51
- end
52
-
53
- def self.load_defaults
54
- BLANK_ATTRS.concat %w(ticket_api_host ticket_api_proxy ticket_api_user ticket_api_password, host_patch_timeout)
55
- super
56
- end
57
- end
@@ -1,7 +0,0 @@
1
- object @phase
2
-
3
- attribute :label, :humanized_name, :exit_status
4
-
5
- node do |phase|
6
- { live_output: normalize_line_sets(phase.live_output) }
7
- end
@@ -1,3 +0,0 @@
1
- Foreman::Application.routes.draw do
2
- mount ForemanPatch::Engine, at: '/', as: 'foreman_patch'
3
- end
@@ -1,10 +0,0 @@
1
- Foreman::Application.routes.draw do
2
-
3
- resources :hosts, only: [] do
4
- collection do
5
- post 'select_multiple_patch_group'
6
- post 'update_multiple_patch_group'
7
- end
8
- end
9
-
10
- end
@@ -1,47 +0,0 @@
1
- Foreman::Plugin.register :foreman_patch do
2
- requires_foreman '>= 2.1'
3
-
4
- apipie_documented_controllers(["#{ForemanPatch::Engine.root}/app/controllers/foreman_patch/api/v2/*.rb"])
5
-
6
- register_facet ForemanPatch::Host::GroupFacet, :group_facet do
7
- api_view list: 'foreman_patch/api/v2/group_facet/base_with_root', single: 'foreman_patch/api/v2/group_facet/show'
8
- api_docs :group_facet_attributes, ::ForemanPatch::Api::V2::HostGroupsController
9
- extend_model ForemanPatch::Concerns::GroupFacetHostExtensions
10
- set_dependent_action :destroy
11
- end
12
-
13
- # Add permissions
14
- security_block :foreman_patch do
15
- end
16
-
17
- divider :top_menu, caption: N_('Patching'), parent: :content_menu
18
- menu :top_menu, :groups,
19
- caption: N_('Groups'),
20
- engine: ForemanPatch::Engine,
21
- parent: :content_menu
22
-
23
- menu :top_menu, :cycles,
24
- caption: N_('Cycles'),
25
- engine: ForemanPatch::Engine,
26
- parent: :content_menu
27
-
28
- menu :top_menu, :plans,
29
- caption: N_('Plans'),
30
- engine: ForemanPatch::Engine,
31
- parent: :content_menu
32
-
33
- menu :top_menu, :ticket_fields,
34
- caption: N_('Ticket Fields'),
35
- engine: ForemanPatch::Engine,
36
- parent: :content_menu
37
-
38
- parameter_filter ::Host::Managed, :group_facet_attributes => [:group_id]
39
-
40
- describe_host do
41
- multiple_actions_provider :patch_host_multiple_actions
42
- overview_fields_provider :patch_host_overview_fields
43
- end
44
-
45
- RemoteExecutionFeature.register(:power_action, N_("Power Action"), description: N_("Power Action"), provided_inputs: ['action'])
46
- RemoteExecutionFeature.register(:ensure_services, N_("Ensure Services"), description: N_("Ensure Services are running"))
47
- end
@@ -1,47 +0,0 @@
1
- import React, { useState } from 'react';
2
- import PropTypes from 'prop-types';
3
- import { translate as __ } from 'foremanReact/common/I18n';
4
- import { Tabs, Tab, TabTitleText, LoadingState } from 'patternfly-react';
5
- import { STATUS } from 'foremanReact/constants';
6
-
7
- import Terminal from '../common/Terminal/Terminal';
8
-
9
- const Invocation = ({ invocation, status }) => {
10
- if (status === STATUS.ERROR) {
11
- return (
12
- <Alert type="error">
13
- {__(
14
- 'There was an error loading the invocation, try refreshing the page.'
15
- )}
16
- </Alert>
17
- );
18
- }
19
-
20
- const [activeTabKey, setActiveTabKey] = useState(0);
21
-
22
- const handleTabClick = (event, tabIndex) => {
23
- setActiveTabKey(tabIndex);
24
- };
25
-
26
- return (
27
- <LoadingState loading={status == STATUS.PENDING}>
28
- <Tabs activeKey={activeTabKey} onSelect={handleTabClick}>
29
- <Tab eventKey={0} title={<TabTitleText>Overview</TabTitleText>}>
30
- TODO: status
31
- </Tab>
32
- {invocation.phases.map((phase, index) => (
33
- <Tab event={index + 1} title={<TabTitleText>{phase.humanized_name}</TabTitleText>}>
34
- <Terminal key={phase.label} linesets={phase.live_output}/>
35
- </Tab>
36
- ))}
37
- </Tabs>
38
- </LoadingState>
39
- );
40
- };
41
-
42
- Invocation.propTypes = {
43
- status: PropTypes.string.isRequired,
44
- invocation: PropTypes.object.isRequired,
45
- };
46
-
47
- export default Invocation;
@@ -1,36 +0,0 @@
1
- import React { useEffect, useState } from 'react';
2
- import { useSelector, useDispatch } from 'react-redux';
3
- import { stopInterval } from 'foremanReact/redux/middlewares/IntervalMiddleware';
4
- import Invocation from './Invocation';
5
- import {
6
- selectInvocation,
7
- selectState,
8
- selectStatus,
9
- } from './InvocationSelectors';
10
- import { getData } from './InvocationActions';
11
- import { INVOCATION } from './InvocationsConsts';
12
-
13
- const WrappedInvocation = () => {
14
- const dispatch = useDispatch();
15
- const state = useSelector(selectState);
16
- const invocation = useSelector(selectInvocation);
17
- const status = useSelector(selectStatus);
18
-
19
- useEffect(() => {
20
- dispatch(getData());
21
-
22
- return () => {
23
- dispatch(stopInterval(INVOCATION));
24
- };
25
- }, [dispatch]);
26
-
27
- useEffect(() => {
28
- if (state === 'stopped') {
29
- dispatch(stopInterval(INVOCATION));
30
- }
31
- }, [state, dispatch]);
32
-
33
- return <Invocation invocation={invocation} status={status}/>
34
- };
35
-
36
- export default WrappedInvocation;