executablebooks / github-activity

Simple markdown changelogs for GitHub repositories
https://github-activity.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
47 stars 11 forks source link

Backfill / bootstrap an initial changelog #57

Closed jtpio closed 2 years ago

jtpio commented 3 years ago

Is your feature request related to a problem? Please describe.

It would be nice for repos that want to adopt github-activity to be able to automatically backfill a changelog file.

Describe the solution you'd like

Maybe an --all flag could make this convenient, something like this:

github-activity org/repo --auth <github-token> --since 1970-01-01 --branch main --all

Describe alternatives you've considered

An alternative could be to write a small wrapper around github-activity that would fetch all tags, and call github-activity sequentially.

Or do that by hand if it's just a couple of releases to backfill.

Additional context

choldgraf commented 3 years ago

That's a cool idea - I wonder how many lines of code it'd take to do this...if it weren't that many, perhaps one solution would simply be to document this pattern so that others could follow, since this would presumably be a one-time action per project.

jtpio commented 3 years ago

Right it would be a one time action only, so a small snippet would be enough.

For the simple case of having only one release branch, the script could loop through all the tags and then call github-activity with --since and --until.

jtpio commented 3 years ago

For the simple case of having only one release branch, the script could loop through all the tags and then call github-activity with --since and --until.

Just tried this approach with a manually exported list of tags, and getting a rate limit error rather quickly:

requests.exceptions.HTTPError: 403 Client Error: rate limit exceeded for url
jtpio commented 3 years ago

getting a rate limit error

Which is strange since the quota looks good (and also expecting a 429 instead of 403) when checking with:

$ curl -I -H "Authorization: token <token>" https://api.github.com/repos/executablebooks/github-activity/commits/v0.1.1
...
x-oauth-scopes: public_repo
x-accepted-oauth-scopes:
x-github-media-type: github.v3; format=json
x-ratelimit-limit: 5000
x-ratelimit-remaining: 4967
x-ratelimit-reset: 1624439267
x-ratelimit-used: 33
jtpio commented 3 years ago

getting a rate limit error

Ah this is actually related to https://github.com/executablebooks/github-activity/issues/46

blink1073 commented 2 years ago

Here's a script I wrote to bootstrap a couple repos. I like @jtip's idea of having an --all flag on the CLI, happy to contribute that. (Requires #60)