foreman-tasks 3.0.4 → 4.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby_tests.yml +5 -3
  3. data/app/controllers/foreman_tasks/api/tasks_controller.rb +2 -5
  4. data/app/lib/actions/entry_action.rb +8 -4
  5. data/app/lib/actions/helpers/lock.rb +11 -5
  6. data/app/lib/actions/middleware/keep_current_request_id.rb +4 -1
  7. data/app/lib/actions/middleware/keep_current_user.rb +11 -1
  8. data/app/lib/actions/observable_action.rb +80 -0
  9. data/app/lib/actions/proxy_action.rb +2 -4
  10. data/app/models/foreman_tasks/concerns/action_subject.rb +0 -6
  11. data/app/models/foreman_tasks/link.rb +60 -0
  12. data/app/models/foreman_tasks/lock.rb +30 -128
  13. data/app/models/foreman_tasks/task.rb +20 -7
  14. data/app/models/foreman_tasks/task/search.rb +7 -6
  15. data/app/views/foreman_tasks/api/locks/show.json.rabl +4 -0
  16. data/app/views/foreman_tasks/api/tasks/details.json.rabl +5 -3
  17. data/app/views/foreman_tasks/tasks/_lock_card.html.erb +10 -0
  18. data/db/migrate/20180927120509_add_user_id.foreman_tasks.rb +4 -2
  19. data/db/migrate/20181206123910_create_foreman_tasks_links.foreman_tasks.rb +26 -0
  20. data/db/migrate/20181206124952_migrate_non_exclusive_locks_to_links.foreman_tasks.rb +14 -0
  21. data/db/migrate/20181206131436_drop_old_locks.foreman_tasks.rb +20 -0
  22. data/db/migrate/20181206131627_make_locks_exclusive.foreman_tasks.rb +25 -0
  23. data/lib/foreman_tasks/cleaner.rb +10 -0
  24. data/lib/foreman_tasks/engine.rb +5 -2
  25. data/lib/foreman_tasks/tasks/export_tasks.rake +2 -2
  26. data/lib/foreman_tasks/version.rb +1 -1
  27. data/package.json +6 -6
  28. data/test/controllers/api/tasks_controller_test.rb +1 -1
  29. data/test/controllers/tasks_controller_test.rb +3 -3
  30. data/test/core/unit/runner_test.rb +4 -17
  31. data/test/factories/task_factory.rb +31 -4
  32. data/test/unit/actions/action_with_sub_plans_test.rb +5 -2
  33. data/test/unit/actions/proxy_action_test.rb +4 -1
  34. data/test/unit/cleaner_test.rb +4 -4
  35. data/test/unit/locking_test.rb +85 -0
  36. data/test/unit/task_test.rb +15 -13
  37. data/test/unit/triggering_test.rb +2 -2
  38. data/webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js +2 -2
  39. data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskInfo.js +3 -2
  40. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Locks.test.js.snap +4 -4
  41. data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskInfo.test.js.snap +2 -0
  42. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetails.js +4 -1
  43. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetails.scss +5 -1
  44. data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsSelectors.js +3 -0
  45. data/webpack/ForemanTasks/Components/TaskDetails/index.js +2 -0
  46. data/webpack/ForemanTasks/Components/TasksTable/TasksTablePage.scss +4 -3
  47. data/webpack/ForemanTasks/Components/TasksTable/__tests__/__snapshots__/TasksTablePage.test.js.snap +2 -2
  48. data/webpack/ForemanTasks/Components/TasksTable/formatters/__test__/__snapshots__/actionNameCellFormatter.test.js.snap +2 -3
  49. data/webpack/ForemanTasks/Components/TasksTable/formatters/actionNameCellFormatter.js +2 -3
  50. metadata +12 -4
  51. data/test/unit/lock_test.rb +0 -22
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
2
  import { cellFormatter } from 'foremanReact/components/common/table';
3
- import EllipsisWithTooltip from 'react-ellipsis-with-tooltip';
4
3
 
5
4
  export const actionNameCellFormatter = url => (value, { rowData: { id } }) =>
6
5
  cellFormatter(
7
- <a href={`/${url}/${id}`}>
8
- <EllipsisWithTooltip>{value}</EllipsisWithTooltip>
6
+ <a href={`/${url}/${id}`} className="action-name-tasks-table">
7
+ {value}
9
8
  </a>
10
9
  );
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: 3.0.4
4
+ version: 4.1.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: 2021-02-19 00:00:00.000000000 Z
11
+ date: 2021-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dynflow
@@ -170,6 +170,7 @@ files:
170
170
  - app/lib/actions/middleware/rails_executor_wrap.rb
171
171
  - app/lib/actions/middleware/recurring_logic.rb
172
172
  - app/lib/actions/middleware/watch_delegated_proxy_sub_tasks.rb
173
+ - app/lib/actions/observable_action.rb
173
174
  - app/lib/actions/proxy_action.rb
