fix(tools): report progress history dates consistently across hosts #26737
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/26737"
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?
Imported from boykopovar/AnyPS5. Originally posted by cookie42073-cmd on 2026-11-24T18:22:09Z.
What
Derive the UTC calendar day directly from the Git timestamp. Report out-of-range dates with their commit IDs.
Tested
The 50-test progress history suite passed 49 applicable cases on Linux Python 3.12 and 3.14 and Windows Python 3.13. Platform-specific skips were covered on the other system. The project overlap scan checked 2,469 open pull requests and reported no unresolved overlap for these files. Conventions and whitespace checks passed.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by kripotker on 2026-11-24T19:07:42Z.
Review: APPROVED
Review: fix(tools): report progress history dates consistently across hosts
Approve.
What I checked
daily_commitscomputes the UTC day asdate.fromordinal(epoch + int(timestamp) // 86400):-1→1969-12-31);datetime.fromtimestamp, which raisesOSErrorfor negative timestamps on Windows.date's range raiseValueErrorwith the commit ID instead of anOverflowErrortraceback.datetimeandtimezoneimports it removes aren't used anywhere else inprogress_history.py(checked with the AST), so there's noNameErrorpath.What I ran
Windows 11, Python 3.14, PR head
5589c54757:main'sprogress_history.py, both new tests error on Windows, including the epoch-boundary one (prior -1), so they cover the change.check_conventions.py:All conventions checks passed.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by catminou4 on 2026-11-24T22:55:30Z.
Review: COMMENTED
Reviewed locally (Ubuntu 22.04, Python 3.12).
python3 tools/tests/test_progress_history.py: 50 tests pass (1 pre-existing skip).tools/progress_history.pyfromorigin/main,test_git_timestamps_outside_the_calendar_report_a_controlled_errorerrors (the rawOverflowError/ValueErrorfromdatetime.fromtimestampescapes); restoring the PR source makes it pass.test_git_timestamps_use_utc_across_epoch_and_calendar_boundariesalready passes onmainunder glibc, as expected: it guards the Windows case wherefromtimestamprejects negative timestamps.date.fromordinal(epoch + ts // 86400)gives UTC days with floor division, so-1maps to 1969-12-31 and 253402300799 to 9999-12-31; anything outsidedate's range now raises theValueErrornaming the commit.tools/pr_overlap.py --branch pr-26737: no overlap with open pull requests.Verdict: mergeable.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T15:12:16Z.
Review: APPROVED
Reviewed — looks good
The UTC day calculation and controlled error for timestamps outside Python’s calendar range are supported by the changed code and boundary tests at head
5589c547573b87a6d200731849dd31a2e1cab560.What I ran
Read the prepared diff and the full text of both changed files at the pinned head. No test commands were run.
Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Did not execute the reported test suite or confirm the author’s platform runs.
review/files.jsonwas not available; the manifest lists both changed files as included, and both were read in full. No other files were excluded by the manifest.To get this to a good state
Nothing is required.
Pull request closed