A run not yet started shows as started in 1969 on an instance outside UTC #35
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jeff/zfj#35
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
zfj run listshows a run that has not started as having started at the end of 1969:Forgejo fills in
startedandstoppedwith the Unix epoch for a run that has not reached them. It writes every timestamp in the instance's own time zone, though, so git.jcollie.dev's epoch arrives as1969-12-31T18:00:00-06:00, not1970-01-01T00:00:00Z.happenedinsrc/cli/run.zigonly recognizes the string1970-01-01T00:00:00(and0001-01-01for Go's zero time), so any instance outside UTC slips past it. The NixOS test runs Forgejo in UTC, which is why it passed there.The same mistake shows up wherever the zero time is shown:
run list: the started column, both on a terminal and in the tab-separated outputrun view: "Started 1969-12-31 18:00" in place of "Created …", and a duration printed for a run that has not stoppedrun watch: the header line, throughrenderRunFix
Parse the timestamps with zig-datetime instead of comparing strings:
0001-01-01zero time too, in any offset.minutedoes now. Parsing is for the comparison only.Adding the dependency means a new entry in
build.zig.zonand a regeneratedbuild.zig.zon.nix(zon2nix --17), so the Nix build and the VM test still build offline.Tests
happenedwith the epoch inZ,-06:00and+05:30, Go's zero time in an offset, a real timestamp, and one that won't parse.renderRuntest for a waiting run whose zero times are in-06:00.TZ) so the integration test sees what a real instance sends.