Repository navigation
Check the issue timeline read against its total - #5
Merged
Merged
Conversation
An issue timeline read can come back short or empty with no error, and a synced value then has no change time and loses to any other place. The timeline query now asks for totalCount: a read with a number of field events other than min(totalCount, 100) is read again like the other short reads. An issue with a synced value but no event for it, while the timeline holds 100 field events or fewer, counts as unread for the run, so its issue fields are not written.
A null or absent totalCount on the issue timeline raised TypeError or KeyError and stopped the run without a second read; it now counts as a short read like the value list. Tests cover a timeline total of 101, two synced values of which only one has an event, more events than the total, and the query placeholders.
The docstrings now say that any event count other than the total, and a missing total, lead to a new read, and that an unread issue waits for the next run. The constant comment no longer claims an event order.
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 issue values read takes the change time of each synced issue field from the issue timeline, but it trusts the timeline list as it comes back. If the API returns a short or empty timeline with no error, a synced value has no change time and loses to any value set at another place, so the run can overwrite a newer issue edit. This change checks the timeline against its
totalCountand keeps an issue out of the run when a synced value has no event.No short timeline has been seen yet: the board and value reads came back short on 22 Oct, and this closes the same gap for the timeline before it shows up.
Changes
totalCount. A timeline with a number of events other thanmin(totalCount, 100), a null or missingtotalCount, or a null event list is a short read (a null event counts as a missing one, as null entries in the value lists already do): the batch is read again (up to 6 reads, 10 seconds apart), then the run stops before any write, as for a short value list.Validation
python -m pytest -q: 210 passed.coverage run -m pytest -q && coverage report: 99% total,github.py100% of lines and branches.ruff check .andruff format --check .: clean.!=to<,<=to<,anytoall, theisinstancecheck, the 100 limit, the placeholder replace); every change makes at least 1 test fail, and 2 changes without effect make none fail.totalCountwithitemTypesequals the number of events returned and differs from the count without the filter. In a full read of the 3 boards, 120 of 293 issues hold synced values and none has a value without an event.python -m board_syncwithout--applyon this branch: all reads full, 0 unread issues.Not checked