fix: decode Forgejo negative system-actor user ids in pr list/view #231
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pr-decode-negative-user-id"
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?
Problem
fj pr list/fj pr viewfail on any repo where a Forgejo system actor appears as a reviewer, assignee, poster, or author:Forgejo uses negative sentinel user ids for system actors:
-1for Ghost (deleted user) and-2for theforgejo-actionsbot. rasterstate/fj#230 hasforgejo-actionsinrequested_reviewers, so"id":-2is in the pulls payload. The canonicalUsermodel decodedidasu64, so serde rejected the value and the whole list/detail decode failed. This red-lit the releaselive-e2esmoke, which runsfj pr list -R rasterstate/fj --state all.Fix
Change the Forgejo
User.idfield fromu64toi64insrc/api/user.rs. This is the single user shape reused across pulls, issues, reviews, comments, repo owner, requested reviewers, and assignees (it is the only struct in the models with aloginfield), so one change covers every actor field. Non-user ids (repo, PR, review, issue, milestone, label) are left unsigned; Forgejo only uses negatives for user/actor rows.Test
Added
api::user::tests::deserializes_negative_system_actor_id: deserializes{"id":-2,"login":"forgejo-actions"}and asserts the signed id and login decode.Verify
cargo test: 683 passed, 2 ignored, 0 failed (includes the new test).cargo build --release && ./target/release/fj pr list -R rasterstate/fj --state alldecodes cleanly (exit 0), including #230;fj pr view 230 -R rasterstate/fjalso decodes.Operator-merge only.
Forseti review
No blocking findings from the lead reviewer.
No inline findings.
rasterstate/fj#23149bde47abc87sha256:0ca9d499ff5e94d2bcc6d183f51106805a2c0128c58c1c17b231688bb5633a00openai:gpt-5.5+anthropic:claude-haiku-4-5-2025100100GITHUB_TOKENe675d37c9729Forseti review
No blocking findings from the lead reviewer.
No inline findings.
rasterstate/fj#23149bde47abc87sha256:0ca9d499ff5e94d2bcc6d183f51106805a2c0128c58c1c17b231688bb5633a00openai:gpt-5.5+anthropic:claude-haiku-4-5-2025100100GITHUB_TOKENe675d37c9729