From 443fcf997cc78144fb7b1ab791f6da3975b96f82 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sat, 25 Jul 2026 09:57:46 -0500 Subject: [PATCH] Rename codeberg references to git.mcintire.me --- lib/towerops/agents/release_checker.ex | 16 ++++++++-------- test/towerops/agents/release_checker_test.exs | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/towerops/agents/release_checker.ex b/lib/towerops/agents/release_checker.ex index 026c4032..68b6e223 100644 --- a/lib/towerops/agents/release_checker.ex +++ b/lib/towerops/agents/release_checker.ex @@ -1,6 +1,6 @@ defmodule Towerops.Agents.ReleaseChecker do @moduledoc """ - Fetches latest release info from the Codeberg (Forgejo) Releases API for the + Fetches latest release info from the git.mcintire.me (Forgejo) Releases API for the towerops-agent repo. Caches results for 5 minutes to avoid excessive API calls. @@ -8,7 +8,7 @@ defmodule Towerops.Agents.ReleaseChecker do require Logger - @codeberg_repo "towerops-agent/towerops-agent" + @agent_repo "towerops-agent/towerops-agent" @cache_ttl_ms to_timeout(minute: 5) @arch_map %{ @@ -18,7 +18,7 @@ defmodule Towerops.Agents.ReleaseChecker do @doc """ Clears the cached release info so the next call to `get_latest_release/0` - fetches fresh data from Codeberg. + fetches fresh data from git.mcintire.me. """ @spec invalidate_cache() :: :ok def invalidate_cache do @@ -29,7 +29,7 @@ defmodule Towerops.Agents.ReleaseChecker do end @doc """ - Returns the latest release info from Codeberg. + Returns the latest release info from git.mcintire.me. Returns `{:ok, %{version: String.t(), assets: [asset]}}` where each asset has `name`, `url`, and `checksum` fields. @@ -77,7 +77,7 @@ defmodule Towerops.Agents.ReleaseChecker do end defp fetch_and_cache do - url = "https://git.mcintire.me/api/v1/repos/#{@codeberg_repo}/releases/latest" + url = "https://git.mcintire.me/api/v1/repos/#{@agent_repo}/releases/latest" case req_get(url, headers: [{"accept", "application/json"}], retry: false) do {:ok, %Req.Response{status: 200, body: body}} -> @@ -86,11 +86,11 @@ defmodule Towerops.Agents.ReleaseChecker do {:ok, release} {:ok, %Req.Response{status: status}} -> - Logger.warning("Codeberg API returned status #{status} for latest release") - {:error, {:codeberg_api, status}} + Logger.warning("git.mcintire.me API returned status #{status} for latest release") + {:error, {:agent_api, status}} {:error, reason} -> - Logger.warning("Failed to fetch latest release from Codeberg: #{inspect(reason)}") + Logger.warning("Failed to fetch latest release from git.mcintire.me: #{inspect(reason)}") {:error, reason} end end diff --git a/test/towerops/agents/release_checker_test.exs b/test/towerops/agents/release_checker_test.exs index 4cc3e513..c11d2925 100644 --- a/test/towerops/agents/release_checker_test.exs +++ b/test/towerops/agents/release_checker_test.exs @@ -55,7 +55,7 @@ defmodule Towerops.Agents.ReleaseCheckerTest do Plug.Conn.send_resp(conn, 503, "") end) - assert {:error, {:codeberg_api, 503}} = ReleaseChecker.get_latest_release() + assert {:error, {:agent_api, 503}} = ReleaseChecker.get_latest_release() end test "uses cached release info until invalidated" do