fix(jira_env): 为JIRA_BASE_URL添加默认值并优化错误提示

修改require_credentials函数,为JIRA_BASE_URL添加默认值"https://n2nafe.atlassian.net"
优化错误提示信息,明确指导用户如何配置和获取API token
This commit is contained in:
2026-04-02 17:59:12 +08:00
parent 44b13c96f6
commit 5426b573c1
+5 -4
View File
@@ -50,13 +50,14 @@ def load_config(config_path: Optional[str] = None, script_dir: Optional[Path] =
def require_credentials(cfg: Dict[str, str]) -> tuple:
base_url = (cfg.get("JIRA_BASE_URL") or "").rstrip("/")
base_url = (cfg.get("JIRA_BASE_URL") or "https://n2nafe.atlassian.net").rstrip("/")
email = cfg.get("JIRA_EMAIL")
token = cfg.get("JIRA_API_TOKEN")
if not base_url or not email or not token:
if not email or not token:
raise ValueError(
"Missing JIRA_BASE_URL, JIRA_EMAIL, or JIRA_API_TOKEN. "
f"Set in {CONFIG_FILENAME} or environment (see references/env_config.md)."
"Missing JIRA_EMAIL or JIRA_API_TOKEN. "
f"Please configure {CONFIG_FILENAME} file first. "
f"You can apply for API token at: https://id.atlassian.com/manage-profile/security/api-tokens"
)
return base_url, email, token