Gitea forge: issue/PR field names not normalized - Tower shows #undefined, NaNd
Summary
After locally patching the labels.map crash (issue #749), Tower overview loads but displays #undefined for every
issue number and NaNd for every age. The gitea preset scripts (issue-list.sh, pr-list.sh, recently-closed.sh,
recently-merged.sh) pipe raw tea --output json to the overview, but tea uses different field names than the
overview expects (which assumes GitHub's format).
Field mismatches
| Overview expects (GitHub) |
tea returns (Gitea) |
number (int) |
index (string) |
createdAt |
created |
closedAt |
not present (only updated) |
mergedAt |
not present (only updated) |
author: {login: "..."} |
author: "..." (flat string) |
labels: [{name: "..."}] |
labels: "" or CSV string |
assignees: [{login: "..."}] |
assignees: "" or CSV string |
body |
not in default fields |
url |
not in default fields |
Reproduction
forge.provider: "gitea" in .codev/config.json
- Repo has open issues on the Forgejo instance
- Open Tower → Work tab
- Result: every backlog item shows
#undefined, type defaults to project, age shows NaNd
Suggested fix
Each gitea preset script should request the full field set via tea --fields ... and pipe through jq to normalize
to the GitHub-compatible shape the overview expects. For example, issue-list.sh:
tea issues list --limit 200 \
--fields index,title,state,author,url,created,labels,assignees \
--output json | \
jq '[.[] | {
number: (.index | tonumber),
title, state, url,
createdAt: .created,
author: {login: .author},
labels: (if .labels == "" then []
else (.labels | split(",") | map({name: ltrimstr(" ")})) end),
assignees: (if .assignees == "" then []
else (.assignees | split(",") | map({login: ltrimstr(" ")})) end)
}]'
Same pattern needed for pr-list.sh, recently-closed.sh (map updated → closedAt), and recently-merged.sh (map updated →
mergedAt, filter state == "merged").
Affected scripts
- scripts/forge/gitea/issue-list.sh
- scripts/forge/gitea/pr-list.sh
- scripts/forge/gitea/recently-closed.sh
- scripts/forge/gitea/recently-merged.sh
Affected version: v3.0.3
Gitea forge: issue/PR field names not normalized - Tower shows
#undefined,NaNdSummary
After locally patching the
labels.mapcrash (issue #749), Tower overview loads but displays#undefinedfor everyissue number and
NaNdfor every age. The gitea preset scripts (issue-list.sh,pr-list.sh,recently-closed.sh,recently-merged.sh) pipe rawtea --output jsonto the overview, butteauses different field names than theoverview expects (which assumes GitHub's format).
Field mismatches
teareturns (Gitea)number(int)index(string)createdAtcreatedclosedAtupdated)mergedAtupdated)author: {login: "..."}author: "..."(flat string)labels: [{name: "..."}]labels: ""or CSV stringassignees: [{login: "..."}]assignees: ""or CSV stringbodyurlReproduction
forge.provider: "gitea"in.codev/config.json#undefined, type defaults toproject, age showsNaNdSuggested fix
Each gitea preset script should request the full field set via
tea --fields ...and pipe throughjqto normalizeto the GitHub-compatible shape the overview expects. For example,
issue-list.sh: