CE: Stable desktop download redirect routes#306
Merged
Conversation
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.
What
Adds
/download/desktop/{platform}routes that resolve to the latest desktop release via the GitHub API, with a 5-minute in-process cache and a graceful fallback to the releases landing page. Updates the landing page download tiles to use these stable paths instead of hardcodeddesktop-v0.1.1filenames.Supported platform slugs:
/download/desktop/macos→*_aarch64.dmg/download/desktop/macos-intel→*_x64.dmg/download/desktop/linux(and/download/desktop/linux-deb) →*_amd64.deb/download/desktop/windows→*_x64-setup.exeUnknown platforms or GitHub API failures redirect to
https://github.com/ericflo/modelrelay/releases/latestso links never 404.Why
The landing page hardcoded
desktop-v0.1.1filenames in three<a>tags, so every desktop release otherwise required a code change to keep the tiles working. This eliminates that recurring chore and protects against thereleases/latestcross-stream gotcha (CLI vs desktop tags) noted in past incidents.Notes
crates/modelrelay-cloud/src/routes/mod.rs(~80 LOC including the cache plumbing).LazyLock<RwLock<Option<(Instant, HashMap<String, String>)>>>aliased toDesktopAssetCacheto satisfyclippy::type_complexity.SESSION_EXEMPT_PREFIXESconst lets path-parameterised routes skip the session guard without each variant needing its own entry.