Skip to content

Resolve "latest" from appcast.json instead of the channel link - #39

Merged
mat007 merged 1 commit into
docker:mainfrom
ctalledo:fix-latest-build-url
Sep 11, 2026
Merged

mat007 merged 1 commit into
docker:mainfrom
ctalledo:fix-latest-build-url

Conversation

@ctalledo

@ctalledo ctalledo commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

On Linux, docker-desktop-build-url: latest read //channel/link from appcast.xml — a static channel pointer, not the newest build. It returns build 228796 while the feed holds 4.89.0 and 4.90.0, so every caller asking for latest silently installs a release many versions behind.

Now reads appcast.json and takes the highest build number among items at full visibility. Collapses three steps into one, drops the get-xml-info dependency, and stops interpolating the input straight into the shell.

Verified against the live feed: resolves to 238018 (4.89.0); 4.90.0 is present but still at visibility 99.

@ctalledo ctalledo changed the title Resolve "latest" to the newest appcast item, not the channel link Resolve "latest" to the newest fully-rolled-out appcast item Sep 9, 2026

@maxcleme maxcleme left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We recently move to appcast.json instead of appcast.xml, the following would be more accurate and stable. It should also make the whole action.yml simpler.

curl -s https://desktop.docker.com/linux/main/amd64/appcast.json \
  | jq -r '.Items
           | map(select(.Visibility == "100"))
           | max_by(.BuildNumber | tonumber)
           | .Artifacts[] | select(.Type == "deb") | .URL'

On Linux, docker-desktop-build-url: latest read //channel/link from
appcast.xml -- a static channel pointer, not the newest build. It
returns build 228796 while the feed holds 4.89.0 and 4.90.0, so every
caller asking for "latest" silently installs a release many versions
behind.

Read appcast.json instead and take the highest build number among the
items at full visibility: document order is not a reliable proxy for
recency, and an item still rolling out is not yet the latest release.

This collapses three steps into one and drops the get-xml-info
dependency. It also stops interpolating the build-url input straight
into the shell, which was a script injection vector.
@ctalledo
ctalledo force-pushed the fix-latest-build-url branch from 409f0c4 to c22c28c Compare September 9, 2026 21:23
@ctalledo

ctalledo commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @maxcleme — switched to appcast.json, and you're right that it collapses the whole thing: three steps become one and the get-xml-info dependency is gone.

I kept your jq almost verbatim, with one guard. When no item is at full visibility it fails confusingly:

jq: error (at appcast.json:0): Cannot iterate over null (null)

so there's now an if length == 0 then empty else ... end and an explicit message instead.

Verified against the live feed: resolves to 238018 (4.89.0), since 4.90.0 is still at visibility 99. Also moved the build-url input out of the shell interpolation and into env: while I was in there.

@ctalledo ctalledo changed the title Resolve "latest" to the newest fully-rolled-out appcast item Resolve "latest" from appcast.json instead of the channel link Sep 9, 2026
@ctalledo
ctalledo requested a review from maxcleme September 9, 2026 21:24
@ctalledo

Copy link
Copy Markdown
Contributor Author

Hi @maxcleme, @lorenrh, could you help me merge this PR (I don't have permission to do so). Thanks! 🙏

@lorenrh

lorenrh commented Sep 10, 2026

Copy link
Copy Markdown
Member

hey @ctalledo we don't have permission either, maybe @docker/desktop-platform-go might have enough permissions?

@ctalledo

Copy link
Copy Markdown
Contributor Author

hey @ctalledo we don't have permission either, maybe @docker/desktop-platform-go might have enough permissions?

Thanks @lorenrh, I'll ask them.

@mat007
mat007 merged commit 82c288e into docker:main Sep 11, 2026
2 checks passed
@ctalledo
ctalledo deleted the fix-latest-build-url branch September 11, 2026 18:17
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.

4 participants