job-workflow 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -2
  3. data/CHANGELOG.md +30 -0
  4. data/README.md +1 -1
  5. data/app/controllers/job_workflow/monitoring/application_controller.rb +11 -0
  6. data/app/controllers/job_workflow/monitoring/executions_controller.rb +28 -0
  7. data/app/controllers/job_workflow/monitoring/workflows_controller.rb +11 -0
  8. data/app/views/job_workflow/monitoring/executions/index.html.erb +57 -0
  9. data/app/views/job_workflow/monitoring/executions/show.html.erb +200 -0
  10. data/app/views/job_workflow/monitoring/workflows/index.html.erb +39 -0
  11. data/app/views/layouts/job_workflow/monitoring/application.html.erb +117 -0
  12. data/config/routes.rb +8 -0
  13. data/guides/API_REFERENCE.md +79 -6
  14. data/guides/DEPENDENCY_WAIT.md +9 -5
  15. data/guides/MONITORING_UI.md +74 -0
  16. data/guides/PARALLEL_PROCESSING.md +33 -21
  17. data/guides/PRODUCTION_DEPLOYMENT.md +1 -1
  18. data/guides/README.md +6 -1
  19. data/guides/THROTTLING.md +24 -0
  20. data/guides/WORKFLOW_STATUS_QUERY.md +7 -1
  21. data/lib/job_workflow/context.rb +68 -6
  22. data/lib/job_workflow/dsl.rb +1 -5
  23. data/lib/job_workflow/instrumentation/opentelemetry_subscriber.rb +1 -1
  24. data/lib/job_workflow/instrumentation.rb +14 -14
  25. data/lib/job_workflow/job_status.rb +16 -1
  26. data/lib/job_workflow/monitoring/dag_layout.rb +186 -0
  27. data/lib/job_workflow/monitoring/engine.rb +15 -0
  28. data/lib/job_workflow/monitoring/execution_page.rb +16 -0
  29. data/lib/job_workflow/monitoring/execution_registry.rb +50 -0
  30. data/lib/job_workflow/monitoring/execution_view_model.rb +262 -0
  31. data/lib/job_workflow/monitoring/parameter_filter.rb +37 -0
  32. data/lib/job_workflow/monitoring/workflow_definition.rb +24 -0
  33. data/lib/job_workflow/monitoring/workflow_registry.rb +24 -0
  34. data/lib/job_workflow/monitoring.rb +120 -0
  35. data/lib/job_workflow/queue_adapters/abstract.rb +7 -2
  36. data/lib/job_workflow/queue_adapters/null_adapter.rb +12 -1
  37. data/lib/job_workflow/queue_adapters/solid_queue_adapter.rb +42 -12
  38. data/lib/job_workflow/railtie.rb +12 -0
  39. data/lib/job_workflow/runner.rb +38 -15
  40. data/lib/job_workflow/sub_task_job.rb +93 -0
  41. data/lib/job_workflow/task.rb +7 -0
  42. data/lib/job_workflow/task_enqueue.rb +19 -12
  43. data/lib/job_workflow/version.rb +1 -1
  44. data/lib/job_workflow/workflow_status.rb +20 -1
  45. data/lib/job_workflow.rb +5 -1
  46. data/sig/generated/job_workflow/context.rbs +31 -7
  47. data/sig/generated/job_workflow/instrumentation/opentelemetry_subscriber.rbs +0 -1
  48. data/sig/generated/job_workflow/instrumentation.rbs +28 -28
  49. data/sig/generated/job_workflow/job_status.rbs +5 -2
  50. data/sig/generated/job_workflow/monitoring/dag_layout.rbs +80 -0
  51. data/sig/generated/job_workflow/monitoring/engine.rbs +8 -0
  52. data/sig/generated/job_workflow/monitoring/execution_page.rbs +14 -0
  53. data/sig/generated/job_workflow/monitoring/execution_registry.rbs +21 -0
  54. data/sig/generated/job_workflow/monitoring/execution_view_model.rbs +111 -0
  55. data/sig/generated/job_workflow/monitoring/parameter_filter.rbs +16 -0
  56. data/sig/generated/job_workflow/monitoring/workflow_definition.rbs +18 -0
  57. data/sig/generated/job_workflow/monitoring/workflow_registry.rbs +13 -0
  58. data/sig/generated/job_workflow/monitoring.rbs +38 -0
  59. data/sig/generated/job_workflow/queue_adapters/abstract.rbs +7 -4
  60. data/sig/generated/job_workflow/queue_adapters/null_adapter.rbs +5 -2
  61. data/sig/generated/job_workflow/queue_adapters/solid_queue_adapter.rbs +18 -6
  62. data/sig/generated/job_workflow/railtie.rbs +6 -0
  63. data/sig/generated/job_workflow/runner.rbs +8 -5
  64. data/sig/generated/job_workflow/sub_task_job.rbs +40 -0
  65. data/sig/generated/job_workflow/task.rbs +5 -0
  66. data/sig/generated/job_workflow/task_enqueue.rbs +5 -8
  67. data/sig/generated/job_workflow/workflow_status.rbs +6 -0
  68. data/sig-private/job-workflow.rbs +11 -0
  69. data/sig-private/rails.rbs +5 -0
  70. metadata +34 -1
data/lib/job_workflow.rb CHANGED
@@ -31,6 +31,7 @@ require_relative "job_workflow/task"
31
31
  require_relative "job_workflow/task_graph"
32
32
  require_relative "job_workflow/schedule"
33
33
  require_relative "job_workflow/dsl"
34
+ require_relative "job_workflow/sub_task_job"
34
35
  require_relative "job_workflow/runner"
35
36
  require_relative "job_workflow/workflow_status"
36
37
  require_relative "job_workflow/workflow"
@@ -44,7 +45,11 @@ require_relative "job_workflow/output_def"
44
45
  require_relative "job_workflow/task_output"
45
46
  require_relative "job_workflow/output"
46
47
  require_relative "job_workflow/queue"
48
+ require_relative "job_workflow/monitoring"
47
49
  require_relative "job_workflow/auto_scaling"
50
+ # :nocov:
51
+ require_relative "job_workflow/railtie" if defined?(Rails::Railtie)
52
+ # :nocov:
48
53
 
49
54
  module JobWorkflow
50
55
  class Error < StandardError; end
@@ -53,6 +58,5 @@ module JobWorkflow
53
58
 
54
59
  Instrumentation::LogSubscriber.attach!
55
60
 
56
- ActiveSupport.on_load(:solid_queue) { QueueAdapter.current.initialize_adapter! }
57
61
  QueueAdapter.current.initialize_adapter!
58
62
  end
@@ -3,6 +3,8 @@
3
3
  module JobWorkflow
4
4
  class Context
5
5
  # rubocop:disable Metrics/ClassLength
6
+ EACH_TASK_CURSOR_MARKER: ::String
7
+
6
8
  attr_reader workflow: Workflow
7
9
 
8
10
  attr_reader arguments: Arguments
@@ -23,9 +25,9 @@ module JobWorkflow
23
25
  # task_context: TaskContext,
24
26
  # output: Output,
25
27
  # job_status: JobStatus,
26
- # ?job: DSL?
28
+ # ?job: _JobInterface?
27
29
  # ) -> void
28
- def initialize: (workflow: Workflow, arguments: Arguments, task_context: TaskContext, output: Output, job_status: JobStatus, ?job: DSL?) -> void
30
+ def initialize: (workflow: Workflow, arguments: Arguments, task_context: TaskContext, output: Output, job_status: JobStatus, ?job: _JobInterface?) -> void
29
31
 
30
32
  # : () -> Hash[String, untyped]
31
33
  def serialize: () -> Hash[String, untyped]
@@ -33,11 +35,20 @@ module JobWorkflow
33
35
  # : (Hash[Symbol, untyped]) -> Context
34
36
  def _update_arguments: (Hash[Symbol, untyped]) -> Context
35
37
 
36
- # : (DSL) -> void
37
- def _job=: (DSL) -> void
38
+ # : () -> untyped
39
+ def cursor: () -> untyped
40
+
41
+ # : (untyped) -> void
42
+ def set_cursor!: (untyped) -> void
43
+
44
+ # : () -> void
45
+ def checkpoint!: () -> void
46
+
47
+ # : (_JobInterface) -> void
48
+ def _job=: (_JobInterface) -> void
38
49
 
39
- # : () -> DSL?
40
- def _job: () -> DSL?
50
+ # : () -> _JobInterface?
51
+ def _job: () -> _JobInterface?
41
52
 
42
53
  # : () -> String
43
54
  def job_id: () -> String
@@ -93,6 +104,9 @@ module JobWorkflow
93
104
  # : () -> TaskContext
94
105
  def _task_context: () -> TaskContext
95
106
 
107
+ # : (ActiveJob::Continuation::Step, ?cursor: untyped) { () -> void } -> void
108
+ def _with_current_step: (ActiveJob::Continuation::Step, ?cursor: untyped) { () -> void } -> void
109
+
96
110
  # : (TaskOutput) -> void
97
111
  def _add_task_output: (TaskOutput) -> void
98
112
 
@@ -101,7 +115,7 @@ module JobWorkflow
101
115
 
102
116
  private
103
117
 
104
- attr_accessor job: DSL?
118
+ attr_accessor job: _JobInterface?
105
119
 
106
120
  attr_writer workflow: Workflow
107
121
 
@@ -119,9 +133,19 @@ module JobWorkflow
119
133
 
120
134
  attr_accessor skip_in_dry_run_index: Integer
121
135
 
136
+ attr_accessor current_step: ActiveJob::Continuation::Step?
137
+
138
+ attr_accessor current_cursor: untyped
139
+
122
140
  # : () -> String
123
141
  def parent_job_id: () -> String
124
142
 
143
+ # : () -> bool
144
+ def each_task?: () -> bool
145
+
146
+ # : (untyped) -> untyped
147
+ def build_step_cursor: (untyped) -> untyped
148
+
125
149
  # : () -> Hash[String, untyped]
126
150
  def serialize_for_job: () -> Hash[String, untyped]
127
151
 
@@ -19,7 +19,6 @@ module JobWorkflow
19
19
  # @note This subscriber requires the opentelemetry-api gem to be installed.
20
20
  # If not available, subscription will be silently skipped.
21
21
  class OpenTelemetrySubscriber
22
- # rubocop:disable Metrics/ClassLength
23
22
  module Attributes
24
23
  JOB_NAME: String
25
24
 
@@ -63,26 +63,26 @@ module JobWorkflow
63
63
  DRY_RUN_EXECUTE: untyped
64
64
  end
65
65
 
66
- # : (DSL) { () -> untyped } -> untyped
67
- def self.instrument_workflow: (DSL) { () -> untyped } -> untyped
66
+ # : (_JobInterface) { () -> untyped } -> untyped
67
+ def self.instrument_workflow: (_JobInterface) { () -> untyped } -> untyped
68
68
 
69
- # : (DSL, Task, Context) { () -> untyped } -> untyped
70
- def self.instrument_task: (DSL, Task, Context) { () -> untyped } -> untyped
69
+ # : (_JobInterface, Task, Context) { () -> untyped } -> untyped
70
+ def self.instrument_task: (_JobInterface, Task, Context) { () -> untyped } -> untyped
71
71
 
72
- # : (DSL, Task, String) -> void
73
- def self.notify_task_skip: (DSL, Task, String) -> void
72
+ # : (_JobInterface, Task, String) -> void
73
+ def self.notify_task_skip: (_JobInterface, Task, String) -> void
74
74
 
75
- # : (DSL, Task, Integer) -> void
76
- def self.notify_task_enqueue: (DSL, Task, Integer) -> void
75
+ # : (_JobInterface, Task, Integer) -> void
76
+ def self.notify_task_enqueue: (_JobInterface, Task, Integer) -> void
77
77
 
78
78
  # : (Task, Context, String, Integer, Float, StandardError) -> void
79
79
  def self.notify_task_retry: (Task, Context, String, Integer, Float, StandardError) -> void
80
80
 
81
- # : (DSL, Task) { () -> untyped } -> untyped
82
- def self.instrument_dependent_wait: (DSL, Task) { () -> untyped } -> untyped
81
+ # : (_JobInterface, Task) { () -> untyped } -> untyped
82
+ def self.instrument_dependent_wait: (_JobInterface, Task) { () -> untyped } -> untyped
83
83
 
84
- # : (DSL, Task, Numeric, Integer) -> void
85
- def self.notify_dependent_reschedule: (DSL, Task, Numeric, Integer) -> void
84
+ # : (_JobInterface, Task, Numeric, Integer) -> void
85
+ def self.notify_dependent_reschedule: (_JobInterface, Task, Numeric, Integer) -> void
86
86
 
87
87
  # : (Semaphore) { () -> untyped } -> untyped
88
88
  def self.instrument_throttle: (Semaphore) { () -> untyped } -> untyped
@@ -99,32 +99,32 @@ module JobWorkflow
99
99
  # : (String, Hash[Symbol, untyped]) { () -> untyped } -> untyped
100
100
  def self.instrument_custom: (String, Hash[Symbol, untyped]) { () -> untyped } -> untyped
101
101
 
102
- # : (DSL, Context, Symbol?, Integer, bool) { () -> untyped } -> untyped
103
- def self.instrument_dry_run: (DSL, Context, Symbol?, Integer, bool) { () -> untyped } -> untyped
102
+ # : (_JobInterface, Context, Symbol?, Integer, bool) { () -> untyped } -> untyped
103
+ def self.instrument_dry_run: (_JobInterface, Context, Symbol?, Integer, bool) { () -> untyped } -> untyped
104
104
 
105
105
  # : (String, Hash[Symbol, untyped]) ?{ () -> untyped } -> untyped
106
106
  private def self.instrument: (String, Hash[Symbol, untyped]) ?{ () -> untyped } -> untyped
107
107
 
