Context
Surfaced during review of #776.
discussions.get_discussions fetches discussion comments with comments(first: 100) and does not paginate that sub-list (only the outer search connection is paginated). count_comments_per_user then evaluates up to max_comments_to_eval of those nodes.
Problem
MAX_COMMENTS_EVAL (config, default "20") has no upper-bound validation. If an operator sets it above 100, the discussion mentor-counting branch can never see more than the 100 comment nodes GraphQL returned. It silently stops, with no error or warning.
This diverges from the issue and pull-request branches, where issue.get_comments() / pull_request.get_reviews() are PyGithub PaginatedLists that keep fetching until max_comments_to_eval is satisfied.
For the default value (20 < 100) this is harmless, which is why it is documented inline rather than fixed in #776.
Proposed fix
Add cursor-based pagination to the comments sub-list in get_discussions (page until hasNextPage is false or MAX_COMMENTS_EVAL nodes are collected), so discussions behave consistently with issues and PRs.
References
Context
Surfaced during review of #776.
discussions.get_discussionsfetches discussion comments withcomments(first: 100)and does not paginate that sub-list (only the outersearchconnection is paginated).count_comments_per_userthen evaluates up tomax_comments_to_evalof those nodes.Problem
MAX_COMMENTS_EVAL(config, default"20") has no upper-bound validation. If an operator sets it above 100, the discussion mentor-counting branch can never see more than the 100 comment nodes GraphQL returned. It silently stops, with no error or warning.This diverges from the issue and pull-request branches, where
issue.get_comments()/pull_request.get_reviews()are PyGithubPaginatedLists that keep fetching untilmax_comments_to_evalis satisfied.For the default value (20 < 100) this is harmless, which is why it is documented inline rather than fixed in #776.
Proposed fix
Add cursor-based pagination to the
commentssub-list inget_discussions(page untilhasNextPageis false orMAX_COMMENTS_EVALnodes are collected), so discussions behave consistently with issues and PRs.References
discussions.py, abovecomments(first: 100))