job-workflow 0.6.0 → 0.6.2

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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/.agents/instructions/coding-style.md +38 -0
  3. data/.agents/instructions/domain.md +37 -0
  4. data/.agents/instructions/environment.md +44 -0
  5. data/.agents/instructions/general.md +29 -0
  6. data/.agents/instructions/security.md +20 -0
  7. data/.agents/instructions/structure.md +43 -0
  8. data/.agents/instructions/tech-stack.md +40 -0
  9. data/.agents/instructions/testing.md +46 -0
  10. data/.agents/instructions/workflow.md +39 -0
  11. data/.rubocop.yml +10 -0
  12. data/AGENTS.md +23 -0
  13. data/CHANGELOG.md +14 -0
  14. data/README.md +1 -1
  15. data/Rakefile +1 -1
  16. data/Steepfile +4 -0
  17. data/app/controllers/job_workflow/monitoring/application_controller.rb +1 -0
  18. data/app/controllers/job_workflow/monitoring/executions_controller.rb +7 -0
  19. data/app/controllers/job_workflow/monitoring/workflows_controller.rb +3 -0
  20. data/guides/PRODUCTION_DEPLOYMENT.md +1 -1
  21. data/guides/README.md +1 -1
  22. data/lib/job_workflow/auto_scaling/executor.rb +3 -1
  23. data/lib/job_workflow/context.rb +5 -8
  24. data/lib/job_workflow/dsl.rb +14 -8
  25. data/lib/job_workflow/instrumentation/opentelemetry_subscriber.rb +2 -0
  26. data/lib/job_workflow/logger.rb +1 -2
  27. data/lib/job_workflow/monitoring/dag_layout.rb +4 -0
  28. data/lib/job_workflow/monitoring/execution_view_model.rb +11 -11
  29. data/lib/job_workflow/monitoring.rb +4 -1
  30. data/lib/job_workflow/queue_adapters/null_adapter.rb +6 -1
  31. data/lib/job_workflow/sub_task_job.rb +3 -2
  32. data/lib/job_workflow/task_graph.rb +2 -0
  33. data/lib/job_workflow/task_output.rb +3 -1
  34. data/lib/job_workflow/version.rb +1 -1
  35. data/lib/job_workflow/workflow.rb +8 -1
  36. data/lib/job_workflow/workflow_status.rb +21 -3
  37. data/rbs_collection.lock.yaml +67 -15
  38. data/rbs_collection.yaml +4 -0
  39. data/sig/generated/controllers/job_workflow/monitoring/application_controller.rbs +11 -0
  40. data/sig/generated/controllers/job_workflow/monitoring/executions_controller.rbs +21 -0
  41. data/sig/generated/controllers/job_workflow/monitoring/workflows_controller.rbs +12 -0
  42. data/sig/generated/job_workflow/auto_scaling/executor.rbs +2 -0
  43. data/sig/generated/job_workflow/dsl.rbs +4 -0
  44. data/sig/generated/job_workflow/instrumentation/opentelemetry_subscriber.rbs +2 -1
  45. data/sig/generated/job_workflow/logger.rbs +1 -2
  46. data/sig/generated/job_workflow/monitoring/dag_layout.rbs +6 -0
  47. data/sig/generated/job_workflow/monitoring/execution_view_model.rbs +8 -2
  48. data/sig/generated/job_workflow/monitoring.rbs +4 -2
  49. data/sig/generated/job_workflow/queue_adapters/null_adapter.rbs +8 -1
  50. data/sig/generated/job_workflow/sub_task_job.rbs +2 -2
  51. data/sig/generated/job_workflow/task_graph.rbs +2 -0
  52. data/sig/generated/job_workflow/workflow.rbs +8 -0
  53. data/sig/generated/job_workflow/workflow_status.rbs +12 -2
  54. data/sig-private/activejob.rbs +7 -0
  55. data/sig-private/job-workflow.rbs +2 -1
  56. data/sig-private/mission_control.rbs +10 -0
  57. data/sig-private/rails.rbs +7 -0
  58. data/sig-private/solid_queue.rbs +1 -1
  59. metadata +15 -1
@@ -3,6 +3,10 @@
3
3
  module JobWorkflow
4
4
  module Monitoring
5
5
  class DagLayout