108
- # : (DSL) -> Hash[Symbol, untyped]
109
- private def self.build_workflow_payload: (DSL) -> Hash[Symbol, untyped]
108
+ # : (_JobInterface) -> Hash[Symbol, untyped]
109
+ private def self.build_workflow_payload: (_JobInterface) -> Hash[Symbol, untyped]
110
110
 
111
- # : (DSL, Task, Context) -> Hash[Symbol, untyped]
112
- private def self.build_task_payload: (DSL, Task, Context) -> Hash[Symbol, untyped]
111
+ # : (_JobInterface, Task, Context) -> Hash[Symbol, untyped]
112
+ private def self.build_task_payload: (_JobInterface, Task, Context) -> Hash[Symbol, untyped]
113
113
 
114
- # : (DSL, Task, String) -> Hash[Symbol, untyped]
115
- private def self.build_task_skip_payload: (DSL, Task, String) -> Hash[Symbol, untyped]
114
+ # : (_JobInterface, Task, String) -> Hash[Symbol, untyped]
115
+ private def self.build_task_skip_payload: (_JobInterface, Task, String) -> Hash[Symbol, untyped]
116
116
 
117
- # : (DSL, Task, Integer) -> Hash[Symbol, untyped]
118
- private def self.build_task_enqueue_payload: (DSL, Task, Integer) -> Hash[Symbol, untyped]
117
+ # : (_JobInterface, Task, Integer) -> Hash[Symbol, untyped]
118
+ private def self.build_task_enqueue_payload: (_JobInterface, Task, Integer) -> Hash[Symbol, untyped]
119
119
 
120
120
  # : (Task, Context, String, Integer, Float, StandardError) -> Hash[Symbol, untyped]
121
121
  private def self.build_task_retry_payload: (Task, Context, String, Integer, Float, StandardError) -> Hash[Symbol, untyped]
122
122
 
123
- # : (DSL, Task) -> Hash[Symbol, untyped]
124
- private def self.build_dependent_payload: (DSL, Task) -> Hash[Symbol, untyped]
123
+ # : (_JobInterface, Task) -> Hash[Symbol, untyped]
124
+ private def self.build_dependent_payload: (_JobInterface, Task) -> Hash[Symbol, untyped]
125
125
 
126
- # : (DSL, Task, Numeric, Integer) -> Hash[Symbol, untyped]
127
- private def self.build_dependent_reschedule_payload: (DSL, Task, Numeric, Integer) -> Hash[Symbol, untyped]
126
+ # : (_JobInterface, Task, Numeric, Integer) -> Hash[Symbol, untyped]
127
+ private def self.build_dependent_reschedule_payload: (_JobInterface, Task, Numeric, Integer) -> Hash[Symbol, untyped]
128
128
 
129
129
  # : (Semaphore) -> Hash[Symbol, untyped]
130
130
  private def self.build_throttle_payload: (Semaphore) -> Hash[Symbol, untyped]
@@ -132,7 +132,7 @@ module JobWorkflow
132
132
  # : (String) -> Hash[Symbol, untyped]
133
133
  private def self.build_queue_payload: (String) -> Hash[Symbol, untyped]
134
134
 
135
- # : (DSL, Context, Symbol?, Integer, bool) -> Hash[Symbol, untyped]
136
- private def self.build_skip_in_dry_run_payload: (DSL, Context, Symbol?, Integer, bool) -> Hash[Symbol, untyped]
135
+ # : (_JobInterface, Context, Symbol?, Integer, bool) -> Hash[Symbol, untyped]
136
+ private def self.build_skip_in_dry_run_payload: (_JobInterface, Context, Symbol?, Integer, bool) -> Hash[Symbol, untyped]
137
137
  end
138
138
  end
@@ -33,12 +33,15 @@ module JobWorkflow
33
33
  # : (TaskJobStatus) -> void
34
34
  def update_task_job_status: (TaskJobStatus) -> void
35
35
 
36
- # : (task_name: Symbol, jobs: Array[DSL]) -> void
37
- def update_task_job_statuses_from_jobs: (task_name: Symbol, jobs: Array[DSL]) -> void
36
+ # : (task_name: Symbol, jobs: Array[_JobInterface]) -> void
37
+ def update_task_job_statuses_from_jobs: (task_name: Symbol, jobs: Array[_JobInterface]) -> void
38
38
 
39
39
  # : (Symbol) -> void
40
40
  def update_task_job_statuses_from_db: (Symbol) -> void
41
41
 
42
+ # : () -> void
43
+ def refresh_from_db!: () -> void
44
+
42
45
  private
43
46
 
44
47
  attr_accessor task_job_statuses: Hash[Symbol, Array[TaskJobStatus]]
@@ -0,0 +1,80 @@
1
+ # Generated from lib/job_workflow/monitoring/dag_layout.rb with RBS::Inline
2
+
3
+ module JobWorkflow
4
+ module Monitoring
5
+ class DagLayout
6
+ NODE_WIDTH: ::Integer
7
+
8
+ NODE_HEIGHT: ::Integer
9
+
10
+ COLUMN_GAP: ::Integer
11
+
12
+ ROW_GAP: ::Integer
13
+
14
+ PADDING: ::Integer
15
+
16
+ LABEL_LIMIT: ::Integer
17
+
18
+ # : (tasks: Array[Hash[Symbol, untyped]]) -> void
19
+ def initialize: (tasks: Array[Hash[Symbol, untyped]]) -> void
20
+
21
+ # : () -> Hash[Symbol, untyped]
22
+ def to_h: () -> Hash[Symbol, untyped]
23
+
24
+ private
25
+
26
+ attr_reader tasks: Array[Hash[Symbol, untyped]]
27
+
28
+ # : (Array[Hash[Symbol, untyped]]) -> void
29
+ def validate_tasks!: (Array[Hash[Symbol, untyped]]) -> void
30
+
31
+ # : (Hash[Symbol, untyped], Hash[Symbol, bool]) -> void
32
+ def validate_dependencies!: (Hash[Symbol, untyped], Hash[Symbol, bool]) -> void
33
+
34
+ # : () -> Array[Hash[Symbol, untyped]]
35
+ def nodes: () -> Array[Hash[Symbol, untyped]]
36
+
37
+ # : () -> Array[Hash[Symbol, untyped]]
38
+ def edges: () -> Array[Hash[Symbol, untyped]]
39
+
40
+ # : () -> Hash[Symbol, Hash[Symbol, Integer]]
41
+ def node_positions: () -> Hash[Symbol, Hash[Symbol, Integer]]
42
+
43
+ # : (Hash[Symbol, untyped], Hash[Symbol, Hash[Symbol, Integer]]) -> Integer
44
+ def dependency_column: (Hash[Symbol, untyped], Hash[Symbol, Hash[Symbol, Integer]]) -> Integer
45
+
46
+ # : (Symbol, Symbol) -> Hash[Symbol, untyped]
47
+ def edge_view: (Symbol, Symbol) -> Hash[Symbol, untyped]
48
+
49
+ # : (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> String
50
+ def edge_path: (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> String
51
+
52
+ # : (Symbol) -> Hash[Symbol, untyped]
53
+ def node_view: (Symbol) -> Hash[Symbol, untyped]
54
+
55
+ # : () -> Integer
56
+ def canvas_width: () -> Integer
57
+
58
+ # : () -> Integer
59
+ def canvas_height: () -> Integer
60
+
61
+ # : (Integer) -> Integer
62
+ def x_for: (Integer) -> Integer
63
+
64
+ # : (Integer) -> Integer
65
+ def y_for: (Integer) -> Integer
66
+
67
+ # : (Symbol) -> String
68
+ def truncate_label: (Symbol) -> String
69
+
70
+ # : (Hash[Symbol, untyped]) -> String?
71
+ def node_meta_label: (Hash[Symbol, untyped]) -> String?
72
+
73
+ # : () -> String
74
+ def root_task_label: () -> String
75
+
76
+ # : (Hash[Symbol, Integer]) -> String
77
+ def each_progress_label: (Hash[Symbol, Integer]) -> String
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,8 @@
1
+ # Generated from lib/job_workflow/monitoring/engine.rb with RBS::Inline
2
+
3
+ module JobWorkflow
4
+ module Monitoring
5
+ class Engine < ::Rails::Engine
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,14 @@
1
+ # Generated from lib/job_workflow/monitoring/execution_page.rb with RBS::Inline
2
+
3
+ module JobWorkflow
4
+ module Monitoring
5
+ class ExecutionPage
6
+ attr_reader executions: Array[ExecutionViewModel]
7
+
8
+ attr_reader next_cursor: String?
9
+
10
+ # : (executions: Array[ExecutionViewModel], next_cursor: String?) -> void
11
+ def initialize: (executions: Array[ExecutionViewModel], next_cursor: String?) -> void
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,21 @@
1
+ # Generated from lib/job_workflow/monitoring/execution_registry.rb with RBS::Inline
2
+
3
+ module JobWorkflow
4
+ module Monitoring
5
+ class ExecutionRegistry
6
+ DEFAULT_LIMIT: ::Integer
7
+
8
+ # : (job_class_name: String, ?limit: Integer, ?cursor: String?) -> ExecutionPage
9
+ def self.page_for: (job_class_name: String, ?limit: Integer, ?cursor: String?) -> ExecutionPage
10
+
11
+ # : (String) -> ExecutionViewModel?
12
+ def self.find: (String) -> ExecutionViewModel?
13
+
14
+ # : (Hash[String, untyped], ?hydrate_sub_tasks: bool) -> ExecutionViewModel?
15
+ private def self.build_view_model: (Hash[String, untyped], ?hydrate_sub_tasks: bool) -> ExecutionViewModel?
16
+
17
+ # : (WorkflowStatus) -> void
18
+ private def self.hydrate_sub_task_state: (WorkflowStatus) -> void
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,111 @@
1
+ # Generated from lib/job_workflow/monitoring/execution_view_model.rb with RBS::Inline
2
+
3
+ module JobWorkflow
4
+ module Monitoring
5
+ class ExecutionViewModel
6
+ attr_reader job_id: String
7
+
8
+ attr_reader queue_name: String?
9
+
10
+ attr_reader status: WorkflowStatus
11
+
12
+ # : (job_id: String, queue_name: String?, status: WorkflowStatus) -> void
13
+ def initialize: (job_id: String, queue_name: String?, status: WorkflowStatus) -> void
14
+
15
+ # : () -> String
16
+ def job_class_name: () -> String
17
+
18
+ # : () -> Symbol
19
+ def workflow_status: () -> Symbol
20
+
21
+ # : () -> Symbol?
22
+ def current_task_name: () -> Symbol?
23
+
24
+ # : () -> Arguments
25
+ def arguments: () -> Arguments
26
+
27
+ # : () -> Hash[untyped, untyped]
28
+ def filtered_arguments: () -> Hash[untyped, untyped]
29
+
30
+ # : () -> Array[Hash[Symbol, untyped]]
31
+ def tasks: () -> Array[Hash[Symbol, untyped]]
32
+
33
+ # : () -> Symbol?
34
+ def failed_task_name: () -> Symbol?
35
+
36
+ # : () -> String?
37
+ def mission_control_job_path: () -> String?
38
+
39
+ # : () -> Hash[Symbol, untyped]
40
+ def dag_layout: () -> Hash[Symbol, untyped]
41
+
42
+ # : () -> bool
43
+ def running?: () -> bool
44
+
45
+ # : () -> Hash[Symbol, untyped]
46
+ def to_h: () -> Hash[Symbol, untyped]
47
+
48
+ private
49
+
50
+ # : (Symbol, Array[TaskOutput], Array[TaskJobStatus]) -> Symbol
51
+ def task_status: (Symbol, Array[TaskOutput], Array[TaskJobStatus]) -> Symbol
52
+
53
+ # : (Array[TaskOutput], Array[TaskJobStatus]) -> bool
54
+ def completed_task?: (Array[TaskOutput], Array[TaskJobStatus]) -> bool
55
+
56
+ # : (Symbol, Array[TaskJobStatus]) -> bool
57
+ def task_running?: (Symbol, Array[TaskJobStatus]) -> bool
58
+
59
+ # : (Symbol) -> bool
60
+ def current_task_running?: (Symbol) -> bool
61
+
62
+ # : (Task) -> Hash[Symbol, untyped]
63
+ def task_view_model: (Task) -> Hash[Symbol, untyped]
64
+
65
+ # : (Task) -> Hash[Symbol, untyped]
66
+ def task_configuration_view: (Task) -> Hash[Symbol, untyped]
67
+
68
+ # : (Symbol, Array[TaskOutput], Array[TaskJobStatus]) -> Hash[Symbol, untyped]
69
+ def task_runtime_view: (Symbol, Array[TaskOutput], Array[TaskJobStatus]) -> Hash[Symbol, untyped]
70
+
71
+ # : (Symbol) -> [Array[TaskOutput], Array[TaskJobStatus]]
72
+ def task_state: (Symbol) -> [ Array[TaskOutput], Array[TaskJobStatus] ]
73
+
74
+ # : (Task) -> Hash[Symbol, untyped]
75
+ def task_configuration: (Task) -> Hash[Symbol, untyped]
76
+
77
+ # : (Task) -> Hash[Symbol, untyped]
78
+ def enqueue_configuration: (Task) -> Hash[Symbol, untyped]
79
+
80
+ # : (Task) -> Array[Hash[Symbol, untyped]]
81
+ def output_configuration: (Task) -> Array[Hash[Symbol, untyped]]
82
+
83
+ # : (Task) -> Hash[Symbol, untyped]
84
+ def retry_configuration: (Task) -> Hash[Symbol, untyped]
85
+
86
+ # : (Task) -> Hash[Symbol, untyped]
87
+ def throttle_configuration: (Task) -> Hash[Symbol, untyped]
88
+
89
+ # : (Task) -> Hash[Symbol, untyped]
90
+ def dependency_wait_configuration: (Task) -> Hash[Symbol, untyped]
91
+
92
+ # : (untyped) -> untyped
93
+ def callable_summary: (untyped) -> untyped
94
+
95
+ # : (untyped) -> untyped
96
+ def primitive_summary: (untyped) -> untyped
97
+
98
+ # : (Array[TaskOutput], Array[TaskJobStatus]) -> Hash[Symbol, Integer]
99
+ def each_progress: (Array[TaskOutput], Array[TaskJobStatus]) -> Hash[Symbol, Integer]
100
+
101
+ # : (Array[TaskOutput]) -> Array[Hash[Symbol, untyped]]
102
+ def task_outputs_view: (Array[TaskOutput]) -> Array[Hash[Symbol, untyped]]
103
+
104
+ # : (Array[TaskJobStatus]) -> Array[Hash[Symbol, untyped]]
105
+ def sub_task_jobs_view: (Array[TaskJobStatus]) -> Array[Hash[Symbol, untyped]]
106
+
107
+ # : (String?, Symbol?) -> String?
108
+ def mission_control_job_path_for: (String?, Symbol?) -> String?
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,16 @@
1
+ # Generated from lib/job_workflow/monitoring/parameter_filter.rb with RBS::Inline
2
+
3
+ module JobWorkflow
4
+ module Monitoring
5
+ class ParameterFilter
6
+ # : (untyped) -> untyped
7
+ def self.filter: (untyped) -> untyped
8
+
9
+ # : () -> ActiveSupport::ParameterFilter
10
+ private def self.parameter_filter: () -> ActiveSupport::ParameterFilter
11
+
12
+ # : () -> Array[untyped]
13
+ private def self.filters: () -> Array[untyped]
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,18 @@
1
+ # Generated from lib/job_workflow/monitoring/workflow_definition.rb with RBS::Inline
2
+
3
+ module JobWorkflow
4
+ module Monitoring
5
+ class WorkflowDefinition
6
+ attr_reader job_class: singleton(DSL)
7
+
8
+ # : (job_class: singleton(DSL)) -> void
9
+ def initialize: (job_class: singleton(DSL)) -> void
10
+
11
+ # : () -> String
12
+ def job_class_name: () -> String
13
+
14
+ # : () -> Integer
15
+ def task_count: () -> Integer
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,13 @@
1
+ # Generated from lib/job_workflow/monitoring/workflow_registry.rb with RBS::Inline
2
+
3
+ module JobWorkflow
4
+ module Monitoring
5
+ class WorkflowRegistry
6
+ # : () -> Array[singleton(DSL)]
7
+ def self.all: () -> Array[singleton(DSL)]
8
+
9
+ # : (String) -> singleton(DSL)?
10
+ def self.find: (String) -> singleton(DSL)?
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,38 @@
1
+ # Generated from lib/job_workflow/monitoring.rb with RBS::Inline
2
+
3
+ module JobWorkflow
4
+ module Monitoring
5
+ # : () -> Array[WorkflowDefinition]
6
+ def self.workflows: () -> Array[WorkflowDefinition]
7
+
8
+ # : (String?, Symbol?) -> String?
9
+ def self.mission_control_job_path: (String?, Symbol?) -> String?
10
+
11
+ # : () -> String
12
+ def self.resolved_base_controller_class: () -> String
13
+
14
+ # : (untyped config) -> void
15
+ def self.configure_engine_config: (untyped config) -> void
16
+
17
+ # : () -> String?
18
+ private def self.mission_control_job_route_path: () -> String?
19
+
20
+ # : () -> String?
21
+ private def self.mission_control_application_id: () -> String?
22
+
23
+ # : () -> String?
24
+ private def self.mission_control_mount_path: () -> String?
25
+
26
+ # : (String) -> String?
27
+ private def self.engine_route_path: (String) -> String?
28
+
29
+ # : (untyped) -> String?
30
+ private def self.normalized_route_path: (untyped) -> String?
31
+
32
+ # : () -> untyped
33
+ private def self.mission_control_routes: () -> untyped
34
+
35
+ # : () -> untyped
36
+ private def self.rails_routes: () -> untyped
37
+ end
38
+ end
@@ -49,14 +49,17 @@ module JobWorkflow
49
49
  # : (String) -> Hash[String, untyped]?
50
50
  def find_job: (String) -> Hash[String, untyped]?
51
51
 
52
+ # : (job_class_name: String, limit: Integer, cursor: String?) -> Hash[Symbol, untyped]
53
+ def fetch_root_workflow_job_page: (job_class_name: String, limit: Integer, cursor: String?) -> Hash[Symbol, untyped]
54
+
52
55
  # : (Array[String]) -> Array[Hash[String, untyped]]
53
56
  def fetch_job_contexts: (Array[String]) -> Array[Hash[String, untyped]]
54
57
 
55
- # : (DSL, Numeric) -> bool
56
- def reschedule_job: (DSL, Numeric) -> bool
58
+ # : (_JobInterface, Numeric) -> bool
59
+ def reschedule_job: (_JobInterface, Numeric) -> bool
57
60
 
58
- # : (DSL) -> void
59
- def persist_job_context: (DSL) -> void
61
+ # : (_JobInterface) -> void
62
+ def persist_job_context: (_JobInterface) -> void
60
63
  end
61
64
  end
62
65
  end
@@ -51,11 +51,14 @@ module JobWorkflow
51
51
  # : (String) -> Hash[String, untyped]?
52
52
  def find_job: (String) -> Hash[String, untyped]?
53
53
 
54
+ # : (job_class_name: String, limit: Integer, cursor: String?) -> Hash[Symbol, untyped]
55
+ def fetch_root_workflow_job_page: (job_class_name: String, limit: Integer, cursor: String?) -> Hash[Symbol, untyped]
56
+
54
57
  # : (Array[String]) -> Array[Hash[String, untyped]]
55
58
  def fetch_job_contexts: (Array[String]) -> Array[Hash[String, untyped]]
56
59
 
57
- # : (DSL, Numeric) -> bool
58
- def reschedule_job: (DSL, Numeric) -> bool
60
+ # : (_JobInterface, Numeric) -> bool
61
+ def reschedule_job: (_JobInterface, Numeric) -> bool
59
62
 
60
63
  # @note Test helpers
61
64
  #
@@ -82,14 +82,17 @@ module JobWorkflow
82
82
  # : (String) -> Hash[String, untyped]?
83
83
  def find_job: (String) -> Hash[String, untyped]?
84
84
 
85
+ # : (job_class_name: String, limit: Integer, cursor: String?) -> Hash[Symbol, untyped]
86
+ def fetch_root_workflow_job_page: (job_class_name: String, limit: Integer, cursor: String?) -> Hash[Symbol, untyped]
87
+
85
88
  # @note
86
89
  # - Fetches job_workflow_context hashes for the given job IDs.
87
90
  #
88
91
  # : (Array[String]) -> Array[Hash[String, untyped]]
89
92
  def fetch_job_contexts: (Array[String]) -> Array[Hash[String, untyped]]
90
93
 
91
- # : (DSL, Numeric) -> bool
92
- def reschedule_job: (DSL, Numeric) -> bool
94
+ # : (_JobInterface, Numeric) -> bool
95
+ def reschedule_job: (_JobInterface, Numeric) -> bool
93
96
 
94
97
  # @note
95
98
  # - Persists the job's updated context (including task outputs) back
@@ -97,8 +100,8 @@ module JobWorkflow
97
100
  # outputs computed during job execution would be lost because
98
101
  # SolidQueue does not re-serialize job arguments after perform.
99
102
  #
100
- # : (DSL) -> void
101
- def persist_job_context: (DSL) -> void
103
+ # : (_JobInterface) -> void
104
+ def persist_job_context: (_JobInterface) -> void
102
105
 
103
106
  private
104
107
 
@@ -113,8 +116,17 @@ module JobWorkflow
113
116
  # : [T] () { () -> T } -> T
114
117
  def without_query_cache: [T] () { () -> T } -> T
115
118
 
116
- # : (SolidQueue::Job, DSL, Numeric) -> bool
117
- def reschedule_solid_queue_job: (SolidQueue::Job, DSL, Numeric) -> bool
119
+ # : (SolidQueue::Job) -> Hash[String, untyped]
120
+ def normalized_job_data: (SolidQueue::Job) -> Hash[String, untyped]
121
+
122
+ # : (job_class_name: String, cursor: String?) -> untyped
123
+ def root_jobs_relation: (job_class_name: String, cursor: String?) -> untyped
124
+
125
+ # : (Array[SolidQueue::Job], limit: Integer) -> Hash[Symbol, untyped]
126
+ def build_page: (Array[SolidQueue::Job], limit: Integer) -> Hash[Symbol, untyped]
127
+
128
+ # : (SolidQueue::Job, _JobInterface, Numeric) -> bool
129
+ def reschedule_solid_queue_job: (SolidQueue::Job, _JobInterface, Numeric) -> bool
118
130
 
119
131
  # @rbs module-self SolidQueue::ClaimedExecution
120
132
  module ClaimedExecutionPatch : SolidQueue::ClaimedExecution
@@ -0,0 +1,6 @@
1
+ # Generated from lib/job_workflow/railtie.rb with RBS::Inline
2
+
3
+ module JobWorkflow
4
+ class Railtie < Rails::Railtie
5
+ end
6
+ end