version-check: switch lastversion endpoint from SourceForge to GitHub Releases API - #522
Merged
mrjimenez merged 1 commit intoMay 3, 2026
Conversation
… Releases API `amule.cpp:636` was hitting `http://amule.sourceforge.net/lastversion`, a plain-text `MAJOR.MINOR.UPDATE` file unmaintained since the project moved to GitHub years ago. Repoint the request at `https://api.github.com/repos/amule-project/amule/releases/latest`, which returns JSON describing the most recent non-prerelease, non-draft Release. Pairs with the release.yml flow added in amule-project#520: once a stable tag is published on GitHub, every aMule installation with version-check enabled picks it up automatically on next startup, with no maintainer step beyond un-drafting the Release. `/releases/latest` excludes pre-releases by design, so users on 2.3.3 stable won't be prompted to upgrade when we tag `3.0.0-beta` / `3.0.0-rc1` — only when 3.0.0 stable is published. Parser changes in `CheckNewVersion()`: - Concatenate all lines of the downloaded file before regex-matching (the JSON body is pretty-printed across many lines). - Extract `tag_name` via `wxRegEx` — simpler than dragging in a full JSON parser for one well-known field. - Strip optional `v` prefix and any pre-release / build-metadata suffix (`-beta`, `-rc1`, `+build42`) before the integer comparison. - Treat tags with fewer than three components (e.g. `3.1`) as missing-field-= 0 rather than erroring out. - Clean up the temp file in early-error paths too (the original only removed it on the success path). HTTPS works without transport changes — wxWebRequest support landed in amule-project#462. The `s_NewVersionCheck` pref still controls whether the request fires at all.
got3nks
force-pushed
the
pr-version-check-github-api
branch
from
May 3, 2026 14:17
d2fbbe9 to
e9b5d23
Compare
5 tasks
mrjimenez
pushed a commit
that referenced
this pull request
May 5, 2026
Following the org-migration discussion on PR #521, point all source / docs / packaging URLs at the new `amule-org` GitHub org that @mrjimenez bootstrapped on 2026-05-04. Two motivating reasons (per the thread): 1. The new active maintainer team needs proper write/admin access that the existing amule-project upper-level admins have been unreachable to grant. 2. The version-check probe added in #522 hardcodes its target URL into every shipped binary. If that URL stays at amule-project while future releases land on amule-org, the cohort of users on 3.0.0 will be permanently stranded querying a dead-end endpoint and never learn about 3.0.1+ via the in-app prompt. Flipping the URL pre-3.0.0-tag is the only way to keep them informed without dual-publishing maintenance burden. Seven references updated in lockstep: - `src/amule.cpp` — version-check probe URL. - `packaging/linux/flatpak/org.amule.aMule.yaml.in` — Flatpak manifest's git source URL (load-bearing — `flatpak-builder` clones from this URL at build time). - `org.amule.aMule.metainfo.xml` — AppStream bug-tracker URL, surfaces in Flathub / GNOME Software / KDE Discover. - `README.md` — logo image URL on raw.githubusercontent.com plus the Issues and Pull Requests link references. - `docs/INSTALL.md` — upstream-issue-tracker doc reference. - `docs/README.md` — GitHub Issues doc reference. Left as-is: - `src/HTTPDownload.cpp:252` — code comment referencing issue `#455` for historical context. The issue itself stays at amule-project regardless of where future development happens; the comment is a citation, not a forward reference. - The `amule-project.de` / `amule-project.net` mentions in `docs/CHANGELOG.md` 2003-era entries — those are old DNS domain references unrelated to the GitHub org. Note: this commit assumes `amule-org/amule` will exist as a real repo by the time this PR merges. The org was created 2026-05-04 with zero repos; the Flatpak build URL change in particular will fail the Packaging workflow until the repo is bootstrapped.
got3nks
added a commit
to got3nks/amule
that referenced
this pull request
Jul 18, 2026
…eaped (amule-project#522) A "View Files" browse that failed (peer denied, connect failed, or dropped mid-list) left amuleGUI stuck at (N...) instead of (Failed): the daemon read the browse lifecycle from the transient browsing client, which is reaped before amuleGUI's next SEARCH_PROGRESS poll, so EC_TAG_SEARCH_BROWSE_STATUS was omitted. Persist the browse status by search id alongside the bar (pruned in RemoveResults, bounded by the same EC search ring) and report progress from that persisted state, so the terminal status survives the client teardown. Daemon-side only. Follow-up to amule-project#520.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The version-check probe in
amule.cpp:636has been hittinghttp://amule.sourceforge.net/lastversionsince forever — a plain-textMAJOR.MINOR.UPDATEfile that hasn't been maintained since the project moved to GitHub years ago. Even if SF still serves the file, the version it reports has been stuck for the multi-year gap since 2.3.3 (Feb 2021).This PR repoints the request at the GitHub Releases API:
which returns JSON describing the most recent non-prerelease, non-draft Release.
Why
/releases/latestPairs naturally with the release.yml + draft-Release flow that landed in #520. Once a stable tag is published on GitHub, every aMule installation with version-check enabled picks up the new version on next startup automatically — no maintainer step beyond un-drafting the Release.
The endpoint excludes pre-releases by design:
3.0.0-betaor3.0.0-rc1(those tags would carry the GitHubprerelease: trueflag).3.0.0stable is published as a non-prerelease Release.The endpoint also excludes drafts, so the version check doesn't flip the moment release.yml creates the draft Release at tag-push time — un-drafting is the canonical "this release is now publicly available" signal.
Parser changes in
CheckNewVersion()The downloaded file was previously a one-line text response and is now JSON. Changes:
tag_nameviawxRegExrather than dragging in a full JSON parser dep — one well-known field is straightforward to extract robustly.vprefix (aMule's tags are bare semver, but be tolerant of future maintainer choices).-beta,-rc1,+build42) before the integer comparison. The/releases/latestendpoint already filters pre-releases, but keep the suffix-strip as defensive parsing.3.1instead of3.1.0) as missing-field-= 0 rather than erroring out.Transport
HTTPS works without transport changes —
wxWebRequestsupport landed in #462, which is whatCHTTPDownloadThreadnow sits on top of. Just changing the URL is enough; the existingIf-Modified-Since/ etag conditional-fetch behaviour carries over (GitHub's API supports both).Pref gating
The existing
s_NewVersionCheckpref still controls whether the request fires at all, so users who never opted in are unaffected.Test plan
Builds clean (
amuledtarget on macOS local, against the new code).Parser exercised against the actual
wxRegEximplementation via a standalone C++ test mirroringCheckNewVersion()'s logic. Verified inputs:Happy path:
cli/cli/releases/latestpayload →tag_name: "v2.92.0"→ stripped to2.92.0✓amule-project/amule/releases/latestpayload →tag_name: "2.3.3"(existing published Release) → parsed as2.3.3✓"3.0.0"(aMule's tag style): parses to3.0.0✓"tag_name" : "v3.0.0"→3.0.0✓"3.0.0-beta","3.0.0-rc1","v3.0.0-beta","2.4.0-rc.2","3.0.0-beta.5","v2.4.0-alpha"all strip toMAJOR.MINOR.UPDATE✓"2.4.0+build42"→2.4.0✓"3.1"→ parsed as3.1.0(missing UPDATE treated as 0) ✓Failure paths (all log
_("Corrupted version check file")and return cleanly without crashing):tag_namefield if present (defensible — we're not doing strict JSON validation, just locating one field). ✓tag_namefield): regex misses → "Corrupted" → return. ✓tag_name: regex[^"]+requires non-empty → no match → "Corrupted". ✓"hello","3.foo.bar"): tokenizer fails → "Corrupted" + cleanup. ✓"v","-foo","v-rc1","+build42"): caught by an explicitversionLine.IsEmpty()guard added between the strip step and the tokenizer. Without that guard, these would silently report "up to date" against unparseable input — fixed in this commit. ✓End-to-end is already viable today: amule-project has a published
2.3.3Release on the GitHub side, so users running this code will see "Your copy of aMule is up to date" if they're on 2.3.3, or the "outdated" prompt if they're older. Once3.0.0stable is published as a non-prerelease, every 2.3.3 user gets the upgrade prompt automatically. Pre-release tags (3.0.0-beta,3.0.0-rc1) are filtered out by/releases/latestas designed.Sized
One file (
src/amule.cpp), +59 / −10 lines, single commit.