Class: Aidp::Watch::AutoProcessor
- Inherits:
-
Object
- Object
- Aidp::Watch::AutoProcessor
- Includes:
- MessageDisplay
- Defined in:
- lib/aidp/watch/auto_processor.rb
Overview
Handles the aidp-auto label on issues by delegating to the BuildProcessor and transferring the label to the created PR once work completes.
Constant Summary collapse
- DEFAULT_AUTO_LABEL =
"aidp-auto"
Constants included from MessageDisplay
Instance Attribute Summary collapse
-
#auto_label ⇒ Object
readonly
Returns the value of attribute auto_label.
Instance Method Summary collapse
-
#initialize(repository_client:, state_store:, build_processor:, label_config: {}, verbose: false) ⇒ AutoProcessor
constructor
A new instance of AutoProcessor.
- #process(issue) ⇒ Object
Methods included from MessageDisplay
#display_message, included, #message_display_prompt
Constructor Details
#initialize(repository_client:, state_store:, build_processor:, label_config: {}, verbose: false) ⇒ AutoProcessor
Returns a new instance of AutoProcessor.
16 17 18 19 20 21 22 23 24 |
# File 'lib/aidp/watch/auto_processor.rb', line 16 def initialize(repository_client:, state_store:, build_processor:, label_config: {}, verbose: false) @repository_client = repository_client @state_store = state_store @build_processor = build_processor @verbose = verbose # Allow overrides from watch config @auto_label = label_config[:auto_trigger] || label_config["auto_trigger"] || DEFAULT_AUTO_LABEL end |
Instance Attribute Details
#auto_label ⇒ Object (readonly)
Returns the value of attribute auto_label.
14 15 16 |
# File 'lib/aidp/watch/auto_processor.rb', line 14 def auto_label @auto_label end |
Instance Method Details
#process(issue) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/aidp/watch/auto_processor.rb', line 26 def process(issue) number = issue[:number] Aidp.log_debug("auto_processor", "process_started", issue: number, title: issue[:title]) ("🤖 Starting autonomous build for issue ##{number}", type: :info) @build_processor.process(issue) status = @state_store.build_status(number) pr_url = status["pr_url"] pr_number = extract_pr_number(pr_url) unless status["status"] == "completed" && pr_number Aidp.log_debug("auto_processor", "no_pr_to_transfer", issue: number, status: status["status"], pr_url: pr_url) return end transfer_label_to_pr(issue_number: number, pr_number: pr_number) rescue => e Aidp.log_error("auto_processor", "process_failed", issue: issue[:number], error: e., error_class: e.class.name) ("❌ aidp-auto failed for issue ##{issue[:number]}: #{e.}", type: :error) end |