brainiac-basecamp 0.0.4 → 0.0.5
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7fc3e97a3831ea52b8b8ed95e479cf1dcc04b8031d186d591cba88c04108b643
|
|
4
|
+
data.tar.gz: 8766b1a4a63878042b465994bff6665b02004a4ad0a1296d60ecfdc84673643f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f4a8e2e10898afd01360bed9d56316590288017be8003348ca3b9c85d561d58b22fe6afbc424fe10e1bbf7ab92aa67c674464d3e1ba402697873cd2ebb2beb03
|
|
7
|
+
data.tar.gz: 1964a896b5c3442bb0308c8f363a14dfd813e707086bb31bcea081cf7687b0ec26b3fbea4ddc9130c0f230e4d472e4d3a7dec2036e9f2721e09aaf0ea6864144
|
|
@@ -295,11 +295,15 @@ module Brainiac
|
|
|
295
295
|
end
|
|
296
296
|
|
|
297
297
|
# Dispatch a Fizzy card to the appropriate agent.
|
|
298
|
+
# Uses the project-specific agent if configured, otherwise falls back to the epic's agent.
|
|
298
299
|
def dispatch_card(epic, task)
|
|
299
300
|
card_number = task.fizzy_card
|
|
300
|
-
agent = epic["agent"]
|
|
301
301
|
|
|
302
|
-
|
|
302
|
+
# Resolve agent from project config — each project can have its own default agent
|
|
303
|
+
project_key = task.is_a?(Hash) ? task["project"] : task.project
|
|
304
|
+
agent = resolve_agent_for_project(project_key) || epic["agent"]
|
|
305
|
+
|
|
306
|
+
LOG.info "[Basecamp:Orchestrator] Dispatching Fizzy card ##{card_number} to #{agent} (project: #{project_key})" if defined?(LOG)
|
|
303
307
|
|
|
304
308
|
# Mark as in-flight in our state
|
|
305
309
|
epic_task = epic["tasks"].find { |t| t["fizzy_card"] == card_number }
|
|
@@ -464,6 +468,24 @@ module Brainiac
|
|
|
464
468
|
@fizzy_users[name.downcase]
|
|
465
469
|
end
|
|
466
470
|
|
|
471
|
+
# Resolve the default agent for a project from projects.json.
|
|
472
|
+
# Returns nil if no project-specific agent is configured.
|
|
473
|
+
#
|
|
474
|
+
# @param project_key [String, nil] Brainiac project key
|
|
475
|
+
# @return [String, nil] Agent name or nil
|
|
476
|
+
def resolve_agent_for_project(project_key)
|
|
477
|
+
return nil unless project_key
|
|
478
|
+
|
|
479
|
+
projects_file = File.join(BRAINIAC_DIR, "projects.json")
|
|
480
|
+
return nil unless File.exist?(projects_file)
|
|
481
|
+
|
|
482
|
+
projects = JSON.parse(File.read(projects_file))
|
|
483
|
+
projects.dig(project_key, "agent_name")
|
|
484
|
+
rescue StandardError => e
|
|
485
|
+
LOG.warn "[Basecamp:Orchestrator] Could not resolve agent for project #{project_key}: #{e.message}" if defined?(LOG)
|
|
486
|
+
nil
|
|
487
|
+
end
|
|
488
|
+
|
|
467
489
|
# Resolve the brainiac project key for a Fizzy card by querying its tags.
|
|
468
490
|
# Uses the same logic as brainiac-fizzy: card tags are matched against
|
|
469
491
|
# each project's fizzy_tags configuration.
|