mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:30:53 +01:00
[PR #625] progress_dashboard: handle null comment authors, require --run-tests for --tests, and catch I/O and history errors (DASH-HARDEN-CLI) #666
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#666
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/625
Author: @hamdog0203
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:fix/dash-harden-cli📝 Commits (2)
151e300progress_dashboard: handle null comment authors, require --run-tests for --tests, and catch I/O and history errors (DASH-HARDEN-CLI)3c2ad30progress_dashboard: require string content_hash and dict metrics in history.json📊 Changes
2 files changed (+126 additions, -6 deletions)
View changed files
📝
tests/test_progress_dashboard.py(+91 -0)📝
tools/progress_dashboard.py(+35 -6)📄 Description
Claimed in the coordination issue as: DASH-HARDEN-CLI (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7128321944)
Depends on: none
What and why
Fixes four CLI/error-handling gaps in
tools/progress_dashboard.py:collect_github()(--github --login) calledc.get("author", {}).get("login")andc["body"].lower(), crashing withAttributeErrorwhen a coordination issue comment has"author": null(deleted/ghost GitHub account) or"body": null.--tests REGEXwithout--run-testswas silently ignored instead of callingap.error(...)like--loginand--d3d-issue.ci_test_files()ran beforemain()'stry ... except OSErrorblock, letting directory/permission errors escape as raw tracebacks despite the_walk_errorcontract.write_outputs()ran outsidemain()'s error handler, and corrupt or non-listhistory.jsonfiles (or UTF-8 BOM-prefixed ones) caused unhandled exceptions instead of a clean exit2(or loading cleanly with BOM stripped).The fix
authorandbodyincollect_github()._load_history()to strip UTF-8 BOM and raiseValueErroron malformed JSON or non-list/malformedhistory.json.ap.error("--tests requires --run-tests")and caughtOSError/ValueErroraroundci_test_files()andwrite_outputs()inmain()(exiting2).Hardeningintests/test_progress_dashboard.py.Tested
Windows 11 (26200.9974), Python 3.12.10, CPU only, no game files.
python -I tests/test_progress_dashboard.py -v: 55/55 OKHardeningagainstmain21625bca8'stools/progress_dashboard.py): FAILED (failures=1, errors=4)python -m compileall -q tools/progress_dashboard.py tests/test_progress_dashboard.py: exit 0python -I scripts/check_no_game_data.py tools/progress_dashboard.py tests/test_progress_dashboard.py: exit 0python -I tests/test_text_write_line_endings.py: 3/3 OKgit diff --check: cleanAI-assisted: yes.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.