Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pr: Do not exceed GitHub comment mention limit #8

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chrstphrchvz
Copy link

Fixes: https://trac.macports.org/ticket/63821

I’ve not used Go before. Untested; I’m not sure I could test this any sooner than someone more familiar with the PR bot.

pr/webhook/pull_request.go Outdated Show resolved Hide resolved
err = receiver.githubClient.CreateComment(owner, repo, number, &body)
if err != nil {
log.Println(err)
i++
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add more spacing around this (add an empty line both above and below it) and maybe add comments about how i works.

Copy link
Author

@chrstphrchvz chrstphrchvz Nov 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added comments to try explaining how the counter i is used to split handles into batches of ≤50. But maybe what I am after is a more idiomatic way of splitting handles into batches of 50, and then using a nested loop over each handle in each batch, obviating the need for a counter.

@chrstphrchvz
Copy link
Author

The created GitHub comments should now also indicate which batch they are for, e.g.:

Notifying maintainers (batch 1 of 1):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants