dotnet / docs-tools

This repo contains GitHub Actions and other tools that are designed to be invoked on DocFx repositories.
Creative Commons Attribution 4.0 International
16 stars 28 forks source link

Refactor queries to run serially #325

Closed BillWagner closed 5 months ago

BillWagner commented 5 months ago

This is effectively a refactoring, but does fix an intermittent problem in the dotnet/docs repository.

In the previous structure of the code, two queries were started immediately: one for issues, and one for PRs. Then, the different query results would be enumerated one after the other, including executing and awaiting secondary queries for more issues.

When the issues query resulted in multiple "pages", the cached results on GitHub were incorrect, and starting the enumeration of the second query failed.

The new structure wraps creating the query object, executing the initial query, and enumerating the results (including any subsequent sub-queries) in one asynchronous method. That means the first query (for issues) is enumerated completely before creating and making the first query for pull requests.