6
+ # @rbs @nodes: Array[Hash[Symbol, untyped]]
7
+ # @rbs @edges: Array[Hash[Symbol, untyped]]
8
+ # @rbs @node_positions: Hash[Symbol, Hash[Symbol, Integer]]
9
+
6
10
  NODE_WIDTH = 224
7
11
  NODE_HEIGHT = 84
8
12
  COLUMN_GAP = 56
@@ -3,6 +3,10 @@
3
3
  module JobWorkflow
4
4
  module Monitoring
5
5
  class ExecutionViewModel
6
+ # @rbs @tasks: Array[Hash[Symbol, untyped]]
7
+ # @rbs @failed_task_name: Symbol?
8
+ # @rbs @dag_layout: Hash[Symbol, untyped]
9
+
6
10
  attr_reader :job_id #: String
7
11
  attr_reader :queue_name #: String?
8
12
  attr_reader :status #: WorkflowStatus
@@ -87,16 +91,17 @@ module JobWorkflow
87
91
  #: (Symbol, Array[TaskOutput], Array[TaskJobStatus]) -> Symbol
88
92
  def task_status(task_name, task_outputs, task_job_statuses)
89
93
  return :failed if task_job_statuses.any?(&:failed?)
90
- return :succeeded if completed_task?(task_outputs, task_job_statuses)
94
+ return :succeeded if completed_task?(task_name, task_outputs, task_job_statuses)
91
95
  return :running if task_running?(task_name, task_job_statuses)
92
96
 
93
97
  :pending
94
98
  end
95
99
 
96
- #: (Array[TaskOutput], Array[TaskJobStatus]) -> bool
97
- def completed_task?(task_outputs, task_job_statuses)
100
+ #: (Symbol, Array[TaskOutput], Array[TaskJobStatus]) -> bool
101
+ def completed_task?(task_name, task_outputs, task_job_statuses)
98
102
  return true if !running? && task_outputs.any?
99
103
  return task_job_statuses.all?(&:succeeded?) if task_job_statuses.any?
104
+ return true if status.completed_task_names.include?(task_name)
100
105
 
101
106
  task_outputs.any?
102
107
  end
@@ -141,12 +146,7 @@ module JobWorkflow
141
146
  end
142
147
 
143
148
  #: (Symbol) -> [Array[TaskOutput], Array[TaskJobStatus]]
144
- def task_state(task_name)
145
- [
146
- status.output.fetch_all(task_name:),
147
- status.job_status.fetch_all(task_name:)
148
- ]
149
- end
149
+ def task_state(task_name) = [status.output.fetch_all(task_name:), status.job_status.fetch_all(task_name:)]
150
150
 
151
151
  #: (Task) -> Hash[Symbol, untyped]
152
152
  def task_configuration(task)
@@ -227,8 +227,8 @@ module JobWorkflow
227
227
  def each_progress(task_outputs, task_job_statuses)
228
228
  {
229
229
  total: [task_outputs.size, task_job_statuses.size].max,
230
- succeeded: task_job_statuses.count(&:succeeded?),
231
- failed: task_job_statuses.count(&:failed?),
230
+ succeeded: task_job_statuses.count { |task_job_status| task_job_status.succeeded? }, # rubocop:disable Style/SymbolProc
231
+ failed: task_job_statuses.count { |task_job_status| task_job_status.failed? }, # rubocop:disable Style/SymbolProc
232
232
  pending: task_job_statuses.count { |task_status| task_status.status == :pending },
233
233
  running: task_job_statuses.count { |task_status| task_status.status == :running }
234
234
  }
@@ -10,6 +10,9 @@ require_relative "monitoring/execution_registry"
10
10
 
11
11
  module JobWorkflow
12
12
  module Monitoring
13
+ # @rbs!
14
+ # def self.base_controller_class: () -> untyped
15
+
13
16
  mattr_accessor :base_controller_class
14
17
 
15
18
  class << self
@@ -18,7 +21,7 @@ module JobWorkflow
18
21
  WorkflowRegistry.all.map { |job_class| WorkflowDefinition.new(job_class:) }
19
22
  end
20
23
 
21
- #: (String?, Symbol?) -> String?
24
+ #: (String?, ?status: Symbol?) -> String?
22
25
  def mission_control_job_path(job_id, status: nil)
23
26
  return if job_id.nil?
24
27
 
@@ -4,10 +4,15 @@ module JobWorkflow
4
4
  module QueueAdapters
5
5
  # rubocop:disable Naming/PredicateMethod
