Repository navigation
GitHub Repos source: report the last day after a gap, not nothing - #594
Conversation
A listing last read more than a day ago took a new baseline and reported nothing. A daily schedule comes back a day and a moment later, so every check was such a listing and the watch stayed silent; a weekday schedule lost the weekend. Nothing older than a day is backfilled, and the last day is: a stale listing that was read before is now read as of a day and an hour ago, the hour of grace covering the scheduler's delay, or as of its own cursor when that is later. So it reports what is new in the last day, within the one page, and nothing older, and an item created moments after the previous check is not lost. Starting no earlier than its own cursor, it reports nothing twice. It keeps following its pull requests, so updates work with a daily schedule. A listing never read before still takes a baseline.
|
Nerve PR review · ✅ Ready to merge This fixes the regression I flagged on #593. Since that merge, a poll-mode listing last read more than 24 h ago took a new baseline, so a daily schedule (always a moment past 24 h) never reported anything. Now a stale listing is read against Completeness: 8 new or rewritten tests cover the daily, week-long, legacy-cursor, unknown- Worth considering:
Checked: 10 source/hosted/sync test files in an offline sandbox at |
GitHub Repos source: report the last day after a gap, not nothing
Why
Since #593, the polling GitHub Repos source re-reads a listing as a new baseline when it was last read more than a day ago, and reports nothing for it. A daily schedule (
0 9 * * *) comes back a day and a moment after the last check (the scheduler's delay, andlisted_atis stamped to the second), so practically every check is such a listing: the watch stays silent every morning, with only an info log. A weekday schedule loses everything from Friday evening to Monday. Hosted mode is not affected in practice, because the gateway polls every minute.What
"Nothing older than a day is backfilled" now means that the last day is reported, not nothing:
max(cursor, now − (24 h + 1 h)): items created or published within the last day, with an hour of grace for the scheduler's delay, are reported (within the one page, as for any listing), and older ones are not. So an item created seconds after the previous check is not lost when the next daily check comes a moment late.updates: trueworks with a daily schedule: a followed pull request that changed and was updated within the last day is reported after the gap, as it is without one.Switching the watch off and on in poll mode resumes where it left off within the day. Beyond a day, it reports the last day's items. In hosted mode, the gateway forgets the watch when it is switched off, so switching it on starts fresh.
Companion gateway change: https://github.com/ClickHouse/nerve-private/pull/573.
Changes
nerve/sources/github_repos.py:STALE_GRACEand_window(). The fetch loop reads a stale listing against it and keeps the fingerprints. Also theSTALE_AFTERcomment and the module docstring.docs/sources.md(the "No backfill beyond a day" bullet, the Upgrades bullet, the hosted bullet),docs/config.md(thereposrow),config.example.yaml.tests/test_github_repos_source.py.Verification
tests/test_github_repos_source.pyandtests/test_hosted_sources.py: 183 passed. CI runs the full suite. No new ruff finding.