fix: check Gitea API response status and fallback for PR reviews #47

Merged
sharang merged 5 commits from fix/gitea-pr-review-error-handling into main 2026-03-25 16:26:09 +00:00
2 changed files with 7 additions and 3 deletions
Showing only changes of commit f310a3e0a2 - Show all commits

View File

@@ -201,8 +201,9 @@ impl IssueTracker for GiteaTracker {
tracing::warn!(
"Gitea PR review with inline comments failed ({status}): {text}, retrying as plain comment"
);
let fallback_url =
self.api_url(&format!("/repos/{owner}/{repo}/issues/{pr_number}/comments"));
let fallback_url = self.api_url(&format!(
"/repos/{owner}/{repo}/issues/{pr_number}/comments"
));
let fallback_resp = self
.http
.post(&fallback_url)

View File

@@ -148,7 +148,10 @@ pub async fn refresh_mcp_status() -> Result<(), ServerFnError> {
// Derive health URL from the endpoint (replace trailing /mcp with /health)
let health_url = if server.endpoint_url.ends_with("/mcp") {
format!("{}health", &server.endpoint_url[..server.endpoint_url.len() - 3])
format!(
"{}health",
&server.endpoint_url[..server.endpoint_url.len() - 3]
)
} else {
format!("{}/health", server.endpoint_url.trim_end_matches('/'))
};