fix(forgejo-opencode-review): handle empty pagination responses #77

Merged
martin merged 1 commit from fix/forgejo-review-pagination into main 2026-11-08 20:06:03 +00:00
Owner

Summary

  • Stop changed-file pagination after a short page.
  • Treat only HTTP 200 null responses as empty pages for compatibility with Forgejo; preserve all other API and parsing errors.
  • Extract a plugin-local filename loader, add six regression tests, and document the workaround.

Context

Fixes the changed-file collection failure observed in https://ci.martials.no/repos/7/pipeline/169. Forgejo returns six files on page 1 and null on page 2, while its contract declares an array. The workaround does not change my-clients or generated code.

Validation

  • cargo test --locked -p forgejo-opencode-review: 20 tests passed.
  • just test: all workspace tests passed.
  • just lint: passed.
  • just build: passed.
  • cargo fmt --all -- --check: passed.
  • git diff --check: passed.

Follow-up

Image release and deployment remain tracked in #76. The plugin version and dependencies are unchanged; this PR has not built/released an OCI image or modified the consuming global workflow.

## Summary - Stop changed-file pagination after a short page. - Treat only HTTP 200 `null` responses as empty pages for compatibility with Forgejo; preserve all other API and parsing errors. - Extract a plugin-local filename loader, add six regression tests, and document the workaround. ## Context Fixes the changed-file collection failure observed in https://ci.martials.no/repos/7/pipeline/169. Forgejo returns six files on page 1 and `null` on page 2, while its contract declares an array. The workaround does not change my-clients or generated code. ## Validation - `cargo test --locked -p forgejo-opencode-review`: 20 tests passed. - `just test`: all workspace tests passed. - `just lint`: passed. - `just build`: passed. - `cargo fmt --all -- --check`: passed. - `git diff --check`: passed. ## Follow-up Image release and deployment remain tracked in #76. The plugin version and dependencies are unchanged; this PR has not built/released an OCI image or modified the consuming global workflow.
fix(forgejo-opencode-review): handle empty pagination responses
Some checks failed
ci/woodpecker/pr/pr-review Pipeline failed
ci/woodpecker/pr/global-rust-verify Pipeline was successful
f48383ae97
Stop after short pages and accept Forgejo's HTTP 200 null response as an empty page without suppressing other API or parse errors. Add pagination regression coverage and document the compatibility workaround.

Co-authored-by: OpenCode <opencode@anoma.ly>
martin merged commit 4407d49fb3 into main 2026-11-08 20:06:03 +00:00
martin deleted branch fix/forgejo-review-pagination 2026-11-08 20:06:03 +00:00
Author
Owner

Context

The upstream report https://codeberg.org/forgejo/forgejo/issues/14982 describes this exact failure: the changed-files endpoint returns HTTP 200 null for out-of-range pages. The report traces it to the Forgejo 17.0.0 refactor replacing an initialized empty slice with a nil slice; it proposes restoring slice initialization so empty pages serialize as []. The ticket is currently open.

This supports keeping the contract and generated client array type unchanged. Our plugin-local workaround accepts both [] and the buggy null, so it remains compatible when Forgejo fixes its server response.

## Context The upstream report https://codeberg.org/forgejo/forgejo/issues/14982 describes this exact failure: the changed-files endpoint returns HTTP 200 `null` for out-of-range pages. The report traces it to the Forgejo 17.0.0 refactor replacing an initialized empty slice with a nil slice; it proposes restoring slice initialization so empty pages serialize as `[]`. The ticket is currently open. This supports keeping the contract and generated client array type unchanged. Our plugin-local workaround accepts both `[]` and the buggy `null`, so it remains compatible when Forgejo fixes its server response.
Sign in to join this conversation.
No reviewers
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.

Reference
Personal/woodpecker-plugins!77
No description provided.