Skip to content

feat(forge): checks pagination & accurate totals#117

Merged
actionshrimp merged 2 commits intomainfrom
feature/checks-pagination
Feb 24, 2026
Merged

feat(forge): checks pagination & accurate totals#117
actionshrimp merged 2 commits intomainfrom
feature/checks-pagination

Conversation

@actionshrimp
Copy link
Owner

Summary

  • List queries (pr_list, pr_search): Add totalCount to the contexts connection so summary badges show accurate totals even when GitHub truncates at 100 nodes. When rollup state is SUCCESS, infer all checks passed without needing every node.
  • Detail query (pr_detail): Add pageInfo { hasNextPage endCursor } and a new pr_checks_page query for cursor-based pagination. pr.get() now recursively fetches remaining pages and merges them via merge_checks_into_summary(). Pagination errors are non-fatal.

Test plan

  • 16 new unit tests covering totalCount inference, parse_checks_page(), merge_checks_into_summary(), pagination page_info return, and query string validation
  • 2 new fixtures: pr_detail_paginated_checks.json, pr_checks_page.json
  • All 1571 unit tests pass
  • All 631 e2e tests pass
  • make lint passes

…y badges

GitHub's GraphQL API caps connection fields at first:100. For repos
with 100+ CI checks, the success/total counts in compact badges were
wrong. Add totalCount to pr_list and pr_search queries and use it in
parse_checks_summary when nodes are truncated. When rollup state is
SUCCESS and totalCount > counted nodes, infer all checks passed.
For repos with 100+ CI checks, the pr_detail query now includes
pageInfo and totalCount on the contexts connection. When hasNextPage
is true, pr.get() recursively fetches remaining pages using a new
pr_checks_page query and merges them into the checks_summary via
merge_checks_into_summary(). Pagination errors are non-fatal — the
PR is returned with whatever checks were fetched.
@actionshrimp actionshrimp merged commit 8128c63 into main Feb 24, 2026
5 of 6 checks passed
@actionshrimp actionshrimp deleted the feature/checks-pagination branch February 24, 2026 11:32
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.

1 participant