Skip to content

feat: show docker.versions changelogs in the update dialog#116

Merged
mstrhakr merged 9 commits into
mstrhakr:devfrom
thetic:docker-versions-changelog
Jun 5, 2026
Merged

feat: show docker.versions changelogs in the update dialog#116
mstrhakr merged 9 commits into
mstrhakr:devfrom
thetic:docker-versions-changelog

Conversation

@thetic

@thetic thetic commented Jun 1, 2026

Copy link
Copy Markdown

What changed
Adds optional integration with the docker.versions Unraid plugin. When docker.versions is installed, a Changelog link appears beneath the digest arrow for each container with a pending update in the Update Stack dialog. Clicking it opens the release notes via docker.versions' own showChangeLog() function. Dismissing the changelog returns to the Update Stack dialog.

docker.versions is detected server-side with is_dir and reported via the getSavedUpdateStatus response; the feature is entirely absent when the plugin is not installed (no JS errors, no UI changes).

Related issues
N/A

Checklist

  • I have added/updated tests where applicable
  • I have updated documentation (docs/, README, or plugin docs)
  • Linted/formatted the code
  • Verified on Unraid or CI

Testing notes
With docker.versions installed:

  1. Run Check Updates on any stack
  2. Click Update Stack — a Changelog link appears beneath the SHA arrow for containers with pending updates
  3. Click the link to view release notes in docker.versions' own changelog modal; dismiss to return to the Update Stack dialog

Without docker.versions: no visible change, no JS errors.

PHPStan and PHPUnit both pass.

Notes

  • Delegates display entirely to docker.versions' showChangeLog() — no duplicated Nchan subscription or message routing logic
  • The OK button (which calls updateContainer(), bypassing compose_plugin's update mechanism) is hidden so Cancel is the only exit
  • Returning to the Update Stack dialog is skipped when DISABLE_ACTION_WARNINGS is true, since renderStackActionDialog would fast-path directly to UpdateStackConfirmed in that mode
  • Poll interval is capped at 30 s to prevent a leak if showChangeLog() opens no dialog
  • Container name is passed via data- attributes to avoid HTML attribute quoting issues with inline onclick string interpolation

thetic added 6 commits May 31, 2026 20:28
When docker.versions is installed, a Changelog link appears next to the
SHA comparison for each container with a pending update. Clicking it opens
the docker.versions changelog in a sized iframe modal via Nchan, matching
the existing Docker tab experience.

docker.versions is an optional dependency: the PHP endpoint detects it via
is_dir(), the JS flag defaults false, and the NchanSubscriber guard prevents
any breakage if the plugin is absent or removed while the page is open. A
10-second timeout shows a fallback message if no data arrives. Dialog sizing
is applied via inline styles rather than borrowing docker.versions' CSS classes.
Tests cover all three response paths (no file, valid file, invalid file)
against both the docker.versions-installed and not-installed states.
Uses UnraidStreamWrapper to map the plugin directory to a controlled
temp path without touching the real filesystem.
When the user closes the changelog modal (OK button or outside click),
re-open the Update Stack dialog for the same stack so they can continue
reviewing other containers or proceed with the update.

Pass path and profile through to showComposeChangelog via data attributes
so the callback has enough context to reopen the dialog.
/sub/changelog is a shared channel: Nchan delivers the last buffered
message to every new subscriber, and docker.versions' own subscriber
may be actively publishing output for other containers concurrently.
Both cases caused wrong containers' changelogs to appear in the dialog.

GetChangelog.php always publishes <h3 class='loading'> as its first
message.  Use that as a start-of-stream marker: discard everything
received before it, clear the iframe on arrival, and suppress
loadingInfo progress messages that are noise in this context.
docker.versions publishes many message types — Container: headers, URL
links, warnings, empty <pre> containers, loadingInfo progress — that are
structural scaffolding for its own full-page view and are noise in our
modal.  Replace the loadingInfo-only blacklist with a whitelist: accept
only class='releasesInfo' release entries and the version-summary <h3>
containing '---->', and discard everything else.
@thetic thetic marked this pull request as draft June 1, 2026 03:59
thetic added 2 commits June 3, 2026 18:01
Replace the custom NchanSubscriber, message filtering, and markdown
renderer with a direct call to docker.versions' own showChangeLog()
function, which already handles all of that correctly.

Hide the OK/confirm button (it would call updateContainer, bypassing
compose_plugin's update mechanism) and poll for dialog close to reopen
the Update Stack dialog afterward.
…abled

Two bugs found in code review:

1. The setInterval poll had no escape hatch when showChangeLog() opened
   no SweetAlert dialog (e.g. container unknown to docker.versions), so
   the 'appeared' flag never flipped true and clearInterval was never
   reached. Cap at 300 ticks (30 s) so it always self-cleans.

2. When DISABLE_ACTION_WARNINGS is true, renderStackActionDialog() has a
   fast-path that calls UpdateStackConfirmed() directly without showing a
   dialog. Reopening the update dialog after changelog dismiss would
   trigger an immediate update rather than a confirmation prompt. Skip
   the reopen in that mode by checking the setting via getConfig().
@thetic thetic marked this pull request as ready for review June 4, 2026 01:31
@mstrhakr mstrhakr requested a review from Copilot June 4, 2026 01:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds optional integration between Compose Manager’s “Update Stack” dialog and the external docker.versions Unraid plugin so users can open per-container changelogs when updates are available, while keeping the UI unchanged when docker.versions is not installed.

Changes:

  • Server-side detection of docker.versions via is_dir() and inclusion of a dockerVersionsInstalled flag in the getSavedUpdateStatus response.
  • UI update to conditionally render a Changelog link per updatable container and delegate display to docker.versions’ global showChangeLog() (with logic to return to the Update Stack dialog).
  • Added/updated unit tests and user guide documentation for update checking + changelog behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/unit/ExecActionsTest.php Adds unit tests covering getSavedUpdateStatus including the new dockerVersionsInstalled response flag.
source/compose.manager/javascript/composeManagerMain.js Tracks docker.versions availability from the server and adds a per-container Changelog link + handler to invoke docker.versions UI.
source/compose.manager/include/Exec.php Detects docker.versions plugin presence and returns dockerVersionsInstalled in getSavedUpdateStatus.
docs/user-guide.md Documents update checking flow and the optional changelog link behavior when docker.versions is installed.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/unit/ExecActionsTest.php Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@mstrhakr mstrhakr self-assigned this Jun 5, 2026
@mstrhakr mstrhakr merged commit a35982e into mstrhakr:dev Jun 5, 2026
5 checks passed
@thetic thetic deleted the docker-versions-changelog branch June 6, 2026 02:53
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.

3 participants