feat(tools): export progress history as CSV #12766
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12766"
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 StoneDC on 2026-10-29T08:39:21Z.
What
Adds optional history.csv matching the measured history.json points. Destination preflight runs before collection or any report write, including dangling symlinks. Main integration retains badge-week.svg generation and includes the badge in destination/alias/cache preflight alongside JSON/SVG/HTML and optional CSV. Sentinel regressions now protect every output, and the CSV success path verifies the badge is a real SVG.
Tested
Exact head
bfe834f066bc9f9db02045aea388bbb671b1718aintegrates mainba627802e2210187d417deb64c8f2fed8e33011f. Windows Python 3.12.14/3.14.3 and Linux Python 3.12.16/3.14.4: all three actual registered history CTest groups pass per configuration, covering 24 methods. Windows has three existing environment/permission skips, Linux one existing Windows-only skip; no CTest group skips. A control removing only the badge from preflight compiles/imports normally and fails the existing-report bytes/mtime preservation assertion in all four environments. Main weekly badge output and optional CSV are both retained; no cross-file atomicity for arbitrary later I/O failure is promised. Current-main conventions, whitespace, registration and main ancestry pass. Hosted runs for the new head are pending until complete.Earlier rationale and validation (historical revisions and dependency state)
What
Add opt-in --csv history reports with the same date, commit and metric values as JSON.
Address the late-output preservation review: before collection or any report write, reject a report destination that already denotes a non-regular file or a dangling symlink. A known-invalid final CSV destination now produces usage error 2 without replacing earlier JSON/SVG/HTML reports. Keep existing alias/cache checks and controlled error handling. New tests seed distinct report bytes and mtimes, cover each invalid destination, preserve a dangling link and its absent target, and verify retry after removing the obstruction. This is preflight for predictable invalid targets, not a cross-file transaction against arbitrary later I/O failures.
Integrate current main's path/symlink handling. Remove two identical shadowed cache-regression copies while retaining their effective method bodies and every existing unique test.
Tested
Exact tested head
5cde5c42ad66ec905fb36fe8286fb77d9caebb07; recorded main9f748f4d8e36ce3714f3b95f3386316e110a9b22; previous published headb4b9fec20ebf7b2b5584410aa1da2d3bdd91816e. Recorded main and the previous published head are ancestors. All current-main and previous unique test methods are retained; the documented #12488 context nesting and #12766 identical-shadow cleanup preserve the effective assertions.Windows 11: Python 3.14.3 and 3.12.14, CMake 4.3.1 / MinGW GCC 15.2. Non-root Ubuntu 26.04 / WSL: Python 3.14.4 and isolated Python 3.12.16, CMake 4.2.3 / GCC 15.2. Linux runs exact source archives on its native filesystem; a temporary Git snapshot supplies the release tests' current-tree revision lookup.
For both interpreters on each OS, configure Ninja Release with BUILD_TESTING=ON and ANYPS5_RELINKER_ONLY=ON, then run
ctest --test-dir <build> -R '^progress_history(_csv|_output)?$' -Vand the CTest skip-policy audit. All four configurations pass.Registered
progress_history,progress_history_csvandprogress_history_output: 3 CTest groups / 22 unique Python methods, including 4 CSV methods, pass per configuration. Windows skips two existing filesystem cases plus the real-link case where link privileges are absent; Linux skips the existing Windows-only read-only cache case. The directory preservation regression executes on both OSes. No CTest group skips.With current tests/code except the new preflight guard removed, the real report-preservation assertion fails on both OSes under Python 3.12 and 3.14; this is an assertion about lost sentinel contents, not an import/setup failure. The restored implementation passes.
Current-main conventions with this complete description, whitespace, Python 3.9 grammar, AST test-retention and production-script registration checks pass. No timeout was raised. These are interpreter/tool tests, not native product builds. No actual Python 3.9/3.11, local macOS, PS5/title/GPU or live sampler/browser run is claimed. New-head hosted CI starts after publication; old-head approvals/checks are not fresh results for this head.
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 malekaifa on 2026-10-30T13:51:08Z.
Review: CHANGES_REQUESTED
I reproduced a late-output preservation issue on exact head
b4b9fec20ebf7b2b5584410aa1da2d3bdd91816e(Windows 11, Python 3.12).With
--csv, ifhistory.csvalready exists as a directory,main()returns the intended argparse exit 2 with no traceback, but only afterhistory.json,history.svg, andhistory.htmlhave all been replaced. I seeded those three files with sentinel bytes, madehistory.csva directory, patchedcollect()to one valid point, and all three sentinels were lost before the CSV open failed.This is newly reachable through this PR because the CSV destination is appended as the final write. The existing
test_csv_alias_and_write_failure_are_usage_errorsverifies the exit path but does not assert that earlier reports survive that failure.Could the report destinations be preflighted (at least predictable non-file/dangling targets) before the first report write, with a regression that seeds the existing reports and verifies they remain unchanged when the CSV destination is invalid? This does not require claiming full cross-file atomicity against arbitrary I/O failure; it just prevents a known-invalid new destination from partially publishing the report set.
Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-10-31T20:05:05Z.
Review: APPROVED
Approved exact head
5cde5c42ad. Independent validation: HistoryCsvTests passes (4 tests, 1 symlink-environment skip), py_compile passed, registration/diff/merge preview are clean. The invalid-destination regression verifies existing JSON/SVG/HTML bytes and mtimes are preserved before collection/writes. Negative control on prior head 4b9fec20ebf7b2b5584410aa1da2d3bdd91816e reproduced the bug: all three seeded reports changed before invalid CSV exited 2.