Skip to content

Fail profile readme instead of writing it without a table when the org listing fails [patch] - #234

Open
matt-edmondson wants to merge 1 commit into
mainfrom
fix/178-fail-on-empty-org-listing
Open

matt-edmondson wants to merge 1 commit into
mainfrom
fix/178-fail-on-empty-org-listing

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #178

What changed

  • GitHubApiClient.ListOrganizationRepositoriesAsync now throws InvalidOperationException (naming the page) when any page of /orgs/{org}/repos fails or can't be read. Before, it breaked and returned what it had: [] if page 1 failed, a truncated list if a later page did. All other calls still degrade to no data, because a single repository's lookup failing is acceptable (GitHub API failures are indistinguishable from "no data," silently dropping repos from the profile #140). The interface documents the new exception.
  • ProfileGenerator.CheckTemplateLinksAsync used to log "Could not list the organization…" on an empty listing and let the run write a README with no table. It now throws before anything is written. ProfileCommand already maps exceptions to exit code 1, so the daily update-readme.yml job fails instead of committing a blank profile table.

Tests

  • ListOrganizationRepositoriesAsync_WithAFailedFirstPage_Throws: an HTTP 502 on page 1 throws.
  • ListOrganizationRepositoriesAsync_WithAFailedLaterPage_ThrowsRatherThanReturningAPartialList: a full page 1 followed by an unreadable page 2 throws and names page 2.
  • GenerateAsync_WithAnEmptyListing_FailsAndLeavesTheReadmeUntouched replaces GenerateAsync_WithAnEmptyListing_WritesRatherThanBlockingOnAFailedLookup, as the issue asked. An existing README.md keeps its contents.
  • GenerateAsync_WithAFailedListing_FailsAndLeavesTheReadmeUntouched: a guard for the throwing-client path.
  • GetJson_WithUnparseableResponse_DegradesToEmpty now uses ListReleasesAsync, so it still covers the generic degrade behaviour.
  • With the two library changes reverted, the first three tests fail. With them in place, the full KtsuBuild.Tests suite passes (786/786) and KtsuBuild.slnx builds clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_012hoj76iUqCE6J1Wp5Dgmbm


Generated by Claude Code

…g listing fails [patch]

A failed /orgs/{org}/repos page used to end the listing early, so a
transient 5xx or rate limit on page 1 produced an empty list, and the
generator wrote and the daily job committed a profile README with no
repository table. A failure on a later page produced a truncated one.

ListOrganizationRepositoriesAsync now throws when any page fails, and
GenerateAsync refuses an empty listing before writing anything, so the
command exits 1 and the existing README stays as it was.

Fixes #178

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012hoj76iUqCE6J1Wp5Dgmbm
@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

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 writes (and the daily job commits) a README with the whole repository table removed when the org listing fails

2 participants