Skip to content

fix(ai): detect release-notes repo from the OCI source label#118

Merged
nopoz merged 1 commit into
mainfrom
fix/ai-detectrepo-oci-source
Jul 5, 2026
Merged

fix(ai): detect release-notes repo from the OCI source label#118
nopoz merged 1 commit into
mainfrom
fix/ai-detectrepo-oci-source

Conversation

@nopoz

@nopoz nopoz commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Problem

The update-analysis (Analyze) feature couldn't find release notes for containers without a link template, and could throw an error. Repo detection guessed a GitHub repo by fuzzing the ghcr.io image namespace, which is frequently wrong (e.g. ghcr.io/linuxserver/socket-proxy is really github.com/linuxserver/docker-socket-proxy). The wrong guess 404'd, and the error escaped as a 502: "Error analyzing update for ... (Request failed with status code 404)".

Changes

  • Graceful 404 (app/ai/github.js): a 404 from the releases lookup is treated as "no releases found" and degrades to the web fallback / empty result instead of erroring. Non-404 errors still propagate.
  • OCI source detection: the watcher persists the image's org.opencontainers.image.source label as image.source (Docker.js, model/container.js), and detectRepo prefers it. Precedence: link template -> OCI source label -> ghcr name split (last resort).
  • Auto-detected link in the UI: when no link template is set, the container and update tabs show a "Link (auto-detected)" row pointing at the repo /releases page, giving the traditional manual release-notes link for those containers. A configured link template still takes precedence and shows the plain "Link" row.

Notes

image.source populates on fresh detection, so existing stored rows pick it up the next time a container is re-detected.

Verified

  • Backend unit tests pass (511/511), including new detectRepo precedence cases and 404 handling.
  • Validated live: webhook-socket-proxy (linuxserver, no link template) now resolves linuxserver/docker-socket-proxy, finds 14 releases in range, and returns a real analysis. The "Link (auto-detected)" row renders in both tabs pointing at the correct releases page.

The update-analysis feature guessed a container's GitHub repo by fuzzing the
ghcr.io image namespace, which is often wrong (e.g. linuxserver prefixes its
repos with docker-), producing a 404 that surfaced as a 502 error. Two changes:

- A 404 from the releases lookup is now treated as "no releases found" and
  degrades to the web fallback instead of erroring.
- The watcher persists the image's org.opencontainers.image.source label as
  image.source, and repo detection prefers it (link template -> source label ->
  ghcr name split), turning a guess into an actual lookup.

Also surface the source as a "Link (auto-detected)" release-notes row in the
container and update tabs when no link template is set, so the traditional
manual-check link is available for those containers.
@nopoz
nopoz merged commit 50eb971 into main Jul 5, 2026
14 checks passed
@nopoz
nopoz deleted the fix/ai-detectrepo-oci-source branch July 5, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant