Skip to content

lerna-changelog making a request to github api for each PR #608

@issammani

Description

@issammani

We have been using lerna-changelog internally at work to keep our changelog up to date. What we have noticed lately is that the github api rate limit is being exceeded.

Some metrics:

  • Github API rate limit: 5000 api calls
  • Number of PRs: ~300 PRs
  • Number of API calls lerna-changelog makes per run: ~500 api calls

If we run the changelog generation process more than 9 times within an hour we exceed the limit. This is due to the fact, that the code is making an api call (fetch) for each PR.

private async downloadIssueData(commitInfos: CommitInfo[]) {
progressBar.init("Downloading issue information…", commitInfos.length);
await pMap(
commitInfos,
async (commitInfo: CommitInfo) => {
if (commitInfo.issueNumber) {
commitInfo.githubIssue = await this.github.getIssueData(this.config.repo, commitInfo.issueNumber);
}
progressBar.tick();
},
{ concurrency: 5 }
);
progressBar.terminate();
}

I couldn't find anything related to this in the docs. Is this the expected behaviour ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions