foreman_patch 1.1.5 → 1.1.6.alpha5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) 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/helpers/foreman_patch/hosts_helper.rb +1 -1
  5. data/app/lib/actions/foreman_patch/cycle/create.rb +5 -1
  6. data/app/lib/actions/foreman_patch/cycle/initiate.rb +5 -1
  7. data/app/lib/actions/foreman_patch/invocation/action.rb +23 -29
  8. data/app/lib/actions/foreman_patch/invocation/patch.rb +16 -7
  9. data/app/lib/actions/foreman_patch/invocation/process_logging.rb +44 -0
  10. data/app/lib/actions/foreman_patch/invocation/proxy_action.rb +52 -0
  11. data/app/lib/actions/foreman_patch/invocation/wait_for_host.rb +4 -29
  12. data/app/lib/actions/foreman_patch/round/patch.rb +5 -1
  13. data/app/lib/actions/foreman_patch/window/publish.rb +5 -1
  14. data/app/lib/actions/foreman_patch/window/resolve_hosts.rb +5 -1
  15. data/app/models/foreman_patch/event.rb +13 -0
  16. data/app/models/foreman_patch/invocation.rb +2 -4
  17. data/app/views/foreman_patch/api/v2/invocations/base.json.rabl +1 -1
  18. data/app/views/foreman_patch/api/v2/invocations/event.json.rabl +3 -0
  19. data/app/views/foreman_patch/api/v2/invocations/show.json.rabl +2 -2
  20. data/app/views/foreman_patch/groups/index.html.erb +1 -1
  21. data/app/views/foreman_patch/invocations/show.html.erb +1 -26
  22. data/app/views/foreman_patch/layouts/react.html.erb +1 -1
  23. data/config/api_routes.rb +26 -28
  24. data/config/routes.rb +40 -29
  25. data/db/migrate/20230706092400_nullify_group_on_delete.rb +11 -0
  26. data/db/migrate/20230707102800_create_invocation_events.rb +16 -0
  27. data/db/seeds.d/100-assign_features_with_templates.rb +6 -12
  28. data/lib/foreman_patch/engine.rb +11 -46
  29. data/lib/foreman_patch/register.rb +119 -0
  30. data/lib/foreman_patch/version.rb +1 -1
  31. data/locale/en/foreman_patch.po +1 -1
  32. data/locale/foreman_patch.pot +1 -1
  33. data/locale/gemspec.rb +1 -1
  34. data/package.json +4 -0
  35. data/public/assets/foreman_patch/cycle_plans-ff3d252119622a68828ff70f4a97328303963002237dbf850e92d6a706e93667.scss +6 -0
  36. data/public/assets/foreman_patch/cycle_plans-ff3d252119622a68828ff70f4a97328303963002237dbf850e92d6a706e93667.scss.gz +0 -0
  37. data/public/assets/foreman_patch/foreman_patch-be2e2ba89548f4a490612e8a6cd1cdebc0473be89f8023a3df7612f05a75d301.css +1 -0
  38. data/public/assets/foreman_patch/foreman_patch-be2e2ba89548f4a490612e8a6cd1cdebc0473be89f8023a3df7612f05a75d301.css.gz +0 -0
  39. data/public/assets/foreman_patch/foreman_patch.json +1 -0
  40. data/public/assets/foreman_patch/plan_edit_windows-9ba20f84f3ecf2c4eb903acd57d30ee3e16f023a79db30bc614aa22f26442ce3.js +1 -0
  41. data/public/assets/foreman_patch/plan_edit_windows-9ba20f84f3ecf2c4eb903acd57d30ee3e16f023a79db30bc614aa22f26442ce3.js.gz +0 -0
  42. data/public/webpack/foreman_patch/bundle-831173d6ae39953b2409.css +1 -0
  43. data/public/webpack/foreman_patch/bundle-831173d6ae39953b2409.css.gz +0 -0
  44. data/public/webpack/foreman_patch/bundle-831173d6ae39953b2409.js +6 -0
  45. data/public/webpack/foreman_patch/bundle-831173d6ae39953b2409.js.gz +0 -0
  46. data/public/webpack/foreman_patch/bundle-831173d6ae39953b2409.js.map +1 -0
  47. data/public/webpack/foreman_patch/bundle-831173d6ae39953b2409.js.map.gz +0 -0
  48. data/public/webpack/foreman_patch/foreman_patch-8909c3e06f012a43f769.css +1 -0
  49. data/public/webpack/foreman_patch/foreman_patch-8909c3e06f012a43f769.css.gz +0 -0
  50. data/public/webpack/foreman_patch/foreman_patch-8909c3e06f012a43f769.js +6 -0
  51. data/public/webpack/foreman_patch/foreman_patch-8909c3e06f012a43f769.js.gz +0 -0
  52. data/public/webpack/foreman_patch/foreman_patch-8909c3e06f012a43f769.js.map +1 -0
  53. data/public/webpack/foreman_patch/foreman_patch-8909c3e06f012a43f769.js.map.gz +0 -0
  54. data/public/webpack/foreman_patch/foreman_patch:global-d71cc6e1e759f04f631a.css +1 -0
  55. data/public/webpack/foreman_patch/foreman_patch:global-d71cc6e1e759f04f631a.css.gz +0 -0
  56. data/public/webpack/foreman_patch/foreman_patch:global-d71cc6e1e759f04f631a.js +6 -0
  57. data/public/webpack/foreman_patch/foreman_patch:global-d71cc6e1e759f04f631a.js.gz +0 -0
  58. data/public/webpack/foreman_patch/foreman_patch:global-d71cc6e1e759f04f631a.js.map +1 -0
  59. data/public/webpack/foreman_patch/foreman_patch:global-d71cc6e1e759f04f631a.js.map.gz +0 -0
  60. data/public/webpack/foreman_patch/manifest.json +31 -0
  61. data/public/webpack/foreman_patch/manifest.json.gz +0 -0
  62. data/public/webpack/foreman_patch/vendor-769bd77f6be96c3c37e1.js +2 -0
  63. data/public/webpack/foreman_patch/vendor-769bd77f6be96c3c37e1.js.gz +0 -0
  64. data/public/webpack/foreman_patch/vendor-769bd77f6be96c3c37e1.js.map +1 -0
  65. data/public/webpack/foreman_patch/vendor-769bd77f6be96c3c37e1.js.map.gz +0 -0
  66. data/webpack/components/Invocations/InvocationsPage.js +1 -1
  67. data/webpack/components/Invocations/index.js +6 -6
  68. data/webpack/components/common/Calendar/Calendar.js +5 -4
  69. data/webpack/components/common/Table/index.js +28 -0
  70. data/webpack/global_index.js +16 -0
  71. data/webpack/index.js +3 -8
  72. data/webpack/src/Components/Invocation/Invocation.js +67 -0
  73. data/webpack/src/Components/Invocation/InvocationLogFooter.js +30 -0
  74. data/webpack/src/Components/Invocation/InvocationLogToolbar.js +80 -0
  75. data/webpack/{components → src/Components}/Invocation/InvocationSelectors.js +0 -3
  76. data/webpack/src/Components/Invocation/index.js +62 -0
  77. data/webpack/src/Components/InvocationStatus.js +50 -0
  78. data/webpack/src/Components/Loading.js +51 -0
  79. data/webpack/src/Extends/index.js +15 -0
  80. data/webpack/src/Router/routes.js +4 -2
  81. data/webpack/src/reducers.js +1 -1
  82. metadata +61 -86
  83. data/app/lib/actions/foreman_patch/cycle/complete.rb +0 -41
  84. data/app/lib/actions/foreman_patch/cycle/plan.rb +0 -73
  85. data/app/lib/actions/foreman_patch/round/plan.rb +0 -33
  86. data/app/lib/actions/foreman_patch/window/plan.rb +0 -43
  87. data/app/models/setting/patching.rb +0 -57
  88. data/app/views/foreman_patch/api/v2/invocations/phase.json.rabl +0 -7
  89. data/config/routes/mount_engine.rb +0 -3
  90. data/config/routes/overrides.rb +0 -10
  91. data/lib/foreman_patch/plugin.rb +0 -47
  92. data/webpack/components/Invocation/Invocation.js +0 -47
  93. data/webpack/components/Invocation/index.js +0 -36
  94. data/webpack/components/common/Terminal/OutputLine.js +0 -26
  95. data/webpack/components/common/Terminal/Terminal.js +0 -115
  96. data/webpack/components/common/Terminal/Terminal.scss +0 -47
  97. data/webpack/src/ForemanPatch.js +0 -11
  98. data/webpack/src/Router/index.js +0 -14
  99. data/webpack/src/index.js +0 -1
  100. /data/webpack/components/Invocations/{Invocations.scss → Invocations.css} +0 -0
  101. /data/webpack/components/common/Calendar/{Calendar.scss → Calendar.css} +0 -0
  102. /data/webpack/{components → src/Components}/Invocation/InvocationActions.js +0 -0
  103. /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.5
