Class: Ocak::PipelineRunner

Inherits:
Object
  • Object
show all
Includes:
BatchProcessing, FailureReporting, InstanceBuilders, MergeOrchestration, ShutdownHandling
Defined in:
lib/ocak/pipeline_runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ShutdownHandling

#print_shutdown_summary, #shutdown!

Methods included from FailureReporting

#report_pipeline_failure

Constructor Details

#initialize(config:, options: {}) ⇒ PipelineRunner

Returns a new instance of PipelineRunner.



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/ocak/pipeline_runner.rb', line 25

def initialize(config:, options: {})
  @config = config
  @options = options
  @watch_formatter = options[:watch] ? WatchFormatter.new : nil
  @shutting_down = false
  @shutdown_count = 0
  @active_issues = []
  @interrupted_issues = []
  @active_mutex = Mutex.new
  @registry = ProcessRegistry.new
  @executor = PipelineExecutor.new(config: config, shutdown_check: -> { @shutting_down })
end

Instance Attribute Details

#registryObject (readonly)

Returns the value of attribute registry.



23
24
25
# File 'lib/ocak/pipeline_runner.rb', line 23

def registry
  @registry
end

Instance Method Details

#runObject



38
39
40
# File 'lib/ocak/pipeline_runner.rb', line 38

def run
  @options[:single] ? run_single(@options[:single]) : run_loop
end

#run_pipeline(issue_number, logger:, claude:, chdir: nil, skip_steps: [], complexity: 'full', skip_merge: false) ⇒ Object

rubocop:disable Metrics/ParameterLists



42
43
44
45
46
47
# File 'lib/ocak/pipeline_runner.rb', line 42

def run_pipeline(issue_number, logger:, claude:, chdir: nil, skip_steps: [], complexity: 'full', # rubocop:disable Metrics/ParameterLists
                 skip_merge: false)
  @executor.run_pipeline(issue_number, logger: logger, claude: claude, chdir: chdir,
                                       skip_steps: skip_steps, complexity: complexity,
                                       skip_merge: skip_merge)
end

#shutting_down?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/ocak/pipeline_runner.rb', line 49

def shutting_down?
  @shutting_down
end