Skip to content

Stop a board read that comes back short - #3

Merged
timlichtenberg merged 2 commits into
mainfrom
tl/board-read-guard
Oct 22, 2026
Merged

timlichtenberg merged 2 commits into
mainfrom
tl/board-read-guard

Conversation

@timlichtenberg

Copy link
Copy Markdown
Member

Summary

The GraphQL API sometimes returns a project item page with 0 items, a totalCount of 0 and hasNextPage: false, with no error. read_board accepted 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_board asks for items.totalCount and raises ShortBoardRead when a later page reports another total, when the number of items read differs from the total, or when the board has no items.
  • A short board is read up to 6 times in all (5 retries), 10 seconds apart; when all 6 are short, the run stops with exit code 2 before any write. A board with no items therefore stops every run.
  • README: the new rule, as its own item.

Validation

  • python -m pytest -q: 171 passed.
  • coverage run -m pytest -q && coverage report: 99% total, board_sync/github.py 100% of lines and branches.
  • ruff check . and ruff format --check .: clean.
  • I changed each new condition, the retry count, the wait, the retried error type and the totalCount field of the query in turn; every change makes at least 1 test fail.

Not checked

  • The short pages were seen with a personal token; I did not reproduce them with the App token the workflow uses.
  • Value lists inside an item (fieldValues, issueFieldValues) still rely on hasNextPage only.

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.
@timlichtenberg
timlichtenberg merged commit 6eaf818 into main Oct 22, 2026
1 check passed
@timlichtenberg
timlichtenberg deleted the tl/board-read-guard branch October 22, 2026 16:33
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.

1 participant