Git Repository link always shows, defaulting to the canonical upstream repo

Previously hidden entirely when NEXT_PUBLIC_GIT_REPO_URL was unset, which
meant it never appeared on localhost or on anyone else's clone that hadn't
explicitly configured it. It should always point somewhere - the canonical
repo (git.ciagent.org) is the sensible default everywhere, overridable only
by a deployment that runs its own separate git server.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
2026-08-05 20:56:48 -04:00
co-authored by Claude Sonnet 5
parent 3e1fa1845b
commit 4867793b66
4 changed files with 34 additions and 23 deletions
+12 -8
View File
@@ -68,17 +68,21 @@ describe("LandingPage", () => {
expect(screen.queryByText(/local mode/i)).not.toBeInTheDocument();
});
it("hides the Git Repository link when no NEXT_PUBLIC_GIT_REPO_URL is configured", () => {
renderWithQueryClient(<LandingPage />);
expect(screen.queryByRole("link", { name: /git repository/i })).not.toBeInTheDocument();
});
it("shows a Git Repository link opening in a new tab when configured", () => {
vi.stubEnv("NEXT_PUBLIC_GIT_REPO_URL", "https://git.ciagent.org/admin/ci-agent");
it("falls back to the canonical upstream repo when NEXT_PUBLIC_GIT_REPO_URL is unset", () => {
renderWithQueryClient(<LandingPage />);
const link = screen.getByRole("link", { name: /git repository/i });
expect(link).toHaveAttribute("href", "https://git.ciagent.org/admin/ci-agent");
expect(link).toHaveAttribute("href", "https://git.ciagent.org/saksham/CIAgent");
expect(link).toHaveAttribute("target", "_blank");
expect(link).toHaveAttribute("rel", "noopener noreferrer");
});
it("points the Git Repository link at a custom fork when configured", () => {
vi.stubEnv("NEXT_PUBLIC_GIT_REPO_URL", "https://git.example.com/someone/ci-agent");
renderWithQueryClient(<LandingPage />);
const link = screen.getByRole("link", { name: /git repository/i });
expect(link).toHaveAttribute("href", "https://git.example.com/someone/ci-agent");
expect(link).toHaveAttribute("target", "_blank");
expect(link).toHaveAttribute("rel", "noopener noreferrer");
});