Repository navigation
Stop a board read that comes back short - #3
Merged
Merged
Conversation
The GraphQL API can return a project item page with no items, a totalCount of 0 and no next page, without an error. read_board took that as the end of the board, so a 225-item board could read as 200, 100 or 0 items. The read now asks for totalCount and treats a read as short when a later page reports another total, when the items read differ from the total, or when the board has no items. A short board is read up to 6 times in all, 10 seconds apart, and the run then stops with ShortBoardRead before any write.
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.
Summary
The GraphQL API sometimes returns a project item page with 0 items, a totalCount of 0 and
hasNextPage: false, with no error.read_boardaccepted that page as the end of the board, so a run could see a board as shorter than it is, or as empty. On 22 Oct this happened often, on all 3 boards. This change makes the read detect such a page, try the read again, and stop the run when it stays short.Changes
read_boardasks foritems.totalCountand raisesShortBoardReadwhen a later page reports another total, when the number of items read differs from the total, or when the board has no items.Validation
python -m pytest -q: 171 passed.coverage run -m pytest -q && coverage report: 99% total,board_sync/github.py100% of lines and branches.ruff check .andruff format --check .: clean.totalCountfield of the query in turn; every change makes at least 1 test fail.Not checked
fieldValues,issueFieldValues) still rely onhasNextPageonly.