job-workflow 0.6.1 → 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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +10 -0
  3. data/CHANGELOG.md +8 -0
  4. data/README.md +1 -1
  5. data/Rakefile +1 -1
  6. data/Steepfile +4 -0
  7. data/app/controllers/job_workflow/monitoring/application_controller.rb +1 -0
  8. data/app/controllers/job_workflow/monitoring/executions_controller.rb +7 -0
  9. data/app/controllers/job_workflow/monitoring/workflows_controller.rb +3 -0
  10. data/guides/PRODUCTION_DEPLOYMENT.md +1 -1
  11. data/guides/README.md +1 -1
  12. data/lib/job_workflow/auto_scaling/executor.rb +3 -1
  13. data/lib/job_workflow/context.rb +5 -8
  14. data/lib/job_workflow/dsl.rb +14 -8
  15. data/lib/job_workflow/instrumentation/opentelemetry_subscriber.rb +2 -0
  16. data/lib/job_workflow/logger.rb +1 -2
  17. data/lib/job_workflow/monitoring/dag_layout.rb +4 -0
  18. data/lib/job_workflow/monitoring/execution_view_model.rb +6 -2
  19. data/lib/job_workflow/monitoring.rb +4 -1
  20. data/lib/job_workflow/queue_adapters/null_adapter.rb +6 -1
  21. data/lib/job_workflow/sub_task_job.rb +3 -2
  22. data/lib/job_workflow/task_graph.rb +2 -0
  23. data/lib/job_workflow/task_output.rb +3 -1
  24. data/lib/job_workflow/version.rb +1 -1
  25. data/lib/job_workflow/workflow.rb +8 -1
  26. data/lib/job_workflow/workflow_status.rb +2 -1
  27. data/rbs_collection.lock.yaml +67 -15
  28. data/rbs_collection.yaml +4 -0
  29. data/sig/generated/controllers/job_workflow/monitoring/application_controller.rbs +11 -0
  30. data/sig/generated/controllers/job_workflow/monitoring/executions_controller.rbs +21 -0
  31. data/sig/generated/controllers/job_workflow/monitoring/workflows_controller.rbs +12 -0
  32. data/sig/generated/job_workflow/auto_scaling/executor.rbs +2 -0
  33. data/sig/generated/job_workflow/dsl.rbs +4 -0
  34. data/sig/generated/job_workflow/instrumentation/opentelemetry_subscriber.rbs +2 -1
  35. data/sig/generated/job_workflow/logger.rbs +1 -2
  36. data/sig/generated/job_workflow/monitoring/dag_layout.rbs +6 -0
  37. data/sig/generated/job_workflow/monitoring/execution_view_model.rbs +6 -0
  38. data/sig/generated/job_workflow/monitoring.rbs +4 -2
  39. data/sig/generated/job_workflow/queue_adapters/null_adapter.rbs +8 -1
  40. data/sig/generated/job_workflow/sub_task_job.rbs +2 -2
  41. data/sig/generated/job_workflow/task_graph.rbs +2 -0
  42. data/sig/generated/job_workflow/workflow.rbs +8 -0
  43. data/sig-private/activejob.rbs +7 -0
  44. data/sig-private/job-workflow.rbs +2 -1
  45. data/sig-private/mission_control.rbs +10 -0
  46. data/sig-private/rails.rbs +7 -0
  47. data/sig-private/solid_queue.rbs +1 -1
  48. metadata +5 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08ad79c285a78a258aaafdf2cca6141982291f52c00a7c95412a7df728f96217'
4
- data.tar.gz: 4fba62aa4a507ab75f8fb33ac21b1fadaa409452f985be9e1eedff0a010a3614
3
+ metadata.gz: 54b1b4244da651dd7a48b083dbff5194d414964a2269fa53580d3d6b68f9428e
4
+ data.tar.gz: bad5b87fe9e7f60699841de280554e05d8e07025d0cc01bdaa972b1ca24f37d0
5
5
  SHA512:
