Skip to content

Read every page of releases so a run of prereleases cannot hide the stable one - #225

Merged
matt-edmondson merged 1 commit into
mainfrom
claude/ktsubuild-169-paginate-releases
Oct 8, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
claude/ktsubuild-169-paginate-releases

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #169

What changed

GitHubApiClient.ListReleasesAsync made one gh api /repos/{org}/{repo}/releases call with no per_page. GitHub's default page size is 30, so a repository whose 30 newest releases were prereleases had its stable release on page 2. OrgProfileService then found no stable tag and dropped the repository from the profile README.

The method now reads pages with per_page=100&page=N until it gets a short page. That is the same loop ListOrganizationRepositoriesAsync and CountCommitsSinceAsync already use. I did not add an early stop at the first stable tag, which the decision comment allows but doesn't require. It would put profile logic into the API client, and with 100 per page a second call only happens for repositories with more than 100 releases.

Tests

  • ListReleasesAsync_ReadsPastAFullPageOfPrereleases: page 1 holds 100 -pre tags and page 2 holds v1.0.0. The test checks that all 101 tags come back, in two requests, using per_page=100. It fails on main: I reverted the fix and saw it fail.
  • ListReleasesAsync_WithFewerThanAPageOfReleases_MakesOneCall: a repository with fewer than 100 releases still makes exactly one call.
  • The full suite passes (766 tests). The local Sonar build reports nothing in the changed file.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CzB8uCZc7DWCamHvE3Qk4k


Generated by Claude Code

…table one

ListReleasesAsync made one call with GitHub's default page size of 30, so a
repository whose 30 newest releases were prereleases was dropped from the
profile README as having no stable release. Paginate with per_page=100 until
a short page, as the repository and commit listings already do.

Fixes #169

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CzB8uCZc7DWCamHvE3Qk4k
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 9c9bda4 into main Oct 8, 2026
14 checks passed
@matt-edmondson
matt-edmondson deleted the claude/ktsubuild-169-paginate-releases branch October 8, 2026 04:46
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.

profile readme only reads the first 30 releases, so a repo whose 30 newest releases are prereleases is dropped as "no stable release"

2 participants