fix(forgejo): read per-entry commit status from status field #404
No reviewers
Labels
No labels
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli!404
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/forgejo-commit-status-field"
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
./iw phase-mergecrashes withFailed to parse Forgejo commit status response: key not found: stateon every Forgejo PR that has CI checks.Root cause
ForgejoClient.parseCommitStatusResponse(core/adapters/ForgejoClient.scala) read each per-entry status vias("state"), but Forgejo's per-entry objects (CommitStatus) name that fieldstatus— only the top-level combined object (CombinedStatus) usesstate. Every real per-entry object therefore crashes withkey not found: state.Fix
s("status")."statuses": null(Forgejo returns this for an unknown SHA) asRight(Nil), alongside the existing empty-array case.Tests
The prior unit-test fixtures passed only because they encoded the same wrong shape (
stateper entry) and were never checked against a real Forgejo response. Corrected all fixtures to the real Forgejo shape (per-entrystatus) — which reproduced the exact production error — and added a null-statuses test. Fullcore.testsuite green;-Werrorcompile clean.🤖 Generated with Claude Code
statusfield`parseCommitStatusResponse` read each per-entry status via `s("state")`, but Forgejo's per-entry objects (CommitStatus) name that field `status` — only the top-level combined object (CombinedStatus) uses `state`. Every real per-entry object crashed with `key not found: state`, breaking `phase-merge` on any Forgejo PR with CI checks. Also handle `"statuses": null` (returned for an unknown SHA) as Right(Nil) alongside the existing empty-array case. The prior unit-test fixtures passed only because they encoded the same wrong shape (`state` per entry); corrected them to the real Forgejo response and added a null-statuses test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>