fix(forgejo-opencode-review): handle empty pagination responses #77
No reviewers
Labels
No labels
plugin/bun2nix
plugin/cargo-build
plugin/cargo-clippy
plugin/cargo-nextest
plugin/cargo-publish
plugin/cargo-verify
plugin/command-suite
plugin/flake-checker
plugin/flake-lock-report
plugin/forgejo-file-sync
plugin/forgejo-opencode-review
plugin/forgejo-pr-merge
plugin/forgejo-release
plugin/new
plugin/nix-build
plugin/nixidy-cli
plugin/nixidy-switch
plugin/nix-unit
plugin/ntfy
plugin/oci-build-push
plugin/oci-copy
plugin/openapi-to-rust
plugin/path-filter
plugin/renovate-config-check
plugin/woodpecker-lint
type
feature
type
task
automerge
bug
dependencies
duplicate
help wanted
invalid
lang
rust
migrations
opencode
question
security
type
documentation
type
enhancement
type
maintenance
type
refactor
vulnerability
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Reference
Personal/woodpecker-plugins!77
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/forgejo-review-pagination"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
nullresponses as empty pages for compatibility with Forgejo; preserve all other API and parsing errors.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
nullon 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.
Context
The upstream report https://codeberg.org/forgejo/forgejo/issues/14982 describes this exact failure: the changed-files endpoint returns HTTP 200
nullfor 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 buggynull, so it remains compatible when Forgejo fixes its server response.