fix: check Gitea API response status and fallback for PR reviews #47
@@ -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)
|
||||
|
||||
@@ -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('/'))
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user