fix(jira-knowledge): pass CONFIG_PATH to JsonConfigRepository in target_resolver
JiraTargetResolver._resolve_base_url() and _load_config_map() called JsonConfigRepository() without the required path argument, causing a TypeError that was silently caught by except Exception, returning empty strings. This made sync fail with 'Jira base URL is not configured for this environment' even when the user had saved valid credentials. Fix: import CONFIG_PATH from config module and pass it to both JsonConfigRepository() calls so they read the same config file that AppConfig writes to. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -76,8 +76,9 @@ class JiraTargetResolver:
|
||||
if env:
|
||||
return env
|
||||
try:
|
||||
from ...config import CONFIG_PATH
|
||||
from ...infrastructure.config.json_config_repository import JsonConfigRepository
|
||||
cfg = JsonConfigRepository()
|
||||
cfg = JsonConfigRepository(CONFIG_PATH)
|
||||
jira_cfg = cfg.data.get("jira", {}) or {}
|
||||
url = str(jira_cfg.get("base_url", "") or "").strip().rstrip("/")
|
||||
return url
|
||||
@@ -121,8 +122,9 @@ class JiraTargetResolver:
|
||||
@staticmethod
|
||||
def _load_config_map() -> dict[str, str]:
|
||||
try:
|
||||
from ...config import CONFIG_PATH
|
||||
from ...infrastructure.config.json_config_repository import JsonConfigRepository
|
||||
cfg = JsonConfigRepository()
|
||||
cfg = JsonConfigRepository(CONFIG_PATH)
|
||||
jk = cfg.data.get("jira_knowledge", {}) or {}
|
||||
projects = jk.get("projects", {}) or {}
|
||||
if isinstance(projects, dict):
|
||||
|
||||
Reference in New Issue
Block a user