case-create: surface Gitea repo result + UI retry button
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m29s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m29s
The auto-creation in case_create had two failure modes that combined to
make repos silently missing: a stale GITEA_TOKEN returning 401, and the
outer try/except in case_create that swallowed every exception with a
bare pass. Result: cases like 8174-24 ended up with a local git repo and
Paperclip project but no Gitea repo, with no signal anywhere.
_setup_gitea_remote now returns {ok, url, error} and never raises; the
result is attached to the case JSON and the FastAPI endpoint logs a
warning when ok=false. The UI gets a "צור ריפו ב-Gitea" button on the
case header that appears only when the repo or remote is missing.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1214,6 +1214,15 @@ async def api_case_create(req: CaseCreateRequest):
|
||||
logger.warning("Failed to auto-create Paperclip project for case %s: %s", req.case_number, e)
|
||||
parsed["paperclip_error"] = str(e)
|
||||
|
||||
# Gitea result was attached by case_create itself; log if it failed so
|
||||
# ops can spot stale-token issues without scanning every response.
|
||||
gitea_result = parsed.get("gitea") or {}
|
||||
if not gitea_result.get("ok"):
|
||||
logger.warning(
|
||||
"Gitea repo not created for case %s: %s",
|
||||
req.case_number, gitea_result.get("error") or "unknown",
|
||||
)
|
||||
|
||||
return parsed
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user