github-backup 0.64.1__tar.gz → 0.65.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {github_backup-0.64.1 → github_backup-0.65.0}/CHANGES.rst +79 -1
- {github_backup-0.64.1/github_backup.egg-info → github_backup-0.65.0}/PKG-INFO +28 -4
- {github_backup-0.64.1 → github_backup-0.65.0}/README +27 -3
- {github_backup-0.64.1 → github_backup-0.65.0}/README.rst +27 -3
- github_backup-0.65.0/github_backup/__init__.py +1 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/github_backup/github_backup.py +268 -13
- {github_backup-0.64.1 → github_backup-0.65.0}/github_backup/graphql_queries.py +60 -0
- {github_backup-0.64.1 → github_backup-0.65.0/github_backup.egg-info}/PKG-INFO +28 -4
- {github_backup-0.64.1 → github_backup-0.65.0}/github_backup.egg-info/SOURCES.txt +2 -0
- github_backup-0.65.0/tests/test_gists.py +227 -0
- github_backup-0.65.0/tests/test_issue_timeline.py +434 -0
- github_backup-0.64.1/github_backup/__init__.py +0 -1
- {github_backup-0.64.1 → github_backup-0.65.0}/LICENSE.txt +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/MANIFEST.in +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/github_backup/__main__.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/github_backup/cli.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/github_backup.egg-info/dependency_links.txt +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/github_backup.egg-info/entry_points.txt +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/github_backup.egg-info/top_level.txt +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/github_backup.egg-info/zip-safe +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/release-requirements.txt +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/requirements.txt +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/setup.cfg +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/setup.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/tests/test_all_starred.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/tests/test_attachments.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/tests/test_auth.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/tests/test_case_sensitivity.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/tests/test_disabled_issues_pulls.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/tests/test_discussions.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/tests/test_http_451.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/tests/test_incremental_per_repository.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/tests/test_json_dump_if_changed.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/tests/test_logging_subprocess.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/tests/test_pagination.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/tests/test_pull_incremental_pagination.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/tests/test_pull_reviews.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/tests/test_releases.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/tests/test_retrieve_data.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/tests/test_skip_assets_on.py +0 -0
- {github_backup-0.64.1 → github_backup-0.65.0}/tests/test_starred_skip_size_over.py +0 -0
|
@@ -1,9 +1,87 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
-
0.
|
|
4
|
+
0.65.0 (2026-07-27)
|
|
5
5
|
-------------------
|
|
6
6
|
------------------------
|
|
7
|
+
- Refresh issue timelines when cross-references change (#168) [Rodos]
|
|
8
|
+
|
|
9
|
+
Cross-references do not change an issue's updated_at, so an incremental
|
|
10
|
+
run never lists the issue and never re-fetches its timeline. An issue
|
|
11
|
+
can be referenced from another repository years after its last activity
|
|
12
|
+
and the backup would never see it.
|
|
13
|
+
|
|
14
|
+
On incremental runs with --issue-timeline, ask GraphQL for each item's
|
|
15
|
+
cross-reference count and newest timestamp, compare both against what is
|
|
16
|
+
already saved, and re-fetch the timeline of anything that differs. Items
|
|
17
|
+
the since listing did not return are fetched individually. Both values
|
|
18
|
+
are needed: the count alone would miss a reference being added and
|
|
19
|
+
another deleted between runs, and the timestamp alone would miss a
|
|
20
|
+
deletion.
|
|
21
|
+
|
|
22
|
+
Pull requests are swept too when they are being stored as issues, which
|
|
23
|
+
is the case unless --pulls is used. They need their own query because
|
|
24
|
+
the issues connection excludes them, and because totalCount ignores the
|
|
25
|
+
itemTypes filter on a pull request although it honours it on an issue,
|
|
26
|
+
so their cross-references are counted from the nodes instead. Where that
|
|
27
|
+
count may have been truncated, the comparison falls back to the
|
|
28
|
+
timestamp alone rather than re-fetching on every run.
|
|
29
|
+
|
|
30
|
+
This costs one rate-limit point per 100 items against the GraphQL quota,
|
|
31
|
+
measured at 6 requests for a repository with 528 issues and pull
|
|
32
|
+
requests, and stores no new state: the comparison is against the
|
|
33
|
+
cross-references already in each item's timeline_data. A GraphQL failure
|
|
34
|
+
warns and leaves the rest of the backup unaffected.
|
|
35
|
+
|
|
36
|
+
Closes #168
|
|
37
|
+
- Add --issue-timeline flag to capture cross-reference events (#168)
|
|
38
|
+
[Rodos]
|
|
39
|
+
|
|
40
|
+
The issue events endpoint never returns cross-references, so an issue
|
|
41
|
+
mentioned from another issue or pull request leaves no trace in the
|
|
42
|
+
backup. GitHub only exposes those through the timeline endpoint. Full
|
|
43
|
+
backups miss them as well as incremental ones.
|
|
44
|
+
|
|
45
|
+
Adds --issue-timeline, which stores the timeline under a separate
|
|
46
|
+
timeline_data key alongside the unmodified event_data. The two
|
|
47
|
+
endpoints are complementary rather than nested: the timeline adds
|
|
48
|
+
cross-references, commits and reviews, while events carries
|
|
49
|
+
referenced entries the timeline drops, so neither replaces the other.
|
|
50
|
+
|
|
51
|
+
Timeline entries for comments are filtered out, since --issue-comments
|
|
52
|
+
already saves the bodies. Everything else is stored verbatim. The flag
|
|
53
|
+
is included in --all.
|
|
54
|
+
|
|
55
|
+
This makes the data obtainable, but does not change incremental
|
|
56
|
+
selection: a cross-reference does not bump the referenced issue's
|
|
57
|
+
updated_at, so an incremental run still never lists it. That half of
|
|
58
|
+
the issue remains open.
|
|
59
|
+
|
|
60
|
+
References #168
|
|
61
|
+
- Chore(deps): bump actions/setup-python from 6 to 7. [dependabot[bot]]
|
|
62
|
+
|
|
63
|
+
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6 to 7.
|
|
64
|
+
- [Release notes](https://github.com/actions/setup-python/releases)
|
|
65
|
+
- [Commits](https://github.com/actions/setup-python/compare/v6...v7)
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
updated-dependencies:
|
|
69
|
+
- dependency-name: actions/setup-python
|
|
70
|
+
dependency-version: '7'
|
|
71
|
+
dependency-type: direct:production
|
|
72
|
+
update-type: version-update:semver-major
|
|
73
|
+
...
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
0.64.2 (2026-07-18)
|
|
77
|
+
-------------------
|
|
78
|
+
- Add tests. [Duncan Ogilvie]
|
|
79
|
+
- Skip fetching gists that have not been updated. [Duncan Ogilvie]
|
|
80
|
+
- Skip retrieving repositories when not necessary. [Duncan Ogilvie]
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
0.64.1 (2026-07-17)
|
|
84
|
+
-------------------
|
|
7
85
|
- Fix exception when DMCA'd/empty gists were backed up. [Duncan Ogilvie]
|
|
8
86
|
|
|
9
87
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: github-backup
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.65.0
|
|
4
4
|
Summary: backup a github user or organization
|
|
5
5
|
Home-page: http://github.com/josegonzalez/python-github-backup
|
|
6
6
|
Author: Jose Diaz-Gonzalez
|
|
@@ -71,7 +71,8 @@ CLI Help output::
|
|
|
71
71
|
[--incremental-by-files]
|
|
72
72
|
[--starred] [--all-starred] [--starred-skip-size-over MB]
|
|
73
73
|
[--watched] [--followers] [--following] [--all]
|
|
74
|
-
[--issues] [--issue-comments] [--issue-events]
|
|
74
|
+
[--issues] [--issue-comments] [--issue-events]
|
|
75
|
+
[--issue-timeline] [--pulls]
|
|
75
76
|
[--pull-comments] [--pull-reviews] [--pull-commits]
|
|
76
77
|
[--pull-details]
|
|
77
78
|
[--labels] [--hooks] [--milestones] [--security-advisories]
|
|
@@ -126,6 +127,8 @@ CLI Help output::
|
|
|
126
127
|
--issues include issues in backup
|
|
127
128
|
--issue-comments include issue comments in backup
|
|
128
129
|
--issue-events include issue events in backup
|
|
130
|
+
--issue-timeline include issue timeline in backup (cross-references,
|
|
131
|
+
commits and reviews; complements --issue-events)
|
|
129
132
|
--pulls include pull requests in backup
|
|
130
133
|
--pull-comments include pull request review comments in backup
|
|
131
134
|
--pull-reviews include pull request reviews in backup
|
|
@@ -377,6 +380,27 @@ For finer control, avoid using ``--assets`` with starred repos, or use ``--skip-
|
|
|
377
380
|
|
|
378
381
|
Alternatively, consider just storing links to starred repos in JSON format with ``--starred``.
|
|
379
382
|
|
|
383
|
+
|
|
384
|
+
About issue events and the issue timeline
|
|
385
|
+
-----------------------------------------
|
|
386
|
+
|
|
387
|
+
Use ``--issue-events`` and ``--issue-timeline`` with ``--issues``; on their own they back up nothing.
|
|
388
|
+
|
|
389
|
+
``--issue-events`` backs up GitHub's issue events endpoint under each issue's ``event_data`` key. That endpoint returns a restricted set of event types and **never** includes cross-references, so an issue that was mentioned from another issue or pull request shows no sign of it. GitHub only exposes those through the timeline.
|
|
390
|
+
|
|
391
|
+
``--issue-timeline`` backs up the timeline endpoint under a separate ``timeline_data`` key. The two flags are independent: ``event_data`` keeps its existing contents and shape whether or not the timeline is enabled, so nothing that already reads it is affected.
|
|
392
|
+
|
|
393
|
+
Use both flags together for a complete picture. Neither endpoint is a superset of the other, so they are complementary rather than alternatives. Only the timeline reports ``cross-referenced``, ``committed`` and ``reviewed`` entries. Only the events endpoint reliably reports ``referenced`` entries, where a commit elsewhere in the repository mentions the issue; the timeline omits many of these, substituting the issue's own ``committed`` entries instead.
|
|
394
|
+
|
|
395
|
+
Note that timeline entries are not all the same shape as events. ``cross-referenced`` and ``committed`` entries have no ``id`` field, so anything consuming ``timeline_data`` should not assume one is present. ``commented`` entries are excluded from the backup because they embed the full comment body, which ``--issue-comments`` already saves.
|
|
396
|
+
|
|
397
|
+
``--issue-timeline`` is included in ``--all``. On issues with many cross-references it can be noticeably larger and slower than ``--issue-events`` alone, because each ``cross-referenced`` entry embeds the referencing issue in full. On a heavily cross-referenced issue this can mean several times the API requests and many times the JSON on disk. Ordinary repositories see little difference.
|
|
398
|
+
|
|
399
|
+
Incremental backups need extra help here, because being referenced from elsewhere does not change an issue's ``updated_at``. An issue can be mentioned from another repository years after its last activity, and the usual ``since`` listing will never report it as changed. On an incremental run with ``--issue-timeline``, github-backup therefore asks GitHub's GraphQL API for each item's cross-reference count and newest timestamp, compares those against what is already saved, and re-fetches the timeline of anything that differs. Pull requests are included in that check when they are being stored as issues, which is the case unless ``--pulls`` is used. The check needs no extra state on disk and also notices references that were later deleted. It costs one rate-limit point per 100 items checked, against GitHub's GraphQL quota, which is separate from the REST one. That is cheap in quota terms even on very large repositories, but it is not instant: a repository with 18,000 issues and pull requests took around 200 points and five minutes for the check alone.
|
|
400
|
+
|
|
401
|
+
If you enable ``--issue-timeline`` on an existing incremental backup, cross-references on older issues are picked up automatically by that check. Timeline entries of other kinds, such as commits and reviews, are only fetched when the issue itself is updated, so run once without ``--incremental`` if you want those filled in for historical issues too.
|
|
402
|
+
|
|
403
|
+
|
|
380
404
|
About pull request reviews
|
|
381
405
|
--------------------------
|
|
382
406
|
|
|
@@ -480,14 +504,14 @@ Quietly and incrementally backup useful Github user data (public and private rep
|
|
|
480
504
|
FINE_ACCESS_TOKEN=SOME-GITHUB-TOKEN
|
|
481
505
|
GH_USER=YOUR-GITHUB-USER
|
|
482
506
|
|
|
483
|
-
github-backup -f $FINE_ACCESS_TOKEN --prefer-ssh -o ~/github-backup/ -l error -P -i --all-starred --starred --watched --followers --following --issues --issue-comments --issue-events --pulls --pull-comments --pull-reviews --pull-commits --labels --milestones --security-advisories --discussions --repositories --wikis --releases --assets --attachments --pull-details --gists --starred-gists $GH_USER
|
|
507
|
+
github-backup -f $FINE_ACCESS_TOKEN --prefer-ssh -o ~/github-backup/ -l error -P -i --all-starred --starred --watched --followers --following --issues --issue-comments --issue-events --issue-timeline --pulls --pull-comments --pull-reviews --pull-commits --labels --milestones --security-advisories --discussions --repositories --wikis --releases --assets --attachments --pull-details --gists --starred-gists $GH_USER
|
|
484
508
|
|
|
485
509
|
Debug an error/block or incomplete backup into a temporary directory. Omit "incremental" to fill a previous incomplete backup. ::
|
|
486
510
|
|
|
487
511
|
FINE_ACCESS_TOKEN=SOME-GITHUB-TOKEN
|
|
488
512
|
GH_USER=YOUR-GITHUB-USER
|
|
489
513
|
|
|
490
|
-
github-backup -f $FINE_ACCESS_TOKEN -o /tmp/github-backup/ -l debug -P --all-starred --starred --watched --followers --following --issues --issue-comments --issue-events --pulls --pull-comments --pull-reviews --pull-commits --labels --milestones --discussions --repositories --wikis --releases --assets --pull-details --gists --starred-gists $GH_USER
|
|
514
|
+
github-backup -f $FINE_ACCESS_TOKEN -o /tmp/github-backup/ -l debug -P --all-starred --starred --watched --followers --following --issues --issue-comments --issue-events --issue-timeline --pulls --pull-comments --pull-reviews --pull-commits --labels --milestones --discussions --repositories --wikis --releases --assets --pull-details --gists --starred-gists $GH_USER
|
|
491
515
|
|
|
492
516
|
Pipe a token from stdin to avoid storing it in environment variables or command history (Unix-like systems only)::
|
|
493
517
|
|
|
@@ -41,7 +41,8 @@ CLI Help output::
|
|
|
41
41
|
[--incremental-by-files]
|
|
42
42
|
[--starred] [--all-starred] [--starred-skip-size-over MB]
|
|
43
43
|
[--watched] [--followers] [--following] [--all]
|
|
44
|
-
[--issues] [--issue-comments] [--issue-events]
|
|
44
|
+
[--issues] [--issue-comments] [--issue-events]
|
|
45
|
+
[--issue-timeline] [--pulls]
|
|
45
46
|
[--pull-comments] [--pull-reviews] [--pull-commits]
|
|
46
47
|
[--pull-details]
|
|
47
48
|
[--labels] [--hooks] [--milestones] [--security-advisories]
|
|
@@ -96,6 +97,8 @@ CLI Help output::
|
|
|
96
97
|
--issues include issues in backup
|
|
97
98
|
--issue-comments include issue comments in backup
|
|
98
99
|
--issue-events include issue events in backup
|
|
100
|
+
--issue-timeline include issue timeline in backup (cross-references,
|
|
101
|
+
commits and reviews; complements --issue-events)
|
|
99
102
|
--pulls include pull requests in backup
|
|
100
103
|
--pull-comments include pull request review comments in backup
|
|
101
104
|
--pull-reviews include pull request reviews in backup
|
|
@@ -347,6 +350,27 @@ For finer control, avoid using ``--assets`` with starred repos, or use ``--skip-
|
|
|
347
350
|
|
|
348
351
|
Alternatively, consider just storing links to starred repos in JSON format with ``--starred``.
|
|
349
352
|
|
|
353
|
+
|
|
354
|
+
About issue events and the issue timeline
|
|
355
|
+
-----------------------------------------
|
|
356
|
+
|
|
357
|
+
Use ``--issue-events`` and ``--issue-timeline`` with ``--issues``; on their own they back up nothing.
|
|
358
|
+
|
|
359
|
+
``--issue-events`` backs up GitHub's issue events endpoint under each issue's ``event_data`` key. That endpoint returns a restricted set of event types and **never** includes cross-references, so an issue that was mentioned from another issue or pull request shows no sign of it. GitHub only exposes those through the timeline.
|
|
360
|
+
|
|
361
|
+
``--issue-timeline`` backs up the timeline endpoint under a separate ``timeline_data`` key. The two flags are independent: ``event_data`` keeps its existing contents and shape whether or not the timeline is enabled, so nothing that already reads it is affected.
|
|
362
|
+
|
|
363
|
+
Use both flags together for a complete picture. Neither endpoint is a superset of the other, so they are complementary rather than alternatives. Only the timeline reports ``cross-referenced``, ``committed`` and ``reviewed`` entries. Only the events endpoint reliably reports ``referenced`` entries, where a commit elsewhere in the repository mentions the issue; the timeline omits many of these, substituting the issue's own ``committed`` entries instead.
|
|
364
|
+
|
|
365
|
+
Note that timeline entries are not all the same shape as events. ``cross-referenced`` and ``committed`` entries have no ``id`` field, so anything consuming ``timeline_data`` should not assume one is present. ``commented`` entries are excluded from the backup because they embed the full comment body, which ``--issue-comments`` already saves.
|
|
366
|
+
|
|
367
|
+
``--issue-timeline`` is included in ``--all``. On issues with many cross-references it can be noticeably larger and slower than ``--issue-events`` alone, because each ``cross-referenced`` entry embeds the referencing issue in full. On a heavily cross-referenced issue this can mean several times the API requests and many times the JSON on disk. Ordinary repositories see little difference.
|
|
368
|
+
|
|
369
|
+
Incremental backups need extra help here, because being referenced from elsewhere does not change an issue's ``updated_at``. An issue can be mentioned from another repository years after its last activity, and the usual ``since`` listing will never report it as changed. On an incremental run with ``--issue-timeline``, github-backup therefore asks GitHub's GraphQL API for each item's cross-reference count and newest timestamp, compares those against what is already saved, and re-fetches the timeline of anything that differs. Pull requests are included in that check when they are being stored as issues, which is the case unless ``--pulls`` is used. The check needs no extra state on disk and also notices references that were later deleted. It costs one rate-limit point per 100 items checked, against GitHub's GraphQL quota, which is separate from the REST one. That is cheap in quota terms even on very large repositories, but it is not instant: a repository with 18,000 issues and pull requests took around 200 points and five minutes for the check alone.
|
|
370
|
+
|
|
371
|
+
If you enable ``--issue-timeline`` on an existing incremental backup, cross-references on older issues are picked up automatically by that check. Timeline entries of other kinds, such as commits and reviews, are only fetched when the issue itself is updated, so run once without ``--incremental`` if you want those filled in for historical issues too.
|
|
372
|
+
|
|
373
|
+
|
|
350
374
|
About pull request reviews
|
|
351
375
|
--------------------------
|
|
352
376
|
|
|
@@ -450,14 +474,14 @@ Quietly and incrementally backup useful Github user data (public and private rep
|
|
|
450
474
|
FINE_ACCESS_TOKEN=SOME-GITHUB-TOKEN
|
|
451
475
|
GH_USER=YOUR-GITHUB-USER
|
|
452
476
|
|
|
453
|
-
github-backup -f $FINE_ACCESS_TOKEN --prefer-ssh -o ~/github-backup/ -l error -P -i --all-starred --starred --watched --followers --following --issues --issue-comments --issue-events --pulls --pull-comments --pull-reviews --pull-commits --labels --milestones --security-advisories --discussions --repositories --wikis --releases --assets --attachments --pull-details --gists --starred-gists $GH_USER
|
|
477
|
+
github-backup -f $FINE_ACCESS_TOKEN --prefer-ssh -o ~/github-backup/ -l error -P -i --all-starred --starred --watched --followers --following --issues --issue-comments --issue-events --issue-timeline --pulls --pull-comments --pull-reviews --pull-commits --labels --milestones --security-advisories --discussions --repositories --wikis --releases --assets --attachments --pull-details --gists --starred-gists $GH_USER
|
|
454
478
|
|
|
455
479
|
Debug an error/block or incomplete backup into a temporary directory. Omit "incremental" to fill a previous incomplete backup. ::
|
|
456
480
|
|
|
457
481
|
FINE_ACCESS_TOKEN=SOME-GITHUB-TOKEN
|
|
458
482
|
GH_USER=YOUR-GITHUB-USER
|
|
459
483
|
|
|
460
|
-
github-backup -f $FINE_ACCESS_TOKEN -o /tmp/github-backup/ -l debug -P --all-starred --starred --watched --followers --following --issues --issue-comments --issue-events --pulls --pull-comments --pull-reviews --pull-commits --labels --milestones --discussions --repositories --wikis --releases --assets --pull-details --gists --starred-gists $GH_USER
|
|
484
|
+
github-backup -f $FINE_ACCESS_TOKEN -o /tmp/github-backup/ -l debug -P --all-starred --starred --watched --followers --following --issues --issue-comments --issue-events --issue-timeline --pulls --pull-comments --pull-reviews --pull-commits --labels --milestones --discussions --repositories --wikis --releases --assets --pull-details --gists --starred-gists $GH_USER
|
|
461
485
|
|
|
462
486
|
Pipe a token from stdin to avoid storing it in environment variables or command history (Unix-like systems only)::
|
|
463
487
|
|
|
@@ -41,7 +41,8 @@ CLI Help output::
|
|
|
41
41
|
[--incremental-by-files]
|
|
42
42
|
[--starred] [--all-starred] [--starred-skip-size-over MB]
|
|
43
43
|
[--watched] [--followers] [--following] [--all]
|
|
44
|
-
[--issues] [--issue-comments] [--issue-events]
|
|
44
|
+
[--issues] [--issue-comments] [--issue-events]
|
|
45
|
+
[--issue-timeline] [--pulls]
|
|
45
46
|
[--pull-comments] [--pull-reviews] [--pull-commits]
|
|
46
47
|
[--pull-details]
|
|
47
48
|
[--labels] [--hooks] [--milestones] [--security-advisories]
|
|
@@ -96,6 +97,8 @@ CLI Help output::
|
|
|
96
97
|
--issues include issues in backup
|
|
97
98
|
--issue-comments include issue comments in backup
|
|
98
99
|
--issue-events include issue events in backup
|
|
100
|
+
--issue-timeline include issue timeline in backup (cross-references,
|
|
101
|
+
commits and reviews; complements --issue-events)
|
|
99
102
|
--pulls include pull requests in backup
|
|
100
103
|
--pull-comments include pull request review comments in backup
|
|
101
104
|
--pull-reviews include pull request reviews in backup
|
|
@@ -347,6 +350,27 @@ For finer control, avoid using ``--assets`` with starred repos, or use ``--skip-
|
|
|
347
350
|
|
|
348
351
|
Alternatively, consider just storing links to starred repos in JSON format with ``--starred``.
|
|
349
352
|
|
|
353
|
+
|
|
354
|
+
About issue events and the issue timeline
|
|
355
|
+
-----------------------------------------
|
|
356
|
+
|
|
357
|
+
Use ``--issue-events`` and ``--issue-timeline`` with ``--issues``; on their own they back up nothing.
|
|
358
|
+
|
|
359
|
+
``--issue-events`` backs up GitHub's issue events endpoint under each issue's ``event_data`` key. That endpoint returns a restricted set of event types and **never** includes cross-references, so an issue that was mentioned from another issue or pull request shows no sign of it. GitHub only exposes those through the timeline.
|
|
360
|
+
|
|
361
|
+
``--issue-timeline`` backs up the timeline endpoint under a separate ``timeline_data`` key. The two flags are independent: ``event_data`` keeps its existing contents and shape whether or not the timeline is enabled, so nothing that already reads it is affected.
|
|
362
|
+
|
|
363
|
+
Use both flags together for a complete picture. Neither endpoint is a superset of the other, so they are complementary rather than alternatives. Only the timeline reports ``cross-referenced``, ``committed`` and ``reviewed`` entries. Only the events endpoint reliably reports ``referenced`` entries, where a commit elsewhere in the repository mentions the issue; the timeline omits many of these, substituting the issue's own ``committed`` entries instead.
|
|
364
|
+
|
|
365
|
+
Note that timeline entries are not all the same shape as events. ``cross-referenced`` and ``committed`` entries have no ``id`` field, so anything consuming ``timeline_data`` should not assume one is present. ``commented`` entries are excluded from the backup because they embed the full comment body, which ``--issue-comments`` already saves.
|
|
366
|
+
|
|
367
|
+
``--issue-timeline`` is included in ``--all``. On issues with many cross-references it can be noticeably larger and slower than ``--issue-events`` alone, because each ``cross-referenced`` entry embeds the referencing issue in full. On a heavily cross-referenced issue this can mean several times the API requests and many times the JSON on disk. Ordinary repositories see little difference.
|
|
368
|
+
|
|
369
|
+
Incremental backups need extra help here, because being referenced from elsewhere does not change an issue's ``updated_at``. An issue can be mentioned from another repository years after its last activity, and the usual ``since`` listing will never report it as changed. On an incremental run with ``--issue-timeline``, github-backup therefore asks GitHub's GraphQL API for each item's cross-reference count and newest timestamp, compares those against what is already saved, and re-fetches the timeline of anything that differs. Pull requests are included in that check when they are being stored as issues, which is the case unless ``--pulls`` is used. The check needs no extra state on disk and also notices references that were later deleted. It costs one rate-limit point per 100 items checked, against GitHub's GraphQL quota, which is separate from the REST one. That is cheap in quota terms even on very large repositories, but it is not instant: a repository with 18,000 issues and pull requests took around 200 points and five minutes for the check alone.
|
|
370
|
+
|
|
371
|
+
If you enable ``--issue-timeline`` on an existing incremental backup, cross-references on older issues are picked up automatically by that check. Timeline entries of other kinds, such as commits and reviews, are only fetched when the issue itself is updated, so run once without ``--incremental`` if you want those filled in for historical issues too.
|
|
372
|
+
|
|
373
|
+
|
|
350
374
|
About pull request reviews
|
|
351
375
|
--------------------------
|
|
352
376
|
|
|
@@ -450,14 +474,14 @@ Quietly and incrementally backup useful Github user data (public and private rep
|
|
|
450
474
|
FINE_ACCESS_TOKEN=SOME-GITHUB-TOKEN
|
|
451
475
|
GH_USER=YOUR-GITHUB-USER
|
|
452
476
|
|
|
453
|
-
github-backup -f $FINE_ACCESS_TOKEN --prefer-ssh -o ~/github-backup/ -l error -P -i --all-starred --starred --watched --followers --following --issues --issue-comments --issue-events --pulls --pull-comments --pull-reviews --pull-commits --labels --milestones --security-advisories --discussions --repositories --wikis --releases --assets --attachments --pull-details --gists --starred-gists $GH_USER
|
|
477
|
+
github-backup -f $FINE_ACCESS_TOKEN --prefer-ssh -o ~/github-backup/ -l error -P -i --all-starred --starred --watched --followers --following --issues --issue-comments --issue-events --issue-timeline --pulls --pull-comments --pull-reviews --pull-commits --labels --milestones --security-advisories --discussions --repositories --wikis --releases --assets --attachments --pull-details --gists --starred-gists $GH_USER
|
|
454
478
|
|
|
455
479
|
Debug an error/block or incomplete backup into a temporary directory. Omit "incremental" to fill a previous incomplete backup. ::
|
|
456
480
|
|
|
457
481
|
FINE_ACCESS_TOKEN=SOME-GITHUB-TOKEN
|
|
458
482
|
GH_USER=YOUR-GITHUB-USER
|
|
459
483
|
|
|
460
|
-
github-backup -f $FINE_ACCESS_TOKEN -o /tmp/github-backup/ -l debug -P --all-starred --starred --watched --followers --following --issues --issue-comments --issue-events --pulls --pull-comments --pull-reviews --pull-commits --labels --milestones --discussions --repositories --wikis --releases --assets --pull-details --gists --starred-gists $GH_USER
|
|
484
|
+
github-backup -f $FINE_ACCESS_TOKEN -o /tmp/github-backup/ -l debug -P --all-starred --starred --watched --followers --following --issues --issue-comments --issue-events --issue-timeline --pulls --pull-comments --pull-reviews --pull-commits --labels --milestones --discussions --repositories --wikis --releases --assets --pull-details --gists --starred-gists $GH_USER
|
|
461
485
|
|
|
462
486
|
Pipe a token from stdin to avoid storing it in environment variables or command history (Unix-like systems only)::
|
|
463
487
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.65.0"
|