Skip to content

Conversation

@MisRob
Copy link
Member

@MisRob MisRob commented Jan 16, 2026

Summary

  • In notification messages in our support Slack channel, there's information on currently assigned issues and open PRs by an author - this is used to make better informed issue assignments. For it to be helpful, it needs to fetch issues and PRs from all repos where we accept contributions - this PR achieves that (previously, it only provided info on a repo from which the notification was sent).
  • Also updates the list of close contributors.

Disclosure: I was assisted by copilot - reviewed and adjusted all changes.

Reviewer guidance

Code review should be sufficient. I tested that it works as expected in my test organization and Slack, and after merging we can observe in production.

We need the snippet to show information about
issues and PRs from all repositories in which
we typically accept contributions.
@MisRob MisRob requested review from ozer550 and rtibbles January 16, 2026 13:23
Copy link
Member

@ozer550 ozer550 left a comment

Choose a reason for hiding this comment

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

The code seems fine, just one question regarding pagination!

scripts/utils.js Outdated
async function hasLabel(name, owner, repo, issueNumber, github, core) {
let labels = [];
try {
const response = await github.rest.issues.listLabelsOnIssue({
Copy link
Member

Choose a reason for hiding this comment

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

Just one question here the data received is it paginated? Do we get all the issues in one go?

Copy link
Member Author

Choose a reason for hiding this comment

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

Do we get all the issues in one go?

We're fetching only one issue here - by the issue number.

Copy link
Member Author

Choose a reason for hiding this comment

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

As for labels, I will look into it

scripts/utils.js Outdated
async function getIssues(assignee, state, owner, repos, github, core) {
const promises = repos.map(repo =>
github.rest.issues
.listForRepo({
Copy link
Member

Choose a reason for hiding this comment

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

Same for this and getPullRequests function as well? If we are getting a limited amount of issues in one pass then its not whats expected right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I will have a look

@MisRob
Copy link
Member Author

MisRob commented Jan 21, 2026

Thank you @ozer550 for good feedback - I pushed updates.

It's based on

All endpoint methods starting with .list* do not return all results at once but instead return the first 30 items by default, see also GitHub’s REST API pagination documentation.

To automatically receive all results across all pages, you can use the octokit.paginate() method

https://octokit.github.io/rest.js/v20/#pagination

Also tested real quickly in my environment and haven't noticed any issues.

@MisRob MisRob requested a review from ozer550 January 21, 2026 10:49
Copy link
Member

@ozer550 ozer550 left a comment

Choose a reason for hiding this comment

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

Changes look good to me!

@MisRob MisRob merged commit 0118bd8 into learningequality:main Jan 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants