fix(ploeg): read every page of Forgejo pull requests and GitLab checks #150

Merged
ryangr0 merged 1 commit from ryangr0/ploeg-forge-pagination into development 2026-10-03 00:24:47 +00:00 AGit
Owner

The worker asked Forgejo for one page of 50 open pull requests, so a
Run's pull request beyond the first page looked absent: a writer could
open a duplicate and a successful Run could be recorded as no change.
The GitLab provider read one page of 100 commit statuses, so a failed or
pending check on page two was reported as a successful commit, although
CommitStatusReader promises the combined state of every check.

The Forgejo lookup now pages until it finds the Run's pull request or
has seen every open one, using X-Total-Count when the forge sends it and
a short or empty page otherwise. It stops at 20 pages and reports an
error rather than a missing pull request. GitLab commit status follows
X-Next-Page (or a full page when the header is absent) up to 50 pages,
keeps the newest status per check name, and fails the whole read when
any page fails, so a partial read never becomes a success.

Forgejo has no head-branch filter on the list endpoint, so the lookup pages (X-Total-Count or short page ends it, cap 20 pages = error). Known gap: worker.go still logs a lookup error and carries on with no PR URL; making that an infra/stuck outcome belongs to VIK-1732.

Verified with mise run verify on the pinned toolchain (all gates passed).

Ticket: https://vikunja.webgrip.dev/tasks/1752

🤖 Generated with Claude Code

The worker asked Forgejo for one page of 50 open pull requests, so a Run's pull request beyond the first page looked absent: a writer could open a duplicate and a successful Run could be recorded as no change. The GitLab provider read one page of 100 commit statuses, so a failed or pending check on page two was reported as a successful commit, although CommitStatusReader promises the combined state of every check. The Forgejo lookup now pages until it finds the Run's pull request or has seen every open one, using X-Total-Count when the forge sends it and a short or empty page otherwise. It stops at 20 pages and reports an error rather than a missing pull request. GitLab commit status follows X-Next-Page (or a full page when the header is absent) up to 50 pages, keeps the newest status per check name, and fails the whole read when any page fails, so a partial read never becomes a success. Forgejo has no head-branch filter on the list endpoint, so the lookup pages (X-Total-Count or short page ends it, cap 20 pages = error). Known gap: worker.go still logs a lookup error and carries on with no PR URL; making that an infra/stuck outcome belongs to VIK-1732. Verified with `mise run verify` on the pinned toolchain (all gates passed). Ticket: https://vikunja.webgrip.dev/tasks/1752 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(ploeg): read every page of Forgejo pull requests and GitLab checks
Some checks failed
[Workflow] On Pull Request / checks (pull_request) Has been cancelled
[Workflow] On Pull Request / warnings (pull_request) Has been cancelled
[Workflow] On Pull Request / release-policy (pull_request) Has been cancelled
1d6e0045e4
The worker asked Forgejo for one page of 50 open pull requests, so a
Run's pull request beyond the first page looked absent: a writer could
open a duplicate and a successful Run could be recorded as no change.
The GitLab provider read one page of 100 commit statuses, so a failed or
pending check on page two was reported as a successful commit, although
CommitStatusReader promises the combined state of every check.

The Forgejo lookup now pages until it finds the Run's pull request or
has seen every open one, using X-Total-Count when the forge sends it and
a short or empty page otherwise. It stops at 20 pages and reports an
error rather than a missing pull request. GitLab commit status follows
X-Next-Page (or a full page when the header is absent) up to 50 pages,
keeps the newest status per check name, and fails the whole read when
any page fails, so a partial read never becomes a success.

VIK-1752

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ryangr0 merged commit 0f7fbad64b into development 2026-10-03 00:24:47 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
webgrip/unfold!150
No description provided.