Feat/public GitHub metadata export #1253

Open
github-bot wants to merge 5 commits from github-bot/gh-1253 into main AGit
Owner

@⁠NinsonD on GitHub · 2026-11-24 20:53 UTC · original
NinsonD:feat/public-github-metadata-export → main · +245 −0 · 3 files · 5 commits · open

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:

  • Issues, pull requests, comments and PR reviews.
  • Original IDs, URLs, timestamps, descriptions and contributor attribution.
  • API pagination and rate-limit handling.
  • Duplicate-record detection and atomic JSON output.
  • Offline unit tests and usage documentation.

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 9e4b0bab961244b050b31e3238a5ec342ebd3a83 using 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.
  • The repository's line-ending detector reported no unpinned text writes in the exporter. The full repository-wide line-ending scan could not be completed against the isolated copy because the rest of the repository was not present.
  • No live API export or full repository suite was run; CI validation remains pending.

GPUs tested: N/A

AI-assisted: Yes

Checklist

  • Based on current main and verified through CI.
  • One focused contribution.
  • No game data, keys or decryption.
  • Targeted offline tests executed successfully.

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.

**@⁠NinsonD** on GitHub · 2026-11-24 20:53 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1253) `NinsonD:feat/public-github-metadata-export` → `main` · +245 −0 · 3 files · 5 commits · open 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: * Issues, pull requests, comments and PR reviews. * Original IDs, URLs, timestamps, descriptions and contributor attribution. * API pagination and rate-limit handling. * Duplicate-record detection and atomic JSON output. * Offline unit tests and usage documentation. 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 `9e4b0bab961244b050b31e3238a5ec342ebd3a83` using 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. * The repository's line-ending detector reported no unpinned text writes in the exporter. The full repository-wide line-ending scan could not be completed against the isolated copy because the rest of the repository was not present. * No live API export or full repository suite was run; CI validation remains pending. GPUs tested: N/A AI-assisted: Yes Checklist * [ ] Based on current main and verified through CI. * [x] One focused contribution. * [x] No game data, keys or decryption. * [x] Targeted offline tests executed successfully. 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:44:38 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 14:36 UTC · original

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

**@⁠PierreEbele** on GitHub · 2026-11-25 14:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1253#issuecomment-7165551869) 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
Author
Owner

@⁠NinsonD on GitHub · 2026-11-26 05:08 UTC · original

Thanks @⁠PierreEbele for reviewing this. I’ve updated the branch in 9e4b0ba to 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.

**@⁠NinsonD** on GitHub · 2026-11-26 05:08 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1253#issuecomment-7183221521) Thanks @⁠PierreEbele for reviewing this. I’ve updated the branch in `9e4b0ba` to 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1253/head:github-bot/gh-1253'
git switch 'github-bot/gh-1253'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1253'
git switch 'github-bot/gh-1253'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1253'
git switch 'github-bot/gh-1253'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1253'
git switch 'main'
git merge --squash 'github-bot/gh-1253'
git switch 'main'
git merge --ff-only 'github-bot/gh-1253'
git switch 'main'
git merge 'github-bot/gh-1253'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.