Improve RepoStats plugin resilience: graceful rate-limit handling in CI#798
Merged
Merged
Conversation
…acefully in CI Agent-Logs-Url: https://github.com/DNNCommunity/DNNDocs/sessions/7a209cd6-4a02-44bf-9791-b0d7964136c1 Co-authored-by: valadas <6371568+valadas@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve RepoStats plugin resilience against GitHub API rate limits
Improve RepoStats plugin resilience: graceful rate-limit handling in CI
May 5, 2026
valadas
requested changes
May 5, 2026
| Console.WriteLine($"[RepoStats] Found {contributors.Count} contributors"); | ||
|
|
||
| Console.WriteLine($"Found {commits.Count} commits"); | ||
| commits = gitHubApi.GetCommitsAsync().GetAwaiter().GetResult().ToList(); |
Member
There was a problem hiding this comment.
I am not a fan of this sync usage of an async API, can we instead make the method async?
Contributor
Author
There was a problem hiding this comment.
Done in e485750. IDocumentBuildStep.Postbuild is a void interface contract that DocFX calls synchronously, so we can't change its signature. The fix is a private PostbuildAsync method that uses proper await throughout — the public Postbuild now simply delegates to it with a single .GetAwaiter().GetResult() and an explanatory comment.
…ted GetAwaiter().GetResult() Agent-Logs-Url: https://github.com/DNNCommunity/DNNDocs/sessions/3804f175-bf0e-4a12-9b8b-25f9187063a9 Co-authored-by: valadas <6371568+valadas@users.noreply.github.com>
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.
GitHubApi.cs:tokenfield nullable (string?) — fixes pre-existing CS8618 compiler warningThrottleIfNeeded()→Task<bool>: returnsfalsewhen rate limit exhausted, progressive backoff when nearingRateLimitExceededExceptionand general exceptions in all API methodsACCESS_TOKENenv var support (PAT preferred overGithubToken/GITHUB_TOKEN)[RepoStats]prefixed log messagesRepoStatsBuildStep.cs:PostbuildAsyncmethod — all async calls use properawait; synchronousPostbuildinterface method delegates to it via.GetAwaiter().GetResult()with explanatory commentList<Octokit.Contributor>type to avoid ambiguity