Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was having two issues with
gh-issue-mover
:This PR fixes both issues.
The reason only 30 comments were getting migrated was because comments weren’t being paginated; now they are.
After I got that fixed, I noticed that an exception would always be thrown after exactly 35 comments, which currently happens on Google’s Issue Mover. This was because 35 comments within a short period was triggering GitHub’s abuse detection API. To compensate for this, I space out the posts by a second each, and wait a minute after each 403 returned from GitHub (the status code for the abuse rate limit).
I’m also using a regular
for
loop, rather than.map
, to loop through the comments to add them to the new issue. This preserves the order by ensuring they’re posted sequentially, because we wait for each comment to finish posting before starting to post the next one.Finally, I changed the formatting of the comment header to more closely resemble Google’s, but with keeping the link back to the source comment and using locale-agnostic date formatting (that’s not too verbose).