kin: KIN-083 Healthcheck claude CLI auth: перед запуском pipeline проверять что claude залогинен (быстрый claude -p 'ok' --output-format json, проверить is_error и 'Not logged in'). Если не залогинен — не запускать pipeline, а показать ошибку 'Claude CLI requires login' в GUI с инструкцией.
This commit is contained in:
parent
a80679ae72
commit
bfc8f1c0bb
18 changed files with 1390 additions and 57 deletions
|
|
@ -115,9 +115,14 @@ def run_hooks(
|
|||
task_id: str | None,
|
||||
event: str,
|
||||
task_modules: list[dict],
|
||||
changed_files: list[str] | None = None,
|
||||
) -> list[HookResult]:
|
||||
"""Run matching hooks for the given event and module list.
|
||||
|
||||
If changed_files is provided, trigger_module_path is matched against
|
||||
the actual git-changed file paths (more precise than task_modules).
|
||||
Falls back to task_modules matching when changed_files is None.
|
||||
|
||||
Never raises — hook failures are logged but don't affect the pipeline.
|
||||
"""
|
||||
hooks = get_hooks(conn, project_id, event=event)
|
||||
|
|
@ -125,10 +130,13 @@ def run_hooks(
|
|||
for hook in hooks:
|
||||
if hook["trigger_module_path"] is not None:
|
||||
pattern = hook["trigger_module_path"]
|
||||
matched = any(
|
||||
fnmatch.fnmatch(m.get("path", ""), pattern)
|
||||
for m in task_modules
|
||||
)
|
||||
if changed_files is not None:
|
||||
matched = any(fnmatch.fnmatch(f, pattern) for f in changed_files)
|
||||
else:
|
||||
matched = any(
|
||||
fnmatch.fnmatch(m.get("path", ""), pattern)
|
||||
for m in task_modules
|
||||
)
|
||||
if not matched:
|
||||
continue
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue