Make the github migration less rate limit waiting to get comment per page from repository but not per issue #16070

Merged
lunny merged 7 commits from lunny/faster_get_comment_from_github into main 2021-06-30 07:23:49 +00:00
Owner

Since most issue/pr's comments are less than 100 but github rate limit is via request times. So if every time we can get 100 comments, we will request less.

This PR we use another github API to not send issue/pr's index to get comments but just get repository's comments.

Since most issue/pr's comments are less than 100 but github rate limit is via request times. So if every time we can get 100 comments, we will request less. This PR we use another github API to not send issue/pr's index to get comments but just get repository's comments.
zeripath reviewed 2021-06-06 10:01:49 +00:00
Contributor

This is kinda at odds with the rest of this interface whereby if something is not supported it usually returns an ErrNotSupported.

It would probably be more consistent to provide a GetAllComments function instead that most migrators would ErrNotSupport and if so we fallback to GetComments(issueNumber) and GetAllComments which Github would support that would mean we could do the all comments route instead. Otherwise this is kinda inconsistent.

This is kinda at odds with the rest of this interface whereby if something is not supported it usually returns an ErrNotSupported. It would probably be more consistent to provide a GetAllComments function instead that most migrators would ErrNotSupport and if so we fallback to GetComments(issueNumber) and GetAllComments which Github would support that would mean we could do the all comments route instead. Otherwise this is kinda inconsistent.
lunny reviewed 2021-06-06 11:32:16 +00:00
Author
Owner

The GetAllComments have to invoke after GetIssues and GetPullRequests. But GetComment should be invoked after every issue or pull request. So we cannot try GetAllComments at first.

The `GetAllComments` have to invoke after `GetIssues` and `GetPullRequests`. But `GetComment` should be invoked after every issue or pull request. So we cannot try `GetAllComments` at first.
zeripath approved these changes 2021-06-29 21:17:16 +00:00
zeripath left a comment
Contributor

not sure about this API but it seems to work

not sure about this API but it seems to work
KN4CK3R (Migrated from github.com) approved these changes 2021-06-30 06:29:30 +00:00
This repo is archived. You cannot comment on pull requests.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lunny/gitea#16070
No description provided.