fix(github,forgejo): paginate past an all-prerelease first page of releases#10420
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughAdds bounded fallback pagination ( ChangesRelease pagination improvements
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Greptile SummaryFixes the "no versions found" error that occurred when a repo's most recent releases are entirely prereleases/drafts, by bumping the initial page size to 100 and adding bounded fallback pagination (capped at 3 total pages) for GitHub and Forgejo.
Confidence Score: 5/5Safe to merge — the change is additive (larger initial page, bounded extra fetches), leaves the MISE_LIST_ALL_VERSIONS=1 path untouched, and is covered by six new unit tests plus the updated e2e assertion. The pagination cap logic is correct: pages_fetched starts at 1 (counting the already-fetched initial page), the break fires when pages_fetched >= 3, and the increment happens after each successful fetch — so at most 3 pages total are ever requested in fallback mode. GitHub and Forgejo share identical logic and each has three targeted tests. GitLab's omission of the fallback is intentional and documented. No existing behavior is regressed. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix(github,forgejo): paginate past an al..." | Re-trigger Greptile |
…leases When MISE_LIST_ALL_VERSIONS is unset (the default), the forge release listers fetched only the first API page at the server default size (30 for GitHub/Forgejo, 20 for GitLab), and the read path drops prereleases/drafts. A repo whose most recent releases are all prereleases (e.g. nightly builds) was then left with zero candidates and failed with "no versions found for <pkg> matching date filter". Request larger pages (per_page=100 / limit=100), and for GitHub and Forgejo keep paginating -- bounded to 3 pages -- while every release seen so far is a prerelease/draft, so an older stable release is still discovered. GitLab gets only the page-size bump since its release objects carry no prerelease/draft flag. Update e2e/cli/test_error_display to match the /releases error URL without the query string so the assertion does not depend on pagination parameters. Addresses discussion jdx#10343. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7f059a0 to
2ddde7c
Compare
What
mise use github:owner/repo(and theforgejo:/gitlab:backends) could fail withno versions found for <pkg> matching date filterwhen a repo's most recent releases are all prereleases (e.g. auto-generated nightly/alpha builds), because:MISE_LIST_ALL_VERSIONSunset (the default), the forge release listers fetch only the first API page at the server default size (30 for GitHub/Forgejo, 20 for GitLab).Reported in #10343 (repro:
refactoringhq/tolaria).Fix
per_page=100(GitHub/GitLab) andlimit=100(Forgejo) on the release/tag listers.MISE_LIST_ALL_VERSIONS=1(fetch all pages) is unchanged.GitlabReleasecarries no prerelease/draft flag.Tests
src/github.rs(3) andsrc/forgejo.rs(1): the page-size param is sent; an all-prerelease first page with aLink: nexttriggers a bounded fallback that surfaces a stable release; a stable release on page 1 stops pagination; the fallback caps at 3 pages.e2e/cli/test_error_displayto match the/releaseserror URL without the query string, so the assertion doesn't depend on pagination parameters.Addresses discussion #10343.
🤖 Generated with Claude Code
Summary by CodeRabbit