Repository navigation
flake_history: refresh saves day by day under a time budget (port of gitgalaxy #5793) - #15
Merged
Merged
Conversation
…gitgalaxy #5793) A cold 14-day refresh (~2 min a day on GitGalaxy) wrote the cache only at the end; killed by its step's timeout it saved nothing and the next pass started over (2026-10-20: 78 of 79 reconcile passes spent 12.2 min there). Now missing days come first (newest first), then today and yesterday; the cache is saved after every day; --budget-s starts no new day after the budget; `updated` is set only when the whole window is in, so an unfinished cache stays stale. The shepherd-reconcile template has no flake refresh step, so no workflow change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Port of squid-protocol/gitgalaxy#5793. I applied it as a patch from that branch with paths renamed, not with
sync.py push.Cause
In GitGalaxy, a cold 14-day refresh took about 2 minutes per day, but
refresh()wrote the cache only after the last day. The step's timeout killed it first, nothing was saved, and the next pass started over. On 2026-10-20 that happened on 78 of 79 shepherd reconcile passes, at 12.2 minutes and one runner slot each.Change
src/squid_bot/flake_history.py:--budget-s Nstarts no new day after N seconds.updatedis set only when the whole window is in, so an unfinished cache still reads as stale and the next refresh carries on.save()andrefresh()now match GitGalaxy's word for word.templates/workflows/shepherd-reconcile.ymlhas no flake-refresh step, so it needs no change.Tests
tests/test_flake_history.pygets two new tests:pytest -q tests: 133 passed, 5 skipped. Ruff shows the same 3 findings as main, none new.🤖 Generated with Claude Code