6
6
  class NullAdapter < Abstract
7
+ # @rbs @paused_queues: Set[String]
8
+ # @rbs @queue_jobs: Hash[String, Array[untyped]]
9
+ # @rbs @stored_jobs: Hash[String, Hash[String, untyped]]
10
+
7
11
  #: () -> void
8
12
  def initialize_adapter!; end
9
13
 
10
- def initialize # rubocop:disable Lint/MissingSuper
14
+ #: () -> void
15
+ def initialize
11
16
  @paused_queues = Set.new #: Set[String]
12
17
  @queue_jobs = {} #: Hash[String, Array[untyped]]
13
18
  @stored_jobs = {} #: Hash[String, Hash[String, untyped]]
@@ -33,7 +33,8 @@ module JobWorkflow
33
33
  def perform(arguments)
34
34
  payload = arguments.symbolize_keys
35
35
  self._context = build_context(payload)
36
- Runner.new(context: _context).run
36
+ context = _context || (raise "context is not set.")
37
+ Runner.new(context:).run
37
38
  end
38
39
 
39
40
  #: () -> Output
@@ -73,7 +74,7 @@ module JobWorkflow
73
74
  ._update_arguments(payload.except(:job_workflow_context))
74
75
  end
75
76
 
76
- #: (job_class_name: String) -> Workflow
77
+ #: (String job_class_name) -> Workflow
77
78
  def resolve_workflow(job_class_name)
78
79
  job_class = JobWorkflow::DSL._included_classes.to_a.reverse.find { |klass| klass.name == job_class_name }
79
80
  job_class ||= job_class_name.safe_constantize
@@ -2,6 +2,8 @@
2
2
 
3
3
  module JobWorkflow
4
4
  class TaskGraph
5
+ # @rbs @tasks: Hash[Symbol, Task]
6
+
5
7
  include TSort #[Task]
6
8
  include Enumerable #[Task]
7
9
 
@@ -9,7 +9,9 @@ module JobWorkflow
9
9
  class << self
10
10
  #: (task: Task, each_index: Integer, data: Hash[Symbol, untyped]) -> TaskOutput
11
11
  def from_task(task:, data:, each_index:)
12
- normalized_data = task.output.to_h { |output_def| [output_def.name, nil] }
12
+ normalized_data = task.output.to_h do |output_def|
13
+ [output_def.name, nil] #: [Symbol, nil]
14
+ end
13
15
  normalized_data.merge!(data.slice(*normalized_data.keys))
14
16
  new(task_name: task.task_name, each_index:, data: normalized_data)
15
17
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JobWorkflow
4
- VERSION = "0.6.0" # : String
4
+ VERSION = "0.6.2" # : String
5
5
  end
@@ -2,6 +2,11 @@
2
2
 
3
3
  module JobWorkflow
4
4
  class Workflow
5
+ # @rbs @task_graph: TaskGraph
6
+ # @rbs @argument_defs: Hash[Symbol, ArgumentDef]
7
+ # @rbs @hook_registry: HookRegistry
8
+ # @rbs @schedules: Hash[Symbol, Schedule]
9
+
5
10
  attr_reader :dry_run_config #: DryRunConfig
6
11
 
7
12
  #: () -> void
@@ -70,7 +75,9 @@ module JobWorkflow
70
75
 
71
76
  #: () -> Hash[Symbol, untyped]
72
77
  def build_arguments_hash
73
- arguments.to_h { |def_obj| [def_obj.name, def_obj.default] }
78
+ arguments.to_h do |def_obj|
79
+ [def_obj.name, def_obj.default] #: [Symbol, untyped]
80
+ end
74
81
  end
75
82
  end
76
83
  end
@@ -10,6 +10,7 @@ module JobWorkflow
10
10
  attr_reader :context #: Context
11
11
  attr_reader :job_class_name #: String
12
12
  attr_reader :status #: status_type
13
+ attr_reader :completed_task_names #: Array[Symbol]
13
14
 
14
15
  class << self
15
16
  #: (String) -> WorkflowStatus
@@ -36,11 +37,22 @@ module JobWorkflow
36
37
  workflow = job_class._workflow
37
38
  context = context_from_job_data(data, workflow)
38
39
 
39
- new(context:, job_class_name:, status: data["status"])
40
+ new(
41
+ context:,
42
+ job_class_name:,
43
+ status: data["status"],
44
+ completed_task_names: completed_task_names_from_job_data(data)
45
+ )
40
46
  end
