fix(reports): correct workflow ID and add PR pagination#679
Conversation
…eports - build-metrics.mjs: replace disabled workflow 141567601 (Bluefin LTS HWE DX) with active replacement 141569417 (Bluefin DX LTS HWE) which has been running successfully throughout March 2026 - graphql-queries.mjs: split combined REPO_CLOSED_ITEMS_QUERY into separate REPO_CLOSED_ISSUES_QUERY and REPO_MERGED_PRS_QUERY to allow independent pagination; add hasNextPage loops so repos with >100 PRs in a month are not silently truncated Assisted-by: Claude Sonnet 4.6 via OpenCode
There was a problem hiding this comment.
Code Review
This pull request updates a workflow ID and refactors the GraphQL data fetching logic to implement independent pagination for closed issues and merged pull requests, preventing silent data truncation. Feedback was provided regarding a potential breaking change where the REPO_CLOSED_ITEMS_QUERY constant now only retrieves issues, which may cause data loss for external consumers who previously relied on it for both issues and pull requests.
| `; | ||
|
|
||
| // Keep for backward compatibility with any external consumers | ||
| const REPO_CLOSED_ITEMS_QUERY = REPO_CLOSED_ISSUES_QUERY; |
There was a problem hiding this comment.
The line const REPO_CLOSED_ITEMS_QUERY = REPO_CLOSED_ISSUES_QUERY; redefines the REPO_CLOSED_ITEMS_QUERY constant to now only represent the query for closed issues. Previously, this constant was implicitly used to fetch both closed issues and merged pull requests. While the fetchClosedItemsFromRepo function now correctly handles both via separate paginated queries, direct consumers who import and use REPO_CLOSED_ITEMS_QUERY for GraphQL calls will now only retrieve issues, potentially leading to silent data loss for PRs. This constitutes a breaking change for such direct consumers. Consider explicitly deprecating REPO_CLOSED_ITEMS_QUERY or renaming it to REPO_CLOSED_ISSUES_QUERY_LEGACY to clearly indicate its changed scope, and guide users to fetchClosedItemsFromRepo for combined data or the new specific query constants.
- Remove REPO_CLOSED_ITEMS_QUERY alias: the constant had zero import consumers (all three callers use fetchClosedItemsFromRepo), so the backward-compat comment was inaccurate. Full removal is cleaner than a rename; a ReferenceError on import is preferable to a silently issues-only constant. - Remove early-exit block from PR pagination loop: the query orders by UPDATED_AT DESC but the exit condition checked mergedAt, which is not the sort key. A PR merged inside the window but with an old updatedAt can appear on a later page; the exit firing on page 1 would silently skip it. The loop now terminates correctly on pageInfo.hasNextPage. Fixes: #12, #13 Reviewed-by: Principal SE (claude-sonnet-4.6) + Doublecheck (gpt-5.3-codex) Assisted-by: Claude Sonnet 4.6 via OpenCode Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Random fixes I want to get in before the next automated report.
Assisted-by: Claude Sonnet 4.6 via OpenCode