API: list_columns returns num_issues: null — per-column issue counts not populated
#5
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Context
GET /api/v1/users/{username}/-/projects/{id}/columns(and the org/repo equivalents) returns anum_issuesfield on each column, but the value is alwaysnull.Example response payload for a real column with 8 open issues:
Impact
list_column_issuesN times (once per column) and count locally. For a 5-column board, that's 1 + 5 = 6 round trips instead of 1.Proposed fix
Populate
num_issuesin the column-list response with the count of issues attached to the column. Bonus: also exposenum_open_issues/num_closed_issuesto mirror the shape on the project-list response, which already breaks counts out by state.Workaround
Call
list_column_issuesper column and count client-side.PR up: #6 —
num_issuesis now populated on all three column-list endpoints, plusnum_open_issuesandnum_closed_issuesto mirror the shape ofProject. Implementation isColumnList.LoadIssueCountsinmodels/project/column_list.go: two grouped queries againstproject_issue ⋈ issue(one open, one closed), so a 5-column board takes 2 round trips at the DB level regardless of column count.omitemptywas dropped on these three JSON fields — a column with 0 issues now serializes as0rather than disappearing, which is what callers building "Backlog (20) · Triage (5) · HP (8)" summaries actually want.Not merging yet — the patched Gitea is the same instance hosting this issue.