41
47
 
42
48
  private
43
49
 
50
+ #: (Hash[String, untyped]) -> Array[Symbol]
51
+ def completed_task_names_from_job_data(data)
52
+ task_names = Array(data.dig("continuation", "completed")) #: Array[String]
53
+ task_names.map { |task_name| task_name.to_sym } # rubocop:disable Style/SymbolProc
54
+ end
55
+
44
56
  #: (Hash[String, untyped], Workflow) -> Context
45
57
  def context_from_job_data(data, workflow)
46
58
  context_data = data["job_workflow_context"] || data["arguments"]&.first&.dig("job_workflow_context")
@@ -64,11 +76,17 @@ module JobWorkflow
64
76
  end
65
77
  end
66
78
 
67
- #: (context: Context, job_class_name: String, status: status_type) -> void
68
- def initialize(context:, job_class_name:, status:)
79
+ #: (
80
+ # context: Context,
81
+ # job_class_name: String,
82
+ # status: status_type,
83
+ # ?completed_task_names: Array[Symbol]
84
+ # ) -> void
85
+ def initialize(context:, job_class_name:, status:, completed_task_names: [])
69
86
  @context = context #: Context
70
87
  @job_class_name = job_class_name #: String
71
88
  @status = status #: Symbol
89
+ @completed_task_names = completed_task_names
72
90
  end
73
91
 
74
92
  #: () -> Symbol?
@@ -1,12 +1,36 @@
1
1
  ---
2
2
  path: ".gem_rbs_collection"
3
3
  gems:
4
+ - name: actionpack
5
+ version: '7.2'
6
+ source:
7
+ type: git
8
+ name: ruby/gem_rbs_collection
9
+ revision: 2443035126922ee49f775a0edb0b705896fef7c6
10
+ remote: https://github.com/ruby/gem_rbs_collection.git
11
+ repo_dir: gems
12
+ - name: actionview
13
+ version: '6.0'
14
+ source:
15
+ type: git
16
+ name: ruby/gem_rbs_collection
17
+ revision: 2443035126922ee49f775a0edb0b705896fef7c6
18
+ remote: https://github.com/ruby/gem_rbs_collection.git
19
+ repo_dir: gems
4
20
  - name: activejob
5
21
  version: '6.0'
6
22
  source:
7
23
  type: git
8
24
  name: ruby/gem_rbs_collection
9
- revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
25
+ revision: 2443035126922ee49f775a0edb0b705896fef7c6
26
+ remote: https://github.com/ruby/gem_rbs_collection.git
27
+ repo_dir: gems
28
+ - name: activemodel
29
+ version: '7.1'
30
+ source:
31
+ type: git
32
+ name: ruby/gem_rbs_collection
33
+ revision: 2443035126922ee49f775a0edb0b705896fef7c6
10
34
  remote: https://github.com/ruby/gem_rbs_collection.git
11
35
  repo_dir: gems
12
36
  - name: activerecord
@@ -14,7 +38,7 @@ gems:
14
38
  source:
15
39
  type: git
16
40
  name: ruby/gem_rbs_collection
17
- revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
41
+ revision: 2443035126922ee49f775a0edb0b705896fef7c6
18
42
  remote: https://github.com/ruby/gem_rbs_collection.git
19
43
  repo_dir: gems
20
44
  - name: activesupport
@@ -22,7 +46,7 @@ gems:
22
46
  source:
23
47
  type: git
24
48
  name: ruby/gem_rbs_collection
25
- revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
49
+ revision: 2443035126922ee49f775a0edb0b705896fef7c6
26
50
  remote: https://github.com/ruby/gem_rbs_collection.git
27
51
  repo_dir: gems
28
52
  - name: base64
@@ -30,11 +54,15 @@ gems:
30
54
  source:
31
55
  type: rubygems
32
56
  - name: bigdecimal
33
- version: '4.0'
57
+ version: 4.1.2
58
+ source:
59
+ type: rubygems
60
+ - name: cgi
61
+ version: '0.5'
34
62
  source:
35
63
  type: git
36
64
  name: ruby/gem_rbs_collection
37
- revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
65
+ revision: 2443035126922ee49f775a0edb0b705896fef7c6
38
66
  remote: https://github.com/ruby/gem_rbs_collection.git
39
67
  repo_dir: gems