6
- metadata.gz: 5b079b1bb1b534b9952de0b431d6fac1658e9581ea30d22cbe5b0737e7c7748f78af68a46880500d8c3da9edc51bf5b4e558adf568ae1f0ce014cf77bd336ab8
7
- data.tar.gz: fc2a98038a737cd4bc47c4f029bc2df17d55ec6d2ce16ca031f14a84cce8ac5a9418f20b18fc8174a2e157b74488557e4335bbed9afe71582141adc97ea28a00
6
+ metadata.gz: 445ed81a6feb664a4f9ef139f7178e74701c9507b2cb0e91b017b9998b076bb8d7000bf2ce169a965ae797002ebe7e82596e18bb03200a06b22fd2ebac29ee5c
7
+ data.tar.gz: 35242db3bb8c3d0cf11f35be438eae04f929af4c77268326990512ca124acfe0b63876dd3618f9e24d44c1e04ab4014293f14ff90d540c4810b594b88e57a0a8
data/.rubocop.yml CHANGED
@@ -8,6 +8,7 @@ AllCops:
8
8
  TargetRubyVersion: 3.1
9
9
  NewCops: enable
10
10
  SuggestExtensions: false
11
+ UseProjectIndex: true
11
12
  Exclude:
12
13
  - examples/**/*
13
14
  - tmp/**/*
@@ -80,6 +81,15 @@ RSpec/ExampleLength:
80
81
  Style/Documentation:
81
82
  Enabled: false
82
83
 
84
+ Style/RbsInline:
85
+ Mode: opt_out
86
+
87
+ Style/RbsInline/MissingTypeAnnotation:
88
+ EnforcedStyle: method_type_signature
89
+
90
+ Style/RbsInline/RedundantTypeAnnotation:
91
+ EnforcedStyle: method_type_signature
92
+
83
93
  Style/StringLiterals:
84
94
  EnforcedStyle: double_quotes
85
95
 
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.6.2] - 2026-08-09
4
+
5
+ ### Changed
6
+
7
+ - Extend RBS/Steep type checking to the monitoring Rails controllers and add signatures for Rails, Mission Control Jobs, and Solid Queue integrations
8
+ - Upgrade the RBS inline, Steep, and RuboCop development tooling used by the type and lint checks
9
+ - Keep the Rails 8.1 example app's lint task compatible with the root RuboCop configuration
10
+
3
11
  ## [0.6.1] - 2026-06-01
4
12
 
5
13
  ### Fixed
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # JobWorkflow
2
2
 
3
- > ⚠️ **Early Stage (v0.6.1):** This library is in active development. APIs and features may change in breaking ways without notice. Use in production at your own risk and expect potential breaking changes in future releases.
3
+ > ⚠️ **Early Stage (v0.6.2):** This library is in active development. APIs and features may change in breaking ways without notice. Use in production at your own risk and expect potential breaking changes in future releases.
4
4
 
5
5
  ## Overview
6
6
 
data/Rakefile CHANGED
@@ -40,7 +40,7 @@ namespace :rbs do
40
40
  require "rbs/inline"
41
41
  require "rbs/inline/cli"
42
42
  FileUtils.rm_r(File.expand_path("sig/generated", __dir__), secure: true)
43
- RBS::Inline::CLI.new.run(%w[lib --output --opt-out])
43
+ RBS::Inline::CLI.new.run(%w[app lib --output --opt-out])
44
44
  end
45
45
  end
46
46
 
data/Steepfile CHANGED
@@ -5,6 +5,10 @@
5
5
  target :lib do
6
6
  signature "sig"
7
7
  signature "sig-private"
8
+ library "actionpack"
9
+ library "actionview"
10
+ library "rack"
8
11
 
9
12
  check "lib"
13
+ check "app"
10
14
  end
@@ -4,6 +4,7 @@ module JobWorkflow
4
4
  module Monitoring
5
5
  # Resolve the host app controller at load time so engine controllers inherit
6
6
  # the app's existing authentication and access control hooks.
7
+ # @rbs inherits ActionController::Base
7
8
  class ApplicationController < JobWorkflow::Monitoring.resolved_base_controller_class.constantize
8
9
  layout "job_workflow/monitoring/application"
9
10
  end
@@ -3,6 +3,12 @@
3
3
  module JobWorkflow
4
4
  module Monitoring
5
5
  class ExecutionsController < ApplicationController
6
+ # @rbs @workflow: singleton(DSL)
7
+ # @rbs @page: ExecutionPage
8
+ # @rbs @executions: Array[ExecutionViewModel]
9
+ # @rbs @execution: ExecutionViewModel
10
+
11
+ #: () -> void
6
12
  def index
