feat(releases): detect prerelease-only repos and mark prereleases in the UI - #9
Merged
Merged
Conversation
…the UI GitHub defines /releases/latest as the newest NON-prerelease, so a plugin that only ships betas 404s there and looks like it has no releases at all. Every fetchLatestRelease caller silently gave up on such a repo: the admin replay returned 'No published release found on the upstream repo', and both submit paths ingested no manifest and no release. Both provider paths now list releases and rank them by semver instead. That also puts this in step with persistRelease, which already ranks by semver — /releases/latest would have pinned a stable 1.0.0 as latest even after 1.1.0-beta.1 shipped, so the two disagreed about the current version. Prereleases stay first-class and are now labelled: a pre-release badge sits next to the version on the plugin card, the detail header, the download section, and each affected row in the releases list. Prerelease-ness is derived from the version string — ingest already enforces strict semver, so no schema change is needed. Localized in all six languages.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
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.
Follow-up to #7. With the semver comparison fixed, the admin Replay webhook on the PostgreSQL plugin still returned
No published release found on the upstream repo.Why
fetchLatestReleaseasked GitHub for/repos/{owner}/{repo}/releases/latest, and GitHub defines that as the newest non-prerelease, non-draft release. Every release of that plugin is flaggedprerelease=true, so the endpoint answers 404 and we turned that into "no releases".Four call sites were affected — the admin replay, the rehash, and both submit paths (preview and OAuth submit). A plugin that only ships betas could not be submitted with its manifest, could not be rehashed, and could not be replayed. Those releases only ever reached the registry because the webhook delivers the payload directly and never consults
/releases/latest.Change
Both provider paths now list releases and rank them by semver:
persistRelease, which already ranks by semver./releases/latestwould pin a stable1.0.0as latest even after1.1.0-beta.1shipped, so the ingest and the fetch disagreed about the current version./releases/latestused to do for us.UI
Prereleases stay first-class — they are shown, and now labelled. A
pre-releasebadge sits next to the version on the plugin card, the detail header, the download section, and each prerelease row in the releases list.Prerelease-ness is derived from the version string (
isPrereleasein$lib/utils): ingest enforces strict semver, so a hyphen ahead of any+buildmetadata is exactly the prerelease marker. No schema change, no new API field.Localized in all six languages.
Verification
New
tests/lib/release-fetch.test.tscovers prerelease-only repos, semver ranking over provider order, stable-beats-own-prerelease, newer-prerelease-beats-older-stable, draft skipping, empty listings, 404s, and asset carry-over — 7 of the 10 fail against the old implementation. Full API suite 468 pass / 0 fail,tscclean,svelte-check0 errors.