From dd705c92b6972824763cec940f28371c656e2683 Mon Sep 17 00:00:00 2001 From: thanhnv Date: Tue, 8 Sep 2026 10:43:39 +0900 Subject: [PATCH] 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 --- application/jira_knowledge/target_resolver.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/jira_knowledge/target_resolver.py b/application/jira_knowledge/target_resolver.py index 666510f..4945c1a 100644 --- a/application/jira_knowledge/target_resolver.py +++ b/application/jira_knowledge/target_resolver.py @@ -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):