7
13
  @workflow = WorkflowRegistry.find(params[:workflow_job_class_name])
8
14
  return render plain: "Workflow definition not found.", status: :not_found if @workflow.nil?
@@ -14,6 +20,7 @@ module JobWorkflow
14
20
  @executions = @page.executions
15
21
  end
16
22
 
23
+ #: () -> void
17
24
  def show
18
25
  @workflow = WorkflowRegistry.find(params[:workflow_job_class_name])
19
26
  return render plain: "Workflow definition not found.", status: :not_found if @workflow.nil?
@@ -3,6 +3,9 @@
3
3
  module JobWorkflow
4
4
  module Monitoring
5
5
  class WorkflowsController < ApplicationController
6
+ # @rbs @workflows: Array[WorkflowDefinition]
7
+
8
+ #: () -> void
6
9
  def index
7
10
  @workflows = Monitoring.workflows
8
11
  end
@@ -1,6 +1,6 @@
1
1
  # Production Deployment
2
2
 
3
- > ⚠️ **Early Stage (v0.6.1):** JobWorkflow is still in early development. While this section outlines potential deployment patterns, please thoroughly test in your specific environment and monitor for any issues before relying on JobWorkflow in critical production systems.
3
+ > ⚠️ **Early Stage (v0.6.2):** JobWorkflow is still in early development. While this section outlines potential deployment patterns, please thoroughly test in your specific environment and monitor for any issues before relying on JobWorkflow in critical production systems.
4
4
 
5
5
  This section covers suggested settings and patterns for running JobWorkflow in production-like environments.
6
6
 
data/guides/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # JobWorkflow Guides
2
2
 
3
- > ⚠️ **Early Stage (v0.6.1):** JobWorkflow is in active development. APIs and features may change. The following guides provide patterns and examples for building workflows, but be aware that implementations may need adjustment as the library evolves.
3
+ > ⚠️ **Early Stage (v0.6.2):** JobWorkflow is in active development. APIs and features may change. The following guides provide patterns and examples for building workflows, but be aware that implementations may need adjustment as the library evolves.
4
4
 
5
5
  Welcome to the JobWorkflow documentation! This directory contains comprehensive guides to help you build robust workflows with JobWorkflow.
6
6
 
@@ -3,6 +3,8 @@
3
3
  module JobWorkflow
4
4
  module AutoScaling
5
5
  class Executor
6
+ # @rbs @adapter: Adapter::_InstanceMethods
7
+
6
8
  #: (Configuration) -> void
7
9
  def initialize(config)
8
10
  @config = config
@@ -36,7 +38,7 @@ module JobWorkflow
36
38
 
37
39
  #: () -> Array[Integer]
38
40
  def desired_count_list
39
- config.min_count.step(config.max_count, config.step_count).to_a
41
+ config.min_count.step(config.max_count, config.step_count).to_a #: Array[Integer]
40
42
  end
41
43
  end
42
44
  end
@@ -120,8 +120,7 @@ module JobWorkflow
120
120
 
121
121
  #: () -> String
122
122
  def job_id
123
- local_job = job
124
- raise "job is not set" if local_job.nil?
123
+ local_job = job || (raise "job is not set")
125
124
 
126
125
  local_job.job_id
127
126
  end
@@ -215,11 +214,8 @@ module JobWorkflow
215
214
 
216
215
  #: (?Symbol?, ?fallback: untyped) { () -> untyped } -> untyped
217
216
  def skip_in_dry_run(dry_run_name = nil, fallback: nil)
218
- local_job = job
219
- task = task_context.task
220
-
221
- raise "job is not set" if local_job.nil?
222
- raise "skip_in_dry_run can be called only within with_task_context" if task.nil?
217
+ local_job = job || (raise "job is not set")
218
+ task_context.task || (raise "skip_in_dry_run can be called only within with_task_context")
223
219
 
224
220
  current_index = skip_in_dry_run_index
225
221
  self.skip_in_dry_run_index += 1
@@ -298,7 +294,8 @@ module JobWorkflow
298
294
 
299
295
  #: () -> bool
300
296
  def each_task?
301
- task_context.task.each?
297
+ task = task_context.task || (raise "each_task? can be called only in task")
298
+ task.each?
302
299
  end
303
300
 
304
301
  #: (untyped) -> untyped
