The hub has a lot of code like this for converting timestamps before using them in a query.
datetime.datetime.fromtimestamp(value).isoformat(' ')
This gives a local timestamp, which can result in drift if the db has a different tz.
fix forthcoming
Metadata Update from @mikem: - Custom field Size adjusted to None
Metadata Update from @tkopecek: - Issue set to the milestone: 1.35 - Issue tagged with: bug
Metadata Update from @tkopecek: - Issue tagged with: testing-ready
One place this issue can manifest is in CG imports. If there is a tz disparity, between hub and db, Koji can record timestamps in the build that are different from the metadata. You can see this by comparing the build completion_ts with the metadata end_time. E.g.
$ koji call -j getBuild BUILDID|jq .completion_ts 1718171925.0 $ curl -s https://kojihost/kojifiles/packages/N/V/R/metadata.json|jq .build.end_time 1718186325
This can also manifest with some query calls that accept a timestamp for filtering, including queryHistory, listBuilds, and listTasks. For example, querying for builds by completion time will show offset results:
$ koji call -j listBuilds completeBefore=1719343179 completeAfter=1719343178 |jq .[].completion_ts 1719328778.37406
(example generated by picking a single build and querying the 1s interval around its completion_time)
Metadata Update from @mfilip: - Issue tagged with: testing-done
Commit 690ed8cf fixes this issue
This issue has been migrated to Fedora Forge: https://forge.fedoraproject.org/koji/koji/issues/4114
Please continue any further discussion there.