Skip to content

Check Docker Hub for the latest XCP-D release - #1639

Merged
tsalo merged 1 commit into
mainfrom
fix/check-latest-dockerhub
Oct 16, 2026
Merged

tsalo merged 1 commit into
mainfrom
fix/check-latest-dockerhub

Conversation

@tsalo

@tsalo tsalo commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Changes proposed in this pull request

check_latest() looked up the latest release on PyPI. XCP-D has never been published there (https://pypi.org/pypi/xcp_d/json returns 404), so the request always failed silently and the "a newer version of XCP-D is available" message never printed.

This PR points check_latest() at the pennlinc/xcp_d image tags on Docker Hub:

  • Tags that aren't versions (latest, unstable) and prerelease tags are skipped. The highest remaining version wins.
  • It follows the API's next links, up to 5 pages of 100 tags each (there are 77 tags today).
  • Docker Hub allows 180 API requests per IP, more than GitHub's 60 per hour for unauthenticated requests. The existing 14-day cache in ~/.cache/xcp_d/latest is unchanged.
  • If anything fails (no network, a non-200 status, or an unexpected payload), the function returns None, so the check is skipped as before.

The flagged-version check (is_flagged(), which reads .versions.json from GitHub) already worked and is unchanged.

New unit tests in xcp_d/tests/test_cli_version.py mock requests.get, so they need no network. They cover tag filtering, pagination, failure handling, and the cache. Run against the real API, the lookup returns 26.2.0.

Documentation that should be reviewed

  • New docs/faq.rst with an Upgrading section (anchor #upgrading), which the CLI upgrade message already links to (faq.html#upgrading). It explains the two startup checks, when to upgrade (and why not to mix versions mid-study), and how to upgrade with Docker, Apptainer, or pip.
  • docs/index.rst: FAQ added to the toctree.

I didn't build the docs locally.

Related PRs

The same change in the other PennLINC BIDS Apps:

🤖 Generated with Claude Code

check_latest() queried PyPI, where XCP-D isn't published, so the
"newer version available" message never appeared. Look up the
pennlinc/xcp_d image tags on Docker Hub instead, skipping non-version
tags such as "latest" and "unstable", plus prereleases.

Also add a FAQ page with the Upgrading section that the CLI message
links to.
@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.15385% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.42%. Comparing base (5c12e17) to head (223ec3f).

Files with missing lines Patch % Lines
xcp_d/cli/version.py 96.15% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1639      +/-   ##
==========================================
+ Coverage   83.19%   83.42%   +0.23%     
==========================================
  Files          58       58              
  Lines        8094     8111      +17     
  Branches     1137     1139       +2     
==========================================
+ Hits         6734     6767      +33     
+ Misses       1014     1000      -14     
+ Partials      346      344       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tsalo
tsalo merged commit 022e23e into main Oct 16, 2026
21 checks passed
@tsalo
tsalo deleted the fix/check-latest-dockerhub branch October 16, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issues noting problems and PRs fixing those problems.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant