Repository navigation
Conversation
With `timezone` set to a named zone, the log age and the artefact age were each the difference of two datetimes that share one tzinfo object. Python subtracts those by wall clock and ignores the offset each one carries, so an age that spans a clock change was an hour out: noon to noon read 24 hours on a fall-back night where 25 had passed, and 24 on a spring-forward night where 23 had. A job could stay FRESH an hour past its window or turn STALE an hour early. Both ages now come from `hours_between`, which converts to UTC before it subtracts. `local`, `UTC` and fixed offsets were never affected. Tests cross a fall-back change in America/New_York and a spring-forward change in Australia/Sydney, for the log age and the artefact age, with a window set between the wall-clock figure and the real one. They skip on a host with no tz database. 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.
What changed
A freshness age is now measured in UTC. With
timezoneset to a named zone, the log age and the artefact age were each the difference of two datetimes that share one tzinfo object. Python subtracts those by wall clock and ignores the offset each one carries, so an age that spanned a clock change was an hour out. Both ages now come fromhours_between, which converts to UTC before it subtracts.Why
Noon to noon read 24 hours on a fall-back night where 25 had passed, and 24 on a spring-forward night where 23 had. A job could stay FRESH an hour past its window or turn STALE an hour early.
local,UTCand fixed offsets were never affected.Tests
New tests cross an autumn clock change in America/New_York and a spring one in Australia/Sydney, for the log age and the artefact age, with a window set between the figure by wall clock and the real one. They skip on a host with no tz database. The suite passes locally, 184 tests.
Known limit: only the two age subtractions changed. Comparisons that add a timedelta to a zoned datetime still work by wall clock.
🤖 Generated with Claude Code