4
+ version: 1.1.6.alpha5
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-05-01 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-21 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,37 @@ files:
287
230
  - locale/foreman_patch.pot
288
231
  - locale/gemspec.rb
289
232
  - package.json
233
+ - public/assets/foreman_patch/cycle_plans-ff3d252119622a68828ff70f4a97328303963002237dbf850e92d6a706e93667.scss
234
+ - public/assets/foreman_patch/cycle_plans-ff3d252119622a68828ff70f4a97328303963002237dbf850e92d6a706e93667.scss.gz
235
+ - public/assets/foreman_patch/foreman_patch-be2e2ba89548f4a490612e8a6cd1cdebc0473be89f8023a3df7612f05a75d301.css
236
+ - public/assets/foreman_patch/foreman_patch-be2e2ba89548f4a490612e8a6cd1cdebc0473be89f8023a3df7612f05a75d301.css.gz
237
+ - public/assets/foreman_patch/foreman_patch.json
238
+ - public/assets/foreman_patch/plan_edit_windows-9ba20f84f3ecf2c4eb903acd57d30ee3e16f023a79db30bc614aa22f26442ce3.js
239
+ - public/assets/foreman_patch/plan_edit_windows-9ba20f84f3ecf2c4eb903acd57d30ee3e16f023a79db30bc614aa22f26442ce3.js.gz
240
+ - public/webpack/foreman_patch/bundle-831173d6ae39953b2409.css
241
+ - public/webpack/foreman_patch/bundle-831173d6ae39953b2409.css.gz
242
+ - public/webpack/foreman_patch/bundle-831173d6ae39953b2409.js
243
+ - public/webpack/foreman_patch/bundle-831173d6ae39953b2409.js.gz
244
+ - public/webpack/foreman_patch/bundle-831173d6ae39953b2409.js.map
245
+ - public/webpack/foreman_patch/bundle-831173d6ae39953b2409.js.map.gz
246
+ - public/webpack/foreman_patch/foreman_patch-8909c3e06f012a43f769.css
247
+ - public/webpack/foreman_patch/foreman_patch-8909c3e06f012a43f769.css.gz
248
+ - public/webpack/foreman_patch/foreman_patch-8909c3e06f012a43f769.js
249
+ - public/webpack/foreman_patch/foreman_patch-8909c3e06f012a43f769.js.gz
250
+ - public/webpack/foreman_patch/foreman_patch-8909c3e06f012a43f769.js.map
251
+ - public/webpack/foreman_patch/foreman_patch-8909c3e06f012a43f769.js.map.gz
252
+ - public/webpack/foreman_patch/foreman_patch:global-d71cc6e1e759f04f631a.css
253
+ - public/webpack/foreman_patch/foreman_patch:global-d71cc6e1e759f04f631a.css.gz
254
+ - public/webpack/foreman_patch/foreman_patch:global-d71cc6e1e759f04f631a.js
255
+ - public/webpack/foreman_patch/foreman_patch:global-d71cc6e1e759f04f631a.js.gz
256
+ - public/webpack/foreman_patch/foreman_patch:global-d71cc6e1e759f04f631a.js.map
257
+ - public/webpack/foreman_patch/foreman_patch:global-d71cc6e1e759f04f631a.js.map.gz
258
+ - public/webpack/foreman_patch/manifest.json
259
+ - public/webpack/foreman_patch/manifest.json.gz
260
+ - public/webpack/foreman_patch/vendor-769bd77f6be96c3c37e1.js
261
+ - public/webpack/foreman_patch/vendor-769bd77f6be96c3c37e1.js.gz
262
+ - public/webpack/foreman_patch/vendor-769bd77f6be96c3c37e1.js.map
263
+ - public/webpack/foreman_patch/vendor-769bd77f6be96c3c37e1.js.map.gz
290
264
  - test/factories/foreman_patch_factories.rb
