diff options
| author | Ninson Dobiyas <godclutch958@gmail.com> | 2026-11-25 00:51:30 +0400 |
|---|---|---|
| committer | Ninson Dobiyas <godclutch958@gmail.com> | 2026-11-25 00:51:30 +0400 |
| commit | 180824ba514ac5a3cf242368cc26e8890e4053ca (patch) | |
| tree | f1bea5a510c5da7f68c2f4accdfacc45389f3509 /docs/github-metadata-export.md | |
| parent | b298eb4012a857a72f1fe7a4c748f4e0f23d590b (diff) | |
docs(tools): document public metadata export and limitations
Diffstat (limited to 'docs/github-metadata-export.md')
| -rw-r--r-- | docs/github-metadata-export.md | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/docs/github-metadata-export.md b/docs/github-metadata-export.md new file mode 100644 index 000000000..e973bb9a8 --- /dev/null +++ b/docs/github-metadata-export.md | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | # Public GitHub metadata exporter | ||
| 2 | |||
| 3 | A standalone, read-only proof of concept for [issue #563](https://github.com/ubiquitarianism/leonida/issues/563). | ||
| 4 | It queries GitHub's **public REST API** and writes JSON containing public issues, pull requests, | ||
| 5 | issue/PR conversation comments, PR reviews, original IDs/URLs, authors, and timestamps. | ||
| 6 | It does **not** clone repositories, download game data, or access private content. | ||
| 7 | |||
| 8 | ## Usage | ||
| 9 | |||
| 10 | Python 3.9+; standard library only: | ||
| 11 | |||
| 12 | ```sh | ||
| 13 | python scripts/export_github_metadata.py ubiquitarianism/leonida --output metadata.json | ||
| 14 | ``` | ||
| 15 | |||
| 16 | Optional: set `GITHUB_TOKEN` to a token with access to public metadata for higher API rate limits. | ||
| 17 | The script never prints the token. Do not commit tokens or exported private data. | ||
| 18 | |||
| 19 | Offline tests (mocked API; no network calls): | ||
| 20 | |||
| 21 | ```sh | ||
| 22 | python -m unittest discover -s tests -p 'test_export_github_metadata.py' | ||
| 23 | ``` | ||
| 24 | |||
| 25 | The exporter walks public issue records (including PRs), their issue comments, and PR reviews, | ||
| 26 | following numbered pages of up to 100 records. It prints summary counts after writing. | ||
| 27 | On API errors or duplicate record IDs, it exits unsuccessfully without publishing a partial | ||
| 28 | new output file. A pre-existing output file remains unchanged on failure. | ||
| 29 | |||
| 30 | ## Limitations | ||
| 31 | |||
| 32 | * This is **not** a Radicle importer or a full GitHub archive. It excludes review-thread | ||
| 33 | comments, commit discussions, attachments, labels, milestones, events, deleted records, | ||
| 34 | private issues, and content inaccessible through the public API. | ||
| 35 | * The export is not a transactional snapshot: discussions may change while pagination runs. | ||
| 36 | Counts validate what was retrieved, **not** completeness against GitHub's live totals. | ||
| 37 | * GitHub secondary rate limits may require rerunning the export; the retry budget is bounded. | ||
| 38 | * Only export information you are authorized to access. Review retention and privacy needs | ||
| 39 | before publishing the JSON output. | ||