Skip to content

Resolve latest cli-preview release for website CLI download links (#924) - #938

Open
jennyf19 wants to merge 1 commit into
microsoft:mainfrom
jennyf19:fix/924-website-cli-download-links
Open

Resolve latest cli-preview release for website CLI download links (#924)#938
jennyf19 wants to merge 1 commit into
microsoft:mainfrom
jennyf19:fix/924-website-cli-download-links

Conversation

@jennyf19

Copy link
Copy Markdown

Problem

Fixes #924. The website's CLI download links were hardcoded to the cli-preview-0.10.0
tag in the download dropdown and the models page, so once newer preview releases
shipped, users were sent to an outdated CLI.

Change

  • Resolve the newest non-draft cli-preview-* release at build time in a prerendered
    server layout load (+layout.server.tsresolveCliLinks), exposed to every route
    via page.data.cliLinks.
  • Point the per-platform CLI buttons (Windows/macOS/Linux) at that release's page.

Why the release page, not direct per-asset links

The issue suggested linking each platform to a specific asset. A single static link
cannot be architecture-correct: every release ships x64 and arm64 (and WinML) variants,
so a fixed "Linux"/"Windows" asset link would hand arm64 users a binary that will not run,
and by current download counts the base win-x64.msix is far less used than the WinML
variant. Linking to the resolved release page fixes the staleness (the actual bug) while
letting users pick the right file, consistent with the arch-safe winget/brew install
path already used in platform.ts. If direct downloads are wanted later, the
repo-consistent approach is client-side arch detection (reusing detectPlatform / the
models page's arm64 detection) as a follow-up.

Reliability

  • Discovery degrades gracefully to the general releases page on any failure, so the
    prerender build can never fail because of this.
  • An optional build-time GITHUB_TOKEN raises the GitHub API rate limit; never required,
    never exposed to the client.

Tests

The site had no test runner, so this adds vitest with coverage for the resolver:
newest-by-date selection, tag/draft filtering, null published_at determinism, the
token auth header, and every fallback path. npm run test and npm run build pass.

…crosoft#924)

The website hardcoded the CLI download links to the cli-preview-0.10.0 release tag in the download dropdown and the models page, so users were sent to an outdated CLI once newer preview releases shipped.

Resolve the newest cli-preview-* release at build time via a prerendered server layout load, and point the per-platform CLI buttons at that release's page - where users choose their architecture/variant, matching the arch-safe winget/brew install path in platform.ts. A single static link cannot be architecture-correct (e.g. an arm64 user must not be handed an x64 build), so linking to the release page fixes the staleness without that regression.

Discovery degrades gracefully to the general releases page on any failure, and an optional build-time GITHUB_TOKEN raises the GitHub API rate limit. Adds vitest (the site had no test runner) with coverage for the resolver: selection, filtering, null-date determinism, token header, and every fallback path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 31, 2026 17:11
@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

@jennyf19 is attempting to deploy a commit to the MSFT-AIP Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Resolves current CLI preview releases during website prerendering and supplies the resulting release page to CLI download links.

Changes:

  • Adds GitHub release discovery with graceful fallback.
  • Updates website CLI links to consume shared layout data.
  • Introduces Vitest coverage for release resolution.

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
www/src/lib/cli-release.ts Resolves the latest CLI preview release.
www/src/lib/cli-release.test.ts Tests resolution and fallback behavior.
www/src/routes/+layout.server.ts Exposes resolved links through layout data.
www/src/routes/models/+page.svelte Uses resolved links on the models page.
www/src/lib/components/download-dropdown.svelte Uses resolved links in the download menu.
www/src/app.d.ts Types shared CLI link data.
www/vitest.config.ts Configures Node-based unit tests.
www/package.json Adds Vitest and a test script.
www/package-lock.json Locks new testing dependencies.
Files not reviewed (1)
  • www/package-lock.json: Generated file

Comment on lines +17 to +18
/** The resolved release's page, or the general releases page on fallback. */
releasePage: string;
// resolution is reliable; without it the call is unauthenticated and degrades to the releases page.
export const load: LayoutServerLoad = async ({ fetch }) => {
return {
cliLinks: await resolveCliLinks(fetch, env.GITHUB_TOKEN)
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.

[CLI] Website CLI download links point to stale CLI preview release

2 participants