foreman-tasks 9.1.1 → 9.2.1
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_tests.yml +2 -0
- data/.rubocop.yml +6 -35
- data/.rubocop_todo.yml +216 -24
- data/Gemfile +2 -17
- data/app/controllers/foreman_tasks/tasks_controller.rb +8 -9
- data/app/models/foreman_tasks/task/dynflow_task.rb +4 -0
- data/foreman-tasks.gemspec +1 -1
- data/lib/foreman_tasks/tasks/export_tasks.rake +2 -2
- data/lib/foreman_tasks/version.rb +1 -1
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsActions.js +3 -1
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsActions.test.js +0 -5
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b19a7608533279dea1ba293836c165f19f9aefcb8399bfde70c152251dbe6520
|
4
|
+
data.tar.gz: d4d528b42660eb71218ec50f96565647f7f068269f207523cc5f92bc8bfb1234
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbcee41ec2f46e7bf3e287222891713a9f43591485a5a6a2e183816a407950c25df6252d6a08ef861c4f5b7a2938bc3ca964fd9423941a805170543b871d191a
|
7
|
+
data.tar.gz: aca23feb27880694acc7322e55b225fa7c8fc61e4d57f3f14c82295edf42813b79b4dbe660d482902060638f17c85a1ebd39b036eadcddb44dbc5c7d5fd08921
|
data/.rubocop.yml
CHANGED
@@ -1,10 +1,9 @@
|
|
1
|
-
require:
|
2
|
-
- rubocop-minitest
|
3
|
-
- rubocop-performance
|
4
|
-
- rubocop-rails
|
5
|
-
|
6
1
|
inherit_from: .rubocop_todo.yml
|
7
2
|
|
3
|
+
inherit_gem:
|
4
|
+
theforeman-rubocop:
|
5
|
+
- lenient.yml
|
6
|
+
|
8
7
|
AllCops:
|
9
8
|
Exclude:
|
10
9
|
- 'node_modules/**/*'
|
@@ -15,25 +14,10 @@ AllCops:
|
|
15
14
|
Lint/ShadowingOuterLocalVariable:
|
16
15
|
Enabled: false
|
17
16
|
|
18
|
-
Rails:
|
19
|
-
Enabled: true
|
20
|
-
|
21
|
-
# Don't prefer is_a? over kind_of?
|
22
|
-
Style/ClassCheck:
|
23
|
-
Enabled: false
|
24
|
-
|
25
|
-
# Don't enforce documentation
|
26
|
-
Style/Documentation:
|
27
|
-
Enabled: false
|
28
|
-
|
29
17
|
# Support both ruby19 and hash_rockets
|
30
18
|
Style/HashSyntax:
|
31
19
|
Enabled: false
|
32
20
|
|
33
|
-
# Both double and single quotes are OK
|
34
|
-
Style/StringLiterals:
|
35
|
-
Enabled: false
|
36
|
-
|
37
21
|
# Don't enforce frozen string literals
|
38
22
|
Style/FrozenStringLiteralComment:
|
39
23
|
Enabled: false
|
@@ -61,21 +45,17 @@ Layout/LineLength:
|
|
61
45
|
|
62
46
|
Naming/FileName:
|
63
47
|
Exclude:
|
64
|
-
-
|
48
|
+
- "*.gemspec"
|
65
49
|
- Gemfile
|
66
50
|
- db/seeds.d/*
|
67
51
|
- lib/foreman-tasks.rb
|
68
52
|
- gemfile.d/foreman-tasks.rb
|
69
53
|
|
70
|
-
|
71
54
|
Layout/HeredocIndentation:
|
72
55
|
Exclude:
|
73
|
-
-
|
56
|
+
- "*.gemspec"
|
74
57
|
- bin/*
|
75
58
|
|
76
|
-
Layout/EmptyLineAfterGuardClause:
|
77
|
-
Enabled: false
|
78
|
-
|
79
59
|
Style/RescueStandardError:
|
80
60
|
Enabled: false
|
81
61
|
|
@@ -111,12 +91,3 @@ Rails/HelperInstanceVariable:
|
|
111
91
|
|
112
92
|
Naming/RescuedExceptionsVariableName:
|
113
93
|
Enabled: false
|
114
|
-
|
115
|
-
Style/WordArray:
|
116
|
-
Enabled: false
|
117
|
-
|
118
|
-
Style/TrailingCommaInArrayLiteral:
|
119
|
-
EnforcedStyleForMultiline: comma
|
120
|
-
|
121
|
-
Style/TrailingCommaInHashLiteral:
|
122
|
-
EnforcedStyleForMultiline: comma
|
data/.rubocop_todo.yml
CHANGED
@@ -1,35 +1,95 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2024-04-12 08:56:48 UTC using RuboCop version 1.23.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
9
|
+
# Offense count: 1
|
10
10
|
# Configuration parameters: Include.
|
11
11
|
# Include: **/*.gemspec
|
12
12
|
Gemspec/RequiredRubyVersion:
|
13
13
|
Exclude:
|
14
14
|
- 'foreman-tasks.gemspec'
|
15
15
|
|
16
|
+
# Offense count: 106
|
17
|
+
# Cop supports --auto-correct.
|
18
|
+
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
19
|
+
# SupportedStyles: with_first_argument, with_fixed_indentation
|
20
|
+
Layout/ArgumentAlignment:
|
21
|
+
Enabled: false
|
22
|
+
|
23
|
+
# Offense count: 5
|
24
|
+
# Cop supports --auto-correct.
|
25
|
+
# Configuration parameters: EnforcedStyleAlignWith, Severity.
|
26
|
+
# SupportedStylesAlignWith: start_of_line, begin
|
27
|
+
Layout/BeginEndAlignment:
|
28
|
+
Exclude:
|
29
|
+
- 'app/models/foreman_tasks/remote_task.rb'
|
30
|
+
- 'app/models/foreman_tasks/task/dynflow_task.rb'
|
31
|
+
- 'lib/tasks/gettext.rake'
|
32
|
+
- 'test/unit/actions/proxy_action_test.rb'
|
33
|
+
|
34
|
+
# Offense count: 3
|
35
|
+
# Cop supports --auto-correct.
|
36
|
+
# Configuration parameters: AllowAliasSyntax, AllowedMethods.
|
37
|
+
# AllowedMethods: alias_method, public, protected, private
|
38
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
39
|
+
Exclude:
|
40
|
+
- 'app/models/foreman_tasks/lock.rb'
|
41
|
+
- 'lib/foreman_tasks/cleaner.rb'
|
42
|
+
- 'lib/foreman_tasks/triggers.rb'
|
43
|
+
|
44
|
+
# Offense count: 1
|
45
|
+
# Cop supports --auto-correct.
|
46
|
+
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
47
|
+
# SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
|
48
|
+
Layout/FirstArgumentIndentation:
|
49
|
+
Exclude:
|
50
|
+
- 'test/support/dummy_dynflow_action.rb'
|
51
|
+
|
52
|
+
# Offense count: 4
|
53
|
+
# Cop supports --auto-correct.
|
54
|
+
Layout/RescueEnsureAlignment:
|
55
|
+
Exclude:
|
56
|
+
- 'app/models/foreman_tasks/remote_task.rb'
|
57
|
+
- 'lib/foreman_tasks/cleaner.rb'
|
58
|
+
- 'lib/tasks/gettext.rake'
|
59
|
+
- 'test/unit/actions/proxy_action_test.rb'
|
60
|
+
|
61
|
+
# Offense count: 8
|
62
|
+
# Configuration parameters: AllowedMethods.
|
63
|
+
# AllowedMethods: enums
|
64
|
+
Lint/ConstantDefinitionInBlock:
|
65
|
+
Exclude:
|
66
|
+
- 'lib/foreman_tasks/tasks/export_tasks.rake'
|
67
|
+
- 'lib/foreman_tasks/tasks/generate_task_actions.rake'
|
68
|
+
- 'test/controllers/api/tasks_controller_test.rb'
|
69
|
+
- 'test/unit/cleaner_test.rb'
|
70
|
+
- 'test/unit/locking_test.rb'
|
71
|
+
|
72
|
+
# Offense count: 5
|
73
|
+
Lint/MissingSuper:
|
74
|
+
Exclude:
|
75
|
+
- 'app/lib/actions/helpers/humanizer.rb'
|
76
|
+
- 'app/services/ui_notifications/tasks.rb'
|
77
|
+
- 'app/services/ui_notifications/tasks/task_bulk_cancel.rb'
|
78
|
+
- 'app/services/ui_notifications/tasks/task_bulk_resume.rb'
|
79
|
+
- 'app/services/ui_notifications/tasks/task_bulk_stop.rb'
|
80
|
+
|
16
81
|
# Offense count: 1
|
17
82
|
Lint/UselessAssignment:
|
18
83
|
Exclude:
|
19
84
|
- 'lib/foreman_tasks/tasks/export_tasks.rake'
|
20
85
|
|
21
86
|
# Offense count: 1
|
22
|
-
#
|
23
|
-
|
24
|
-
Naming/FileName:
|
87
|
+
# Cop supports --auto-correct.
|
88
|
+
Minitest/AssertEmptyLiteral:
|
25
89
|
Exclude:
|
26
|
-
- '
|
27
|
-
- 'Gemfile'
|
28
|
-
- 'db/seeds.d/*'
|
29
|
-
- 'lib/foreman-tasks.rb'
|
30
|
-
- 'gemfile.d/foreman-tasks.rb'
|
90
|
+
- 'test/unit/cleaner_test.rb'
|
31
91
|
|
32
|
-
# Offense count:
|
92
|
+
# Offense count: 2
|
33
93
|
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
|
34
94
|
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
|
35
95
|
Naming/MemoizedInstanceVariableName:
|
@@ -52,9 +112,15 @@ Naming/MethodParameterName:
|
|
52
112
|
# MethodDefinitionMacros: define_method, define_singleton_method
|
53
113
|
Naming/PredicateName:
|
54
114
|
Exclude:
|
55
|
-
- 'spec/**/*'
|
56
115
|
- 'app/models/foreman_tasks/task/status_explicator.rb'
|
57
116
|
|
117
|
+
# Offense count: 2
|
118
|
+
# Configuration parameters: MinSize.
|
119
|
+
Performance/CollectionLiteralInLoop:
|
120
|
+
Exclude:
|
121
|
+
- 'app/lib/actions/middleware/watch_delegated_proxy_sub_tasks.rb'
|
122
|
+
- 'db/seeds.d/61-foreman_tasks_bookmarks.rb'
|
123
|
+
|
58
124
|
# Offense count: 6
|
59
125
|
# Configuration parameters: Include.
|
60
126
|
# Include: db/migrate/*.rb
|
@@ -67,6 +133,7 @@ Rails/CreateTableWithTimestamps:
|
|
67
133
|
- 'db/migrate/20151112152108_create_triggerings.rb'
|
68
134
|
|
69
135
|
# Offense count: 1
|
136
|
+
# Cop supports --auto-correct.
|
70
137
|
# Configuration parameters: Include.
|
71
138
|
# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb
|
72
139
|
Rails/Output:
|
@@ -78,18 +145,47 @@ Rails/OutputSafety:
|
|
78
145
|
Exclude:
|
79
146
|
- 'app/helpers/foreman_tasks/foreman_tasks_helper.rb'
|
80
147
|
|
81
|
-
# Offense count:
|
148
|
+
# Offense count: 1
|
149
|
+
# Cop supports --auto-correct.
|
150
|
+
Rails/Pick:
|
151
|
+
Exclude:
|
152
|
+
- 'app/lib/actions/helpers/lifecycle_logging.rb'
|
153
|
+
|
154
|
+
# Offense count: 1
|
155
|
+
# Cop supports --auto-correct.
|
82
156
|
# Configuration parameters: Include.
|
83
157
|
# Include: **/Rakefile, **/*.rake
|
84
158
|
Rails/RakeEnvironment:
|
85
159
|
Exclude:
|
86
|
-
- 'lib/capistrano/tasks/**/*.rake'
|
87
160
|
- 'lib/foreman_tasks/tasks/dynflow.rake'
|
88
|
-
- 'lib/foreman_tasks/tasks/test.rake'
|
89
161
|
|
90
|
-
# Offense count:
|
162
|
+
# Offense count: 1
|
163
|
+
# Cop supports --auto-correct.
|
164
|
+
Rails/RedundantForeignKey:
|
165
|
+
Exclude:
|
166
|
+
- 'app/models/foreman_tasks/triggering.rb'
|
167
|
+
|
168
|
+
# Offense count: 2
|
169
|
+
# Cop supports --auto-correct.
|
170
|
+
# Configuration parameters: EnforcedStyle.
|
171
|
+
# SupportedStyles: separated, grouped
|
172
|
+
Style/AccessorGrouping:
|
173
|
+
Exclude:
|
174
|
+
- 'lib/foreman_tasks/task_error.rb'
|
175
|
+
|
176
|
+
# Offense count: 4
|
177
|
+
# Cop supports --auto-correct.
|
178
|
+
# Configuration parameters: EnforcedStyle.
|
179
|
+
# SupportedStyles: prefer_alias, prefer_alias_method
|
180
|
+
Style/Alias:
|
181
|
+
Exclude:
|
182
|
+
- 'app/models/foreman_tasks/concerns/action_triggering.rb'
|
183
|
+
- 'app/models/foreman_tasks/task.rb'
|
184
|
+
- 'app/models/foreman_tasks/task_groups/recurring_logic_task_group.rb'
|
185
|
+
|
186
|
+
# Offense count: 10
|
91
187
|
# Cop supports --auto-correct.
|
92
|
-
# Configuration parameters:
|
188
|
+
# Configuration parameters: EnforcedStyle.
|
93
189
|
# SupportedStyles: nested, compact
|
94
190
|
Style/ClassAndModuleChildren:
|
95
191
|
Exclude:
|
@@ -98,21 +194,117 @@ Style/ClassAndModuleChildren:
|
|
98
194
|
- 'app/models/foreman_tasks/task/status_explicator.rb'
|
99
195
|
- 'app/models/foreman_tasks/task/summarizer.rb'
|
100
196
|
- 'app/models/foreman_tasks/task/task_cancelled_exception.rb'
|
101
|
-
- 'app/models/setting/foreman_tasks.rb'
|
102
197
|
- 'lib/foreman_tasks/dynflow/configuration.rb'
|
103
198
|
- 'lib/foreman_tasks/dynflow/console_authorizer.rb'
|
104
|
-
- 'lib/foreman_tasks/dynflow/persistence.rb'
|
105
199
|
- 'test/controllers/api/recurring_logics_controller_test.rb'
|
106
200
|
- 'test/controllers/api/tasks_controller_test.rb'
|
107
201
|
|
202
|
+
# Offense count: 3
|
203
|
+
# Cop supports --auto-correct.
|
204
|
+
# Configuration parameters: IgnoredMethods.
|
205
|
+
# IgnoredMethods: ==, equal?, eql?
|
206
|
+
Style/ClassEqualityComparison:
|
207
|
+
Exclude:
|
208
|
+
- 'app/lib/actions/proxy_action.rb'
|
209
|
+
- 'app/models/foreman_tasks/task/dynflow_task.rb'
|
210
|
+
- 'lib/foreman_tasks/test_extensions.rb'
|
211
|
+
|
108
212
|
# Offense count: 1
|
213
|
+
# Cop supports --auto-correct.
|
214
|
+
# Configuration parameters: Keywords, RequireColon.
|
215
|
+
# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE
|
216
|
+
Style/CommentAnnotation:
|
217
|
+
Exclude:
|
218
|
+
- 'app/models/foreman_tasks/task.rb'
|
219
|
+
|
220
|
+
# Offense count: 14
|
221
|
+
# Cop supports --auto-correct.
|
109
222
|
# Configuration parameters: EnforcedStyle.
|
110
|
-
# SupportedStyles:
|
111
|
-
Style/
|
223
|
+
# SupportedStyles: compact, expanded
|
224
|
+
Style/EmptyMethod:
|
112
225
|
Exclude:
|
113
|
-
- 'app/
|
226
|
+
- 'app/controllers/foreman_tasks/api/recurring_logics_controller.rb'
|
227
|
+
- 'app/controllers/foreman_tasks/api/tasks_controller.rb'
|
228
|
+
- 'app/controllers/foreman_tasks/recurring_logics_controller.rb'
|
229
|
+
- 'app/lib/actions/helpers/humanizer.rb'
|
230
|
+
- 'app/models/foreman_tasks/concerns/action_triggering.rb'
|
231
|
+
- 'test/lib/actions/middleware/keep_current_taxonomies_test.rb'
|
232
|
+
- 'test/lib/actions/middleware/keep_current_timezone_test.rb'
|
233
|
+
- 'test/lib/actions/middleware/keep_current_user_test.rb'
|
234
|
+
- 'test/unit/actions/action_with_sub_plans_test.rb'
|
114
235
|
|
115
|
-
# Offense count:
|
236
|
+
# Offense count: 6
|
237
|
+
# Cop supports --auto-correct.
|
238
|
+
Style/ExplicitBlockArgument:
|
239
|
+
Exclude:
|
240
|
+
- 'app/lib/actions/middleware/keep_current_request_id.rb'
|
241
|
+
- 'app/lib/actions/middleware/keep_current_taxonomies.rb'
|
242
|
+
- 'app/lib/actions/middleware/keep_current_timezone.rb'
|
243
|
+
- 'app/lib/actions/middleware/keep_current_user.rb'
|
244
|
+
- 'app/lib/actions/middleware/watch_delegated_proxy_sub_tasks.rb'
|
245
|
+
- 'lib/foreman_tasks.rb'
|
246
|
+
|
247
|
+
# Offense count: 31
|
116
248
|
# Configuration parameters: MinBodyLength.
|
117
249
|
Style/GuardClause:
|
118
|
-
|
250
|
+
Exclude:
|
251
|
+
- 'app/lib/actions/bulk_action.rb'
|
252
|
+
- 'app/lib/actions/entry_action.rb'
|
253
|
+
- 'app/lib/actions/helpers/humanizer.rb'
|
254
|
+
- 'app/lib/actions/helpers/with_delegated_action.rb'
|
255
|
+
- 'app/lib/actions/proxy_action.rb'
|
256
|
+
- 'app/models/foreman_tasks/concerns/action_triggering.rb'
|
257
|
+
- 'app/models/foreman_tasks/concerns/user_extensions.rb'
|
258
|
+
- 'app/models/foreman_tasks/task/dynflow_task.rb'
|
259
|
+
- 'app/models/foreman_tasks/triggering.rb'
|
260
|
+
- 'db/migrate/20161003091412_add_missing_indexes.rb'
|
261
|
+
- 'db/migrate/20180216092715_use_uuid.rb'
|
262
|
+
- 'lib/foreman_tasks/dynflow/console_authorizer.rb'
|
263
|
+
- 'lib/foreman_tasks/tasks/export_tasks.rake'
|
264
|
+
- 'lib/foreman_tasks/test_extensions.rb'
|
265
|
+
- 'test/controllers/api/tasks_controller_test.rb'
|
266
|
+
|
267
|
+
# Offense count: 2
|
268
|
+
# Configuration parameters: MinBranchesCount.
|
269
|
+
Style/HashLikeCase:
|
270
|
+
Exclude:
|
271
|
+
- 'app/models/foreman_tasks/recurring_logic.rb'
|
272
|
+
- 'app/models/foreman_tasks/task.rb'
|
273
|
+
|
274
|
+
# Offense count: 6
|
275
|
+
# Configuration parameters: AllowedMethods.
|
276
|
+
# AllowedMethods: respond_to_missing?
|
277
|
+
Style/OptionalBooleanParameter:
|
278
|
+
Exclude:
|
279
|
+
- 'app/helpers/foreman_tasks/foreman_tasks_helper.rb'
|
280
|
+
- 'app/lib/actions/proxy_action.rb'
|
281
|
+
- 'app/models/foreman_tasks/task/dynflow_task.rb'
|
282
|
+
- 'lib/foreman_tasks/cleaner.rb'
|
283
|
+
- 'test/controllers/api/tasks_controller_test.rb'
|
284
|
+
- 'test/lib/actions/middleware/keep_current_request_id_test.rb'
|
285
|
+
|
286
|
+
# Offense count: 2
|
287
|
+
# Cop supports --auto-correct.
|
288
|
+
Style/RedundantAssignment:
|
289
|
+
Exclude:
|
290
|
+
- 'bin/dynflow-executor'
|
291
|
+
- 'lib/foreman_tasks/cleaner.rb'
|
292
|
+
|
293
|
+
# Offense count: 2
|
294
|
+
# Cop supports --auto-correct.
|
295
|
+
Style/RedundantBegin:
|
296
|
+
Exclude:
|
297
|
+
- 'app/models/foreman_tasks/task/dynflow_task.rb'
|
298
|
+
|
299
|
+
# Offense count: 2
|
300
|
+
# Cop supports --auto-correct.
|
301
|
+
Style/SlicingWithRange:
|
302
|
+
Exclude:
|
303
|
+
- 'test/unit/task_test.rb'
|
304
|
+
|
305
|
+
# Offense count: 1
|
306
|
+
# Cop supports --auto-correct.
|
307
|
+
# Configuration parameters: AllowModifier.
|
308
|
+
Style/SoleNestedConditional:
|
309
|
+
Exclude:
|
310
|
+
- 'app/lib/actions/task_synchronization.rb'
|
data/Gemfile
CHANGED
@@ -1,20 +1,5 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
-
|
4
|
-
# Bundler will treat runtime dependencies like base dependencies, and
|
5
|
-
# development dependencies will be added by default to the :development group.
|
3
|
+
gemspec
|
6
4
|
|
7
|
-
|
8
|
-
|
9
|
-
# Declare any dependencies that are still in development here instead of in
|
10
|
-
# your gemspec. These might include edge Rails or gems from your path or
|
11
|
-
# Git. Remember to move these dependencies to your gemspec before releasing
|
12
|
-
# your gem to rubygems.org.
|
13
|
-
|
14
|
-
# To use debugger
|
15
|
-
# gem 'debugger'
|
16
|
-
|
17
|
-
gem 'rubocop', '~> 0.87'
|
18
|
-
gem 'rubocop-minitest', '~> 0.9.0'
|
19
|
-
gem 'rubocop-performance', '~> 1.5.2'
|
20
|
-
gem 'rubocop-rails', '~> 2.5.2'
|
5
|
+
gem 'theforeman-rubocop', '~> 0.1.0'
|
@@ -69,7 +69,7 @@ module ForemanTasks
|
|
69
69
|
|
70
70
|
def unlock
|
71
71
|
if @dynflow_task.paused?
|
72
|
-
|
72
|
+
@dynflow_task.halt
|
73
73
|
render json: { statusText: 'OK' }
|
74
74
|
else
|
75
75
|
render json: {}, status: :bad_request
|
@@ -77,8 +77,13 @@ module ForemanTasks
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def force_unlock
|
80
|
-
|
81
|
-
|
80
|
+
if @dynflow_task.pending?
|
81
|
+
@dynflow_task.halt
|
82
|
+
render json: { statusText: 'OK' }
|
83
|
+
else
|
84
|
+
# Cannot halt an already stopped task
|
85
|
+
render json: {}, status: :bad_request
|
86
|
+
end
|
82
87
|
end
|
83
88
|
|
84
89
|
# we need do this to make the Foreman helpers working properly
|
@@ -92,12 +97,6 @@ module ForemanTasks
|
|
92
97
|
|
93
98
|
private
|
94
99
|
|
95
|
-
def unlock_task(task)
|
96
|
-
task.state = :stopped
|
97
|
-
task.locks.destroy_all
|
98
|
-
task.save!
|
99
|
-
end
|
100
|
-
|
101
100
|
def respond_with_tasks(scope)
|
102
101
|
@tasks = filter(scope, paginate: false).with_duration
|
103
102
|
csv_response(@tasks, [:id, :action, :state, :result, 'started_at.in_time_zone', 'ended_at.in_time_zone', :duration, :username], ['Id', 'Action', 'State', 'Result', 'Started At', 'Ended At', 'Duration', 'User'])
|
data/foreman-tasks.gemspec
CHANGED
@@ -26,7 +26,7 @@ same resource. It also optionally provides Dynflow infrastructure for using it f
|
|
26
26
|
s.test_files = `git ls-files test`.split("\n")
|
27
27
|
s.extra_rdoc_files = Dir['README*', 'LICENSE']
|
28
28
|
|
29
|
-
s.add_dependency "dynflow", '>= 1.
|
29
|
+
s.add_dependency "dynflow", '>= 1.9.0'
|
30
30
|
s.add_dependency 'fugit', '~> 1.8'
|
31
31
|
s.add_dependency "get_process_mem" # for memory polling
|
32
32
|
s.add_dependency "sinatra" # for Dynflow web console
|
@@ -51,7 +51,7 @@ namespace :foreman_tasks do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def template(filename)
|
54
|
-
File.join(Gem::Specification.find_by_name('dynflow').gem_dir, 'web', 'views', "#{filename}.erb")
|
54
|
+
File.join(Gem::Specification.find_by_name('dynflow').gem_dir, 'web', 'views', "#{filename}.erb")
|
55
55
|
end
|
56
56
|
|
57
57
|
def erb(file, options = {})
|
@@ -216,7 +216,7 @@ namespace :foreman_tasks do
|
|
216
216
|
'javascripts/application.js',
|
217
217
|
'vendor/bootstrap/css/bootstrap.css',
|
218
218
|
'stylesheets/application.css'].each do |file|
|
219
|
-
filename = File.join(Gem::Specification.find_by_name('dynflow').gem_dir, 'web', 'assets', file)
|
219
|
+
filename = File.join(Gem::Specification.find_by_name('dynflow').gem_dir, 'web', 'assets', file)
|
220
220
|
FileUtils.copy_file(filename, File.join(tmp_dir, File.basename(file)))
|
221
221
|
end
|
222
222
|
end
|
@@ -42,7 +42,9 @@ export const cancelStep = (taskId, stepId) => async dispatch => {
|
|
42
42
|
key: TASK_STEP_CANCEL,
|
43
43
|
url: foremanTasksPath(`${taskId}/cancel_step?step_id=${stepId}`),
|
44
44
|
handleSuccess: () => {
|
45
|
-
dispatch(
|
45
|
+
dispatch(
|
46
|
+
addToast(successToastData(`${stepId} ${__('Step Canceled')}`))
|
47
|
+
);
|
46
48
|
},
|
47
49
|
handleError: error => {
|
48
50
|
dispatch(
|
@@ -1,15 +1,10 @@
|
|
1
1
|
import { testActionSnapshotWithFixtures } from '@theforeman/test';
|
2
|
-
import { API } from 'foremanReact/redux/API';
|
3
2
|
import {
|
4
3
|
taskReloadStop,
|
5
4
|
taskReloadStart,
|
6
5
|
cancelStep,
|
7
6
|
} from '../TaskDetailsActions';
|
8
7
|
|
9
|
-
jest.mock('foremanReact/redux/API');
|
10
|
-
|
11
|
-
API.post.mockImplementation(async () => ({ data: 'some-data' }));
|
12
|
-
|
13
8
|
const fixtures = {
|
14
9
|
'should start reload': () => taskReloadStart(1),
|
15
10
|
'should stop reload': () => taskReloadStop(),
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.
|
4
|
+
version: 9.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Nečas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dynflow
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.9.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.9.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: fugit
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -628,7 +628,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
628
628
|
- !ruby/object:Gem::Version
|
629
629
|
version: '0'
|
630
630
|
requirements: []
|
631
|
-
rubygems_version: 3.
|
631
|
+
rubygems_version: 3.2.33
|
632
632
|
signing_key:
|
633
633
|
specification_version: 4
|
634
634
|
summary: Foreman plugin for showing tasks information for resources and users
|