174
175
  - app/lib/actions/recurring_action.rb
175
176
  - app/lib/actions/serializers/active_record_serializer.rb
@@ -179,6 +180,7 @@ files:
179
180
  - app/models/foreman_tasks/concerns/action_triggering.rb
180
181
  - app/models/foreman_tasks/concerns/host_action_subject.rb
181
182
  - app/models/foreman_tasks/concerns/user_extensions.rb
183
+ - app/models/foreman_tasks/link.rb
182
184
  - app/models/foreman_tasks/lock.rb
183
185
  - app/models/foreman_tasks/recurring_logic.rb
184
186
  - app/models/foreman_tasks/recurring_logic_cancelled_exception.rb
@@ -204,6 +206,7 @@ files:
204
206
  - app/services/ui_notifications/tasks/task_paused_admin.rb
205
207
  - app/services/ui_notifications/tasks/task_paused_owner.rb
206
208
  - app/views/common/_trigger_form.html.erb
209
+ - app/views/foreman_tasks/api/locks/show.json.rabl
207
210
  - app/views/foreman_tasks/api/recurring_logics/base.json.rabl
208
211
  - app/views/foreman_tasks/api/recurring_logics/index.json.rabl
209
212
  - app/views/foreman_tasks/api/recurring_logics/main.json.rabl
@@ -220,6 +223,7 @@ files:
220
223
  - app/views/foreman_tasks/task_groups/_detail.html.erb
221
224
  - app/views/foreman_tasks/task_groups/_tab_related.html.erb
222
225
  - app/views/foreman_tasks/task_groups/recurring_logic_task_groups/_recurring_logic_task_group.html.erb
226
+ - app/views/foreman_tasks/tasks/_lock_card.html.erb
223
227
  - app/views/foreman_tasks/tasks/dashboard/_latest_tasks_in_error_warning.html.erb
224
228
  - app/views/foreman_tasks/tasks/dashboard/_tasks_status.html.erb
225
229
  - app/views/foreman_tasks/tasks/show.html.erb
@@ -246,6 +250,10 @@ files:
246
250
  - db/migrate/20180216092715_use_uuid.rb
247
251
  - db/migrate/20180927120509_add_user_id.foreman_tasks.rb
248
252
  - db/migrate/20181019135324_add_remote_task_operation.rb
253
+ - db/migrate/20181206123910_create_foreman_tasks_links.foreman_tasks.rb
254
+ - db/migrate/20181206124952_migrate_non_exclusive_locks_to_links.foreman_tasks.rb
255
+ - db/migrate/20181206131436_drop_old_locks.foreman_tasks.rb
256
+ - db/migrate/20181206131627_make_locks_exclusive.foreman_tasks.rb
249
257
  - db/migrate/20190318153925_add_task_state_updated_at.foreman_tasks.rb
250
258
  - db/migrate/20200517215015_rename_bookmarks_controller.rb
251
259
  - db/migrate/20200519093217_drop_dynflow_allow_dangerous_actions_setting.foreman_tasks.rb
@@ -327,7 +335,7 @@ files:
327
335
  - test/unit/config/environment.rb
328
336
  - test/unit/dashboard_table_filter_test.rb
329
337
  - test/unit/dynflow_console_authorizer_test.rb
330
- - test/unit/lock_test.rb
338
+ - test/unit/locking_test.rb
331
339
  - test/unit/otp_manager_test.rb
332
340
  - test/unit/proxy_selector_test.rb
333
341
  - test/unit/recurring_logic_test.rb
@@ -642,7 +650,7 @@ test_files:
642
650
  - test/unit/config/environment.rb
643
651
  - test/unit/dashboard_table_filter_test.rb
644
652
  - test/unit/dynflow_console_authorizer_test.rb
645
- - test/unit/lock_test.rb
653
+ - test/unit/locking_test.rb
646
654
  - test/unit/otp_manager_test.rb
647
655
  - test/unit/proxy_selector_test.rb
648
656
  - test/unit/recurring_logic_test.rb
@@ -1,22 +0,0 @@
1
- require 'ostruct'
2
- require 'foreman_tasks_test_helper'
3
-
4
- module ForemanTasks
5
- class LockTest < ::ActiveSupport::TestCase
6
- describe ::ForemanTasks::Lock::LockConflict do
7
- class FakeLockConflict < ForemanTasks::Lock::LockConflict
8
- def _(val)
9
- val.freeze
10
- end
11
- end
12
-
13
- it 'does not modify frozen strings' do
14
- required_lock = OpenStruct.new(:name => 'my_lock')
15
- # Before #21770 the next line would raise
16
- # RuntimeError: can't modify frozen String
17
- conflict = FakeLockConflict.new(required_lock, [])
18
- assert conflict._('this should be frozen').frozen?
19
- end
20
- end
21
- end
22
- end