@@ -2,6 +2,8 @@
2
2
 
3
3
  module JobWorkflow
4
4
  module DSL
5
+ # @rbs @_context: Context?
6
+
5
7
  extend ActiveSupport::Concern
6
8
 
7
9
  include ActiveJob::Continuable
@@ -19,6 +21,8 @@ module JobWorkflow
19
21
  #
20
22
  # def queue_name: () -> String
21
23
  #
24
+ # def arguments: () -> Array[untyped]
25
+ #
22
26
  # def set: (Hash[Symbol, untyped]) -> self
23
27
  #
24
28
  # def step: (Symbol, ?start: ActiveJob::Continuation::_Succ, ?isolated: bool) -> void
@@ -33,13 +37,13 @@ module JobWorkflow
33
37
  #: (Hash[untyped, untyped]) -> void
34
38
  def perform(arguments)
35
39
  self._context ||= Context.from_hash({ job: self, workflow: self.class._workflow })
36
- context = self._context #: Context
40
+ context = _context #: Context
37
41
  Runner.new(context: context._update_arguments(arguments)).run
38
42
  end
39
43
 
40
44
  #: () -> Output
41
45
  def output
42
- context = self._context
46
+ context = _context
43
47
  raise "context is not set." if context.nil?
44
48
 
45
49
  context.output
@@ -211,14 +215,16 @@ module JobWorkflow
211
215
  # ) -> void
212
216
  def workflow_concurrency(to:, key:, **opts)
213
217
  concurrency_key_proc = key
218
+ wrapped_key = proc {
219
+ # @type self: DSL
220
+ ctx = _context || Context.from_hash(
221
+ job: self, workflow: self.class._workflow
222
+ )._update_arguments((arguments.first || {}).symbolize_keys)
223
+ concurrency_key_proc.call(ctx)
224
+ } #: ^(untyped) -> untyped
214
225
  limits_concurrency(
215
226
  to:,
216
- key: proc {
217
- ctx = _context || Context.from_hash(
218
- job: self, workflow: self.class._workflow
219
- )._update_arguments((arguments.first || {}).symbolize_keys)
220
- concurrency_key_proc.call(ctx)
221
- },
227
+ key: wrapped_key,
222
228
  **opts
223
229
  )
224
230
  end
@@ -45,6 +45,7 @@ module JobWorkflow
45
45
  # @rbs!
46
46
  # def self.subscriptions: () -> Array[untyped]
47
47
  # def self.subscriptions=: (Array[untyped]) -> void
48
+
48
49
  cattr_accessor :subscriptions, instance_accessor: false, default: []
49
50
 
50
51
  class << self
@@ -110,6 +111,7 @@ module JobWorkflow
110
111
  [span, token]
111
112
  end
112
113
 
114
+ #: (String, Hash[Symbol, untyped]) -> untyped
113
115
  def start_span(name, payload)
114
116
  span_name = build_span_name(name, payload)
115
117
  attributes = build_attributes(payload)
@@ -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
17
+ attr_writer :logger #: ActiveSupport::Logger
19
18
 
20
19
  #: () -> ActiveSupport::Logger
21
20
  def logger
@@ -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
@@ -223,8 +227,8 @@ module JobWorkflow
223
227
  def each_progress(task_outputs, task_job_statuses)
