fix: address review - paginate GH releases, GitLab tag_name, docs, test

- Paginate GitHub releases via api.paginate to avoid missing tags beyond page 1
- Use tag_name instead of name for GitLab releases (name is a display label)
- Remove ArchiveTeam Warrior from widget-configured note in docs
- Fix test assertion to use objectContaining for error shape with message
This commit is contained in:
Thomas Camlong committed 2026-06-27 13:02:58 +02:00
1 parent 64c7512283
commit e687bc8c92
3 files changed
+9 -6

No files matched your search

@@ -107,7 +107,7 @@ You can optionally auto-create bookmark apps for all discovered Docker container
:::note
Release providers, Search.ch, and ArchiveTeam Warrior are configured directly in their widgets instead of the integrations page.
Release providers and Search.ch are configured directly in their widgets instead of the integrations page.
:::
@@ -153,12 +153,12 @@ const getGithubReleaseAsync = async (
const api = getGithubApi(baseUrl, "Homarr-Lab/Homarr:GithubReleaseProvider", token);
try {
const releasesResponse = await api.rest.repos.listReleases({ owner: parsed.owner, repo: parsed.name });
if (releasesResponse.data.length === 0) {
const allReleases = await api.paginate(api.rest.repos.listReleases, { owner: parsed.owner, repo: parsed.name, per_page: 100 });
if (allReleases.length === 0) {
return { success: false, error: { code: "noReleasesFound", message: `${identifier} has no GitHub releases` } };
}
const releases = releasesResponse.data.reduce<ReleaseProviderResponse[]>((acc, release) => {
const releases = allReleases.reduce<ReleaseProviderResponse[]>((acc, release) => {
if (!release.published_at) return acc;
acc.push({
latestRelease: release.tag_name,
@@ -510,7 +510,7 @@ const getGitlabReleaseAsync = async (
if (!release.released_at) return acc;
const releaseDate = new Date(release.released_at);
acc.push({
latestRelease: release.name ?? release.tag_name,
latestRelease: release.tag_name,
latestReleaseAt: releaseDate,
releaseUrl: release._links?.self,
releaseDescription: release.description ?? undefined,
@@ -106,7 +106,10 @@ describe("getLatestMatchingReleaseAsync for GitHub Container Registry", () => {
identifier: "ghcr.io/homarr-labs",
});
expect(result).toEqual({ success: false, error: { code: "invalidIdentifier" } });
expect(result).toEqual({
success: false,
error: expect.objectContaining({ code: "invalidIdentifier" }),
});
expect(mockedFetch).not.toHaveBeenCalled();
});