40
68
  - name: concurrent-ruby
@@ -42,7 +70,7 @@ gems:
42
70
  source:
43
71
  type: git
44
72
  name: ruby/gem_rbs_collection
45
- revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
73
+ revision: 2443035126922ee49f775a0edb0b705896fef7c6
46
74
  remote: https://github.com/ruby/gem_rbs_collection.git
47
75
  repo_dir: gems
48
76
  - name: connection_pool
@@ -50,7 +78,7 @@ gems:
50
78
  source:
51
79
  type: git
52
80
  name: ruby/gem_rbs_collection
53
- revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
81
+ revision: 2443035126922ee49f775a0edb0b705896fef7c6
54
82
  remote: https://github.com/ruby/gem_rbs_collection.git
55
83
  repo_dir: gems
56
84
  - name: date
@@ -74,7 +102,7 @@ gems:
74
102
  source:
75
103
  type: git
76
104
  name: ruby/gem_rbs_collection
77
- revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
105
+ revision: 2443035126922ee49f775a0edb0b705896fef7c6
78
106
  remote: https://github.com/ruby/gem_rbs_collection.git
79
107
  repo_dir: gems
80
108
  - name: i18n
@@ -82,7 +110,7 @@ gems:
82
110
  source:
83
111
  type: git
84
112
  name: ruby/gem_rbs_collection
85
- revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
113
+ revision: 2443035126922ee49f775a0edb0b705896fef7c6
86
114
  remote: https://github.com/ruby/gem_rbs_collection.git
87
115
  repo_dir: gems
88
116
  - name: json
@@ -90,15 +118,19 @@ gems:
90
118
  source:
91
119
  type: stdlib
92
120
  - name: logger
93
- version: '0'
121
+ version: '1.7'
94
122
  source:
95
- type: stdlib
123
+ type: git
124
+ name: ruby/gem_rbs_collection
125
+ revision: 2443035126922ee49f775a0edb0b705896fef7c6
126
+ remote: https://github.com/ruby/gem_rbs_collection.git
127
+ repo_dir: gems
96
128
  - name: minitest
97
129
  version: '5.25'
98
130
  source:
99
131
  type: git
100
132
  name: ruby/gem_rbs_collection
101
- revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
133
+ revision: 2443035126922ee49f775a0edb0b705896fef7c6
102
134
  remote: https://github.com/ruby/gem_rbs_collection.git
103
135
  repo_dir: gems
104
136
  - name: monitor
@@ -118,9 +150,21 @@ gems:
118
150
  source:
119
151
  type: stdlib
120
152
  - name: prism
121
- version: 1.7.0
153
+ version: 1.9.0
122
154
  source:
123
155
  type: rubygems
156
+ - name: rack
157
+ version: '2.2'
158
+ source:
159
+ type: git
160
+ name: ruby/gem_rbs_collection
161
+ revision: 2443035126922ee49f775a0edb0b705896fef7c6
162
+ remote: https://github.com/ruby/gem_rbs_collection.git
163
+ repo_dir: gems
164
+ - name: random-formatter
165
+ version: '0'
166
+ source:
167
+ type: stdlib
124
168
  - name: securerandom
125
169
  version: '0'
126
170
  source:
@@ -138,13 +182,17 @@ gems:
138
182
  source:
139
183
  type: git
140
184
  name: ruby/gem_rbs_collection
141
- revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
185
+ revision: 2443035126922ee49f775a0edb0b705896fef7c6
142
186
  remote: https://github.com/ruby/gem_rbs_collection.git
143
187
  repo_dir: gems
144
188
  - name: stringio
145
189
  version: '0'
146
190
  source:
147
191
  type: stdlib
192
+ - name: tempfile
193
+ version: '0'
194
+ source:
195
+ type: stdlib
148
196
  - name: time
149
197
  version: '0'
150
198
  source:
@@ -153,6 +201,10 @@ gems:
153
201
  version: '0'
154
202
  source:
155
203
  type: stdlib
204
+ - name: tmpdir
205
+ version: '0'
206
+ source:
207
+ type: stdlib
156
208
  - name: tsort
157
209
  version: '0'
158
210
  source:
@@ -162,7 +214,7 @@ gems:
162
214
  source:
163
215
  type: git
164
216
  name: ruby/gem_rbs_collection
