Fix Gitea repo search: correct service name and add UI support
Some checks failed
CI / lint-and-test (push) Successful in 39s
Deploy Production / deploy (push) Failing after 51s
CI / build (push) Failing after 46s

- 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:
Julia McGhee
2026-03-21 22:15:18 +00:00
parent 4192a29962
commit ce58800b36
3 changed files with 20 additions and 11 deletions

View File

@@ -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);
}
}