Fix Gitea repo search: correct service name and add UI support
- GITEA_URL was pointing to gitea.platform.svc but the Helm chart names the HTTP service gitea-helm-http.platform.svc - Add Gitea badge (GT, green) to repo search results UI - Update placeholder and credential hint to mention Gitea - Rewrite internal service URLs to external gitea.coreworlds.io in search results so agents can clone from outside the cluster - Add error logging to diagnose search failures
This commit is contained in:
@@ -118,21 +118,30 @@ async function searchGitea(query: string): Promise<RepoResult[]> {
|
||||
}
|
||||
);
|
||||
|
||||
if (!res.ok) continue;
|
||||
if (!res.ok) {
|
||||
console.error(`[repo-search] Gitea search failed: ${res.status} ${res.statusText}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
const data = await res.json();
|
||||
// Rewrite internal service URLs to external Gitea URL
|
||||
const externalUrl = process.env.GITEA_EXTERNAL_URL || "https://gitea.coreworlds.io";
|
||||
for (const repo of data.data || []) {
|
||||
let htmlUrl: string = repo.html_url || "";
|
||||
if (baseUrl !== externalUrl && htmlUrl.startsWith(baseUrl)) {
|
||||
htmlUrl = externalUrl + htmlUrl.slice(baseUrl.length);
|
||||
}
|
||||
results.push({
|
||||
provider: "gitea",
|
||||
fullName: repo.full_name,
|
||||
url: repo.html_url,
|
||||
url: htmlUrl,
|
||||
description: repo.description || "",
|
||||
defaultBranch: repo.default_branch || "main",
|
||||
private: repo.private,
|
||||
});
|
||||
}
|
||||
} catch {
|
||||
// skip failed credential
|
||||
} catch (err) {
|
||||
console.error(`[repo-search] Gitea search error:`, err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user