165
- revision: 81fa8bd0617286078617a62b6a3229cebfd4af23
217
+ revision: 2443035126922ee49f775a0edb0b705896fef7c6
166
218
  remote: https://github.com/ruby/gem_rbs_collection.git
167
219
  repo_dir: gems
168
220
  - name: uri
data/rbs_collection.yaml CHANGED
@@ -10,5 +10,9 @@ path: .gem_rbs_collection
10
10
 
11
11
  gems:
12
12
  - name: net-http
13
+ - name: actionpack
14
+ - name: actionview
15
+ - name: rack
13
16
  - name: activerecord
17
+ - name: activemodel
14
18
  - name: tsort
@@ -0,0 +1,11 @@
1
+ # Generated from app/controllers/job_workflow/monitoring/application_controller.rb with RBS::Inline
2
+
3
+ module JobWorkflow
4
+ module Monitoring
5
+ # Resolve the host app controller at load time so engine controllers inherit
6
+ # the app's existing authentication and access control hooks.
7
+ # @rbs inherits ActionController::Base
8
+ class ApplicationController < ActionController::Base
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,21 @@
1
+ # Generated from app/controllers/job_workflow/monitoring/executions_controller.rb with RBS::Inline
2
+
3
+ module JobWorkflow
4
+ module Monitoring
5
+ class ExecutionsController < ApplicationController
6
+ @workflow: singleton(DSL)
7
+
8
+ @page: ExecutionPage
9
+
10
+ @executions: Array[ExecutionViewModel]
11
+
12
+ @execution: ExecutionViewModel
13
+
14
+ # : () -> void
15
+ def index: () -> void
16
+
17
+ # : () -> void
18
+ def show: () -> void
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,12 @@
1
+ # Generated from app/controllers/job_workflow/monitoring/workflows_controller.rb with RBS::Inline
2
+
3
+ module JobWorkflow
4
+ module Monitoring
5
+ class WorkflowsController < ApplicationController
6
+ @workflows: Array[WorkflowDefinition]
7
+
8
+ # : () -> void
9
+ def index: () -> void
10
+ end
11
+ end
12
+ end
@@ -3,6 +3,8 @@
3
3
  module JobWorkflow
4
4
  module AutoScaling
5
5
  class Executor
6
+ @adapter: Adapter::_InstanceMethods
7
+
6
8
  # : (Configuration) -> void
7
9
  def initialize: (Configuration) -> void
8
10
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  module JobWorkflow
4
4
  module DSL
5
+ @_context: Context?
6
+
5
7
  extend ActiveSupport::Concern
6
8
 
7
9
  include ActiveJob::Continuable
@@ -16,6 +18,8 @@ module JobWorkflow
16
18
 
17
19
  def queue_name: () -> String
18
20
 
21
+ def arguments: () -> Array[untyped]
22
+
19
23
  def set: (Hash[Symbol, untyped]) -> self
20
24
 
21
25
  def step: (Symbol, ?start: ActiveJob::Continuation::_Succ, ?isolated: bool) -> void
@@ -70,7 +70,8 @@ module JobWorkflow
70
70
  # : (Hash[Symbol, untyped]) -> Array[untyped?]
71
71
  def extract_otel_info: (Hash[Symbol, untyped]) -> Array[untyped?]
72
72
 
73
- def start_span: (untyped name, untyped payload) -> untyped
73
+ # : (String, Hash[Symbol, untyped]) -> untyped
74
+ def start_span: (String, Hash[Symbol, untyped]) -> untyped
74
75
 
75
76
  # : (untyped) -> untyped
76
77
  def attach_span_context: (untyped) -> untyped
@@ -14,8 +14,7 @@ module JobWorkflow
14
14
  # JobWorkflow.logger.formatter = JobWorkflow::Logger::JsonFormatter.new(log_tags: [:request_id])
15
15
  # ```
16
16
  module Logger
17
- # : (ActiveSupport::Logger) -> void
18
- attr_writer logger: untyped
17
+ attr_writer logger: ActiveSupport::Logger
19
18
 
20
19
  # : () -> ActiveSupport::Logger
21
20
  def logger: () -> ActiveSupport::Logger
@@ -3,6 +3,12 @@
3
3
  module JobWorkflow
4
4
  module Monitoring
5
5
  class DagLayout
6
+ @node_positions: Hash[Symbol, Hash[Symbol, Integer]]
7
+
8
+ @edges: Array[Hash[Symbol, untyped]]
9
+
10
+ @nodes: Array[Hash[Symbol, untyped]]
11
+
6
12
  NODE_WIDTH: ::Integer
7
13
 
8
14
  NODE_HEIGHT: ::Integer
@@ -3,6 +3,12 @@
3
3
  module JobWorkflow
4
4
  module Monitoring
5
5
  class ExecutionViewModel
6
+ @dag_layout: Hash[Symbol, untyped]
7
+
8
+ @failed_task_name: Symbol?
9
+
10
+ @tasks: Array[Hash[Symbol, untyped]]
11
+
6
12
  attr_reader job_id: String
7
13
 
8
14
  attr_reader queue_name: String?
@@ -50,8 +56,8 @@ module JobWorkflow
50
56
  # : (Symbol, Array[TaskOutput], Array[TaskJobStatus]) -> Symbol
51
57
  def task_status: (Symbol, Array[TaskOutput], Array[TaskJobStatus]) -> Symbol
52
58
 
53
- # : (Array[TaskOutput], Array[TaskJobStatus]) -> bool
54
- def completed_task?: (Array[TaskOutput], Array[TaskJobStatus]) -> bool
59
+ # : (Symbol, Array[TaskOutput], Array[TaskJobStatus]) -> bool
60
+ def completed_task?: (Symbol, Array[TaskOutput], Array[TaskJobStatus]) -> bool
55
61
 
56
62
  # : (Symbol, Array[TaskJobStatus]) -> bool
57
63
  def task_running?: (Symbol, Array[TaskJobStatus]) -> bool
@@ -2,11 +2,13 @@
2
2
 
3
3
  module JobWorkflow
4
4
  module Monitoring
5
+ def self.base_controller_class: () -> untyped
6
+
5
7
  # : () -> Array[WorkflowDefinition]
6
8
  def self.workflows: () -> Array[WorkflowDefinition]
7
9
 
8
- # : (String?, Symbol?) -> String?
9
- def self.mission_control_job_path: (String?, Symbol?) -> String?
10
+ # : (String?, ?status: Symbol?) -> String?
11
+ def self.mission_control_job_path: (String?, ?status: Symbol?) -> String?
10
12
 
11
13
  # : () -> String
12
14
  def self.resolved_base_controller_class: () -> String
@@ -4,10 +4,17 @@ module JobWorkflow
4
4
  module QueueAdapters
5
5
  # rubocop:disable Naming/PredicateMethod
6
6
  class NullAdapter < Abstract
7
+ @stored_jobs: Hash[String, Hash[String, untyped]]
8
+
9
+ @queue_jobs: Hash[String, Array[untyped]]
10
+
11
+ @paused_queues: Set[String]
12
+
7
13
  # : () -> void
8
14
  def initialize_adapter!: () -> void
9
15
 
10
- def initialize: () -> untyped
16
+ # : () -> void
17
+ def initialize: () -> void
11
18
 
12
19
  # : () -> bool
13
20
  def semaphore_available?: () -> bool
@@ -31,8 +31,8 @@ module JobWorkflow
31
31
  # : (Hash[Symbol, untyped]) -> Context
32
32
  def build_context: (Hash[Symbol, untyped]) -> Context
33
33
 
34
- # : (job_class_name: String) -> Workflow
35
- def resolve_workflow: (job_class_name: String) -> Workflow
34
+ # : (String job_class_name) -> Workflow
35
+ def resolve_workflow: (String job_class_name) -> Workflow
36
36
 
37
37
  # : (Hash[Symbol, untyped]) -> Hash[String, untyped]
38
38
  def extract_context_data: (Hash[Symbol, untyped]) -> Hash[String, untyped]
@@ -2,6 +2,8 @@
2
2
 
3
3
  module JobWorkflow
4
4
  class TaskGraph
5
+ @tasks: Hash[Symbol, Task]
6
+
5
7
  include TSort[Task]
6
8
 
7
9
  include Enumerable[Task]
@@ -2,6 +2,14 @@
2
2
 
3
3
  module JobWorkflow
4
4
  class Workflow
5
+ @schedules: Hash[Symbol, Schedule]
6
+
7
+ @hook_registry: HookRegistry
8
+
9
+ @argument_defs: Hash[Symbol, ArgumentDef]
10
+
11
+ @task_graph: TaskGraph
12
+
5
13
  attr_reader dry_run_config: DryRunConfig
6
14
 
7
15
  # : () -> void