Feat/public GitHub metadata export #1253
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1253"
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 ubiquitarianism/leonida. Originally posted by NinsonD on 2026-11-24T20:53:09Z.
Claimed in the coordination issue as: Not formally assigned; proposed in #563.
Related issue: #563
What and why
Added a standalone Python utility to preserve publicly accessible GitHub issue and pull request metadata.
The exporter includes:
This is an initial proof of concept for preserving project history before considering a full migration. No external Python dependencies or game files are required. The CLI uses unauthenticated requests to limit exports to public content; GitHub's lower unauthenticated rate limit applies.
Tested
On Windows, Python 3.11.9, tested commit
9e4b0bab961244b050b31e3238a5ec342ebd3a83using an isolated copy of the exporter and its test file:python -I tests/test_export_github_metadata.py: 6 tests passed with mocked API responses and a writable workspace temporary directory.GPUs tested: N/A
AI-assisted: Yes
Checklist
Translator contract changes: N/A.
This is a proof of concept rather than a complete migration solution. Feedback on the implementation and scope is welcome.
Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T14:36:56Z.
Reviewed
b61a6d609: the branch's own suite fails (mocked API, no network): test_duplicate_ids_fail_closed gets no ValueError because its mock shares one iterator across all pages() calls, so the first issue's comments fetch consumes the second record — the script itself fails closed correctly with per-endpoint iterators (probed). tests/test_text_write_line_endings.py also fails on scripts/export_github_metadata.py:107 (Path.write_text without newline=, CRLF on Windows; CI runs that test everywhere). Both fixes are small; pagination, the retry budget and the atomic output probe clean, and all 12 test_docs_*.py pass. AI-assisted review.Recommendation: Fix first
Imported from ubiquitarianism/leonida. Originally posted by NinsonD on 2026-11-26T05:08:47Z.
Thanks @PierreEbele for reviewing this. I’ve updated the branch in
9e4b0bato fix the duplicate-ID test mock and specify LF line endings for the JSON output.The six targeted offline tests pass on Windows. I also checked the exporter with the repository’s line-ending detector; I haven’t run the full repository-wide scan or a live API export. CI workflows are awaiting maintainer approval.
The update also preserves issue and PR descriptions and makes CLI requests unauthenticated to keep the export limited to public content.
AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T22:42:44Z.
Hi @NinsonD, thanks for this pull request.
CONTRIBUTING.md asks contributors to claim their work in the coordination issue ("Coordinating who works on what", currently #1608) before opening a pull request: post
claiming: <ID>there, or a one-line description if the item is not listed yet, and put the ID in the pull request. I could not find a claim from you for this one.The claim matters because "it is claimed in the coordination issue by the pull request's author" is the first item on the maintainers' checklist for a mergeable pull request, and because it lets others see that the work is taken before they write it a second time.
Could you post the claim in #1608 and put its ID (or a link to it) on the pull request's "Claimed in the coordination issue as:" line? If you already claimed it in another form, a link to your comment is enough.
AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T23:49:10Z.
#1253 | head
9e4b0bab96(merged cleanly with maina9e247cd69) |python -I tests/test_export_github_metadata.py -v+python -I tests/test_tool_stdout_encoding.py+python -I tests/test_ci_registration.py+python -I tests/test_text_write_line_endings.py| red on main:FileNotFoundError(scripts/export_github_metadata.pyabsent onmain) | green on PR+main (unit suite):6 ran, OK(test_export_github_metadata.py—test_duplicate_ids_fail_closednow passes on9e4b0bab96),18 ran, OK(test_ci_registration.py),3 ran, OK(test_text_write_line_endings.py),2 ran, OK(test_docs_table_rows.py),5 ran, OK(test_docs_repo_paths.py), and1 ran, OK(test_docs_encoding.py); 1 CI check flagged:tests/test_tool_stdout_encoding.pyflagsscripts/export_github_metadata.py| Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesAudited updated head
9e4b0bab96(scripts/export_github_metadata.py,tests/test_export_github_metadata.py, anddocs/github-metadata-export.md) merged cleanly ontomain(a9e247cd69) on Windows 11 — first verification run on9e4b0bab96:test_duplicate_ids_fail_closedand LF-output atomic write (newline="\n") pass cleanly on Windows 11 (6/6), andscripts/check_no_game_data.pypasses with zero issues.tests/test_tool_stdout_encoding.py):EveryToolGuardsStdout.test_every_main_block_reconfigures_stdoutrequires everytools/*.pyandscripts/*.pywith anif __name__ == "__main__":block to callsys.stdout.reconfigure(errors="replace")(insidetry ... except (AttributeError, ValueError, OSError): pass) before runningmain()so redirected stdout on Windowscp1252underpython -Icannot raiseUnicodeEncodeError. Adding that guard inscripts/export_github_metadata.py's__main__block will cleartest_tool_stdout_encoding.pyonce#2590lands.Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T00:44:51Z.
Independent run of #1253 (python -I, no build, no game, no network; GPU not used).
9e4b0bab96829530dbd0(PR merged into it locally withgit merge --no-ff, clean)Commands (one process each, from the repo root):
python -I tests/test_export_github_metadata.py, plus everytests/test_docs_*.py,test_ci_registration.py,test_text_write_line_endings.py,test_csv_line_endings.py,test_check_no_game_data.py,test_no_game_data_workflow.py,test_tool_stdout_encoding.py.scripts/export_github_metadata.py,docs/github-metadata-export.md) and the test kept, the test file cannot load:FileNotFoundErrorfor the exporter. This is a new-feature red (the module does not exist on main), not a behaviour red.test_export_github_metadata.py6/6 OK (the duplicate-ID and LF-output fixes from the review are in).test_export_github_metadata.py6/6 OK.tests/test_tool_stdout_encoding.pyfails at the head and merged. The list of programs whose__main__block does not seterrors='replace'on stdout gainsscripts/export_github_metadata.py. The test is already red on plain main for other programs (tools/pc_prompt_glyphs.py,tools/xbox_prompt_glyphs.py,scripts/bench_translate.py,scripts/export_old_pr_manifest.py), so it is pre-existing, but this PR adds one more entry to fix.test_docs_cli_flags.py(1 failure, README line 94, a PowerShell flag) andtest_docs_links.py(1 failure, a relative link in the d3d12 README).Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T17:08:55Z.
Tested
9e4b0bab9merged (no commit) withmain4364a4fa6: Python 3.12, Windows 11 10.0.26300, CPU only.python -I tests/test_export_github_metadata.pygives 6 tests OK.scripts/export_github_metadata.py(new in this PR) the test cannot import it, so the red is only the missing module.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by NinsonD on 2026-12-01T08:36:34Z.
Thanks @zmasi, @enlight3d and @MoonEyes for reviewing and testing this.
I’ve added the stdout encoding guard in
2095f63. In an isolated copy on Windows, the six offline exporter tests and the relevant stdout guard check pass. I haven’t run the full repository suite; CI results are still pending.@MoonEyes, thanks for pointing out the missing coordination claim. I proposed the work in #563 but did not post a claim before opening this PR. Since the PR is already open, would you prefer that I add a claim in the current coordination thread and link it here, or follow another process?
AI-assisted changes and testing.
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:43:39Z.
Review: APPROVED
Reviewed
scripts/export_github_metadata.py,tests/test_export_github_metadata.py, anddocs/github-metadata-export.mdon head2095f63. Clean-room, standard-library-only, offline tests pass, and2095f63adds thesys.stdout.reconfigure(errors="replace")guard alongside LF line endings and atomic replacement.Approving pending a fresh green CI run on this head. Minor non-blocking follow-ups you may want to tidy: remove the unused
import osatscripts/export_github_metadata.py:59, update the example repo slug atdocs/github-metadata-export.md:19, and link your coordination-issue claim in the PR description.(AI-assisted review.)