Skip to content

fix: paginate complete pull request history - #74

Closed
devrot-ai wants to merge 1 commit into
prooflinedev:mainfrom
devrot-ai:feat/history-pagination
Closed

devrot-ai wants to merge 1 commit into
prooflinedev:mainfrom
devrot-ai:feat/history-pagination

Conversation

@devrot-ai

Copy link
Copy Markdown

Problem

The README says proofline history --repo owner/name --pr 7 reads all recorded runs, but the CLI currently makes one request to the pull-request history endpoint. When that endpoint returns truncated: true, older runs are left behind and the command still prints a successful response that can be mistaken for the complete history.

Change

  • Follow the endpoint's opaque next_cursor until the server reports a complete final page.
  • Request 50 items per page and cap traversal at 100 pages.
  • Reject missing, empty, repeated, malformed or contradictory continuation metadata, and reject a history that still has more pages at the safety limit. The CLI returns a protocol error instead of printing partial history as complete.
  • Preserve the raw page JSON, including server-provided metadata and additional compatible fields, while concatenating items in server order.
  • Document the pagination and failure behavior.

No OpenAPI schema, generated route or mutating API operation is changed.

Verification added

The loopback HTTP integration tests cover:

  • A three-page history, including URL-encoding of an opaque cursor containing / and +.
  • Item ordering and the final truncated: false / next_cursor: null response.
  • A missing cursor, a repeated cursor and the 100-page limit, with no partial JSON written to stdout.
  • The existing repository-name/owner routing behavior and the new page-size query.

The GitHub Actions checks should run on this PR. I have not represented them as passing before the CI results are available.

Copilot AI balanced review requested due to automatic review settings November 21, 2026 07:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@devrot-ai devrot-ai closed this by deleting the head repository Nov 22, 2026
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