224
228
  {
225
229
  total: [task_outputs.size, task_job_statuses.size].max,
226
- succeeded: task_job_statuses.count(&:succeeded?),
227
- 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
228
232
  pending: task_job_statuses.count { |task_status| task_status.status == :pending },
229
233
  running: task_job_statuses.count { |task_status| task_status.status == :running }
230
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.1" # : 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
@@ -49,7 +49,8 @@ module JobWorkflow
49
49
 
50
50
  #: (Hash[String, untyped]) -> Array[Symbol]
51
51
  def completed_task_names_from_job_data(data)
52
- Array(data.dig("continuation", "completed")).map(&:to_sym)
52
+ task_names = Array(data.dig("continuation", "completed")) #: Array[String]
53
+ task_names.map { |task_name| task_name.to_sym } # rubocop:disable Style/SymbolProc
53
54
  end
54
55
 
55
56
  #: (Hash[String, untyped], Workflow) -> Context
@@ -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: 3f5e8df1ce89ea06067fa42263012c968b4e583e
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: 3f5e8df1ce89ea06067fa42263012c968b4e583e
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: 3f5e8df1ce89ea06067fa42263012c968b4e583e
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: 3f5e8df1ce89ea06067fa42263012c968b4e583e
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: 3f5e8df1ce89ea06067fa42263012c968b4e583e
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: 3f5e8df1ce89ea06067fa42263012c968b4e583e
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: 3f5e8df1ce89ea06067fa42263012c968b4e583e
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: 3f5e8df1ce89ea06067fa42263012c968b4e583e
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: 3f5e8df1ce89ea06067fa42263012c968b4e583e
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: 3f5e8df1ce89ea06067fa42263012c968b4e583e
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: 3f5e8df1ce89ea06067fa42263012c968b4e583e
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?
@@ -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
@@ -1,5 +1,10 @@
1
1
  module ActiveJob
2
2
  def self.perform_all_later: (*ActiveJob::Base) -> void
3
+ | (Array[ActiveJob::Base]) -> void
4
+
5
+ class Base
6
+ def set: (Hash[Symbol, untyped]) -> self
7
+ end
3
8
 
4
9
  module Continuable
5
10
  def step: (Symbol, ?start: ActiveJob::Continuation::_Succ, ?isolated: bool) -> void
@@ -15,6 +20,8 @@ module ActiveJob
15
20
  end
16
21
 
17
22
  class Step
23
+ def cursor: () -> untyped
24
+
18
25
  def advance!: (?from: _Succ?) -> void
19
26
 
20
27
  def advanced?: () -> bool
@@ -1,10 +1,11 @@
1
1
  module JobWorkflow
2
2
  interface _JobInterface
3
+ def class: () -> untyped
3
4
  def job_id: () -> String
4
5
  def queue_name: () -> String
5
6
  def serialize: () -> Hash[String, untyped]
6
7
  def _context: () -> JobWorkflow::Context?
7
- def _context=: (JobWorkflow::Context) -> JobWorkflow::Context
8
+ def _context=: (JobWorkflow::Context) -> void
8
9
  def step: (Symbol, ?start: ActiveJob::Continuation::_Succ, ?isolated: bool) -> void
9
10
  | (Symbol, ?start: ActiveJob::Continuation::_Succ, ?isolated: bool) { (ActiveJob::Continuation::Step) -> void } -> void
10
11
  end
@@ -0,0 +1,10 @@
1
+ module MissionControl
2
+ module Jobs
3
+ def self.base_controller_class: () -> untyped
4
+ def self.applications: () -> Array[untyped]
5
+
6
+ class Engine
7
+ def self.routes: () -> untyped
8
+ end
9
+ end
10
+ end
@@ -1,5 +1,12 @@
1
1
  module Rails
2
+ def self.application: () -> untyped
3
+
2
4
  class Engine
3
5
  def self.isolate_namespace: (Module) -> void
6
+ def self.config: () -> untyped
7
+ end
8
+
9
+ class Railtie
10
+ def self.config: () -> untyped
4
11
  end
5
12
  end
@@ -102,7 +102,7 @@ module SolidQueue
102
102
  end
103
103
 
104
104
  class Worker
105
- def self.on_worker_stop: (Proc) -> void
105
+ def self.on_stop: () { (Worker) -> void } -> void
106
106
  def self.lifecycle_hooks: () -> Hash[Symbol, Array[Proc]]
107
107
  end
108
108
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: job-workflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - shoma07
@@ -142,9 +142,13 @@ files:
142
142
  - sig-private/activesupport.rbs
143
143
  - sig-private/aws.rbs
144
144
  - sig-private/job-workflow.rbs
145
+ - sig-private/mission_control.rbs
145
146
  - sig-private/opentelemetry.rbs
146
147
  - sig-private/rails.rbs
147
148
  - sig-private/solid_queue.rbs
149
+ - sig/generated/controllers/job_workflow/monitoring/application_controller.rbs
150
+ - sig/generated/controllers/job_workflow/monitoring/executions_controller.rbs
151
+ - sig/generated/controllers/job_workflow/monitoring/workflows_controller.rbs
148
152
  - sig/generated/job-workflow.rbs
149
153
  - sig/generated/job_workflow.rbs
150
154
  - sig/generated/job_workflow/argument_def.rbs