291
265
  - test/test_plugin_helper.rb
292
266
  - test/unit/foreman_patch_test.rb
@@ -301,13 +275,8 @@ files:
301
275
  - webpack/components/Groups/Groups.js
302
276
  - webpack/components/Groups/GroupsHelpers.js
303
277
  - 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
278
+ - webpack/components/Invocations/Invocations.css
309
279
  - webpack/components/Invocations/Invocations.js
310
- - webpack/components/Invocations/Invocations.scss
311
280
  - webpack/components/Invocations/InvocationsConstants.js
312
281
  - webpack/components/Invocations/InvocationsHelpers.js
313
282
  - webpack/components/Invocations/InvocationsPage.js
@@ -336,8 +305,8 @@ files:
336
305
  - webpack/components/Rounds/components/RoundItem.js
337
306
  - webpack/components/Rounds/components/RoundStatus.js
338
307
  - webpack/components/Rounds/index.js
308
+ - webpack/components/common/Calendar/Calendar.css
339
309
  - webpack/components/common/Calendar/Calendar.js
340
- - webpack/components/common/Calendar/Calendar.scss
341
310
  - webpack/components/common/Calendar/CalendarConstants.js
342
311
  - webpack/components/common/Calendar/CalendarHelpers.js
343
312
  - webpack/components/common/Calendar/Day/index.js
@@ -349,14 +318,20 @@ files:
349
318
  - webpack/components/common/Calendar/View.js
350
319
  - webpack/components/common/Calendar/Week/index.js
351
320
  - 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
321
+ - webpack/components/common/Table/index.js
322
+ - webpack/global_index.js
355
323
  - webpack/index.js
356
- - webpack/src/ForemanPatch.js
357
- - webpack/src/Router/index.js
324
+ - webpack/src/Components/Invocation/Invocation.js
325
+ - webpack/src/Components/Invocation/InvocationActions.js
326
+ - webpack/src/Components/Invocation/InvocationConsts.js
327
+ - webpack/src/Components/Invocation/InvocationLogFooter.js
328
+ - webpack/src/Components/Invocation/InvocationLogToolbar.js
329
+ - webpack/src/Components/Invocation/InvocationSelectors.js
330
+ - webpack/src/Components/Invocation/index.js
331
+ - webpack/src/Components/InvocationStatus.js
332
+ - webpack/src/Components/Loading.js
333
+ - webpack/src/Extends/index.js
358
334
  - webpack/src/Router/routes.js
359
- - webpack/src/index.js
360
335
  - webpack/src/reducers.js
361
336
  homepage: https://github.com/ludovicus3/foreman_patch
362
337
  licenses:
@@ -368,16 +343,16 @@ require_paths:
368
343
  - lib
369
344
  required_ruby_version: !ruby/object:Gem::Requirement
370
345
  requirements:
371
- - - "~>"
346
+ - - ">="
372
347
  - !ruby/object:Gem::Version
373
- version: '2.5'
348
+ version: '0'
374
349
  required_rubygems_version: !ruby/object:Gem::Requirement
375
350
  requirements:
376
- - - ">="
351
+ - - ">"
377
352
  - !ruby/object:Gem::Version
378
- version: '0'
353
+ version: 1.3.1
379
354
  requirements: []
380
- rubygems_version: 3.3.25
355
+ rubygems_version: 3.1.6
381
356
  signing_key:
382
357
  specification_version: 4
383
358
  summary: Foreman Plugin for Managing Patching
@@ -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;