Gitea forge: labels.map is not a function crash in Tower overview
Summary
Tower overview returns HTTP 500 when the forge provider is gitea. The root cause is parseLabelDefaults() in
lib/github.js calling labels.map() on a null/empty-string value.
Forgejo/Gitea issues that have no labels return labels: "" (or null from the API), but parseLabelDefaults()
assumes labels is always an Array<{name: string}> (the GitHub format).
Reproduction
codev init or codev adopt with forge.provider: "gitea" pointing at a Forgejo instance
- Create at least one issue on the repo (no labels)
- Open Tower → Work tab
- Result:
Failed to load overview: Failed to fetch overview: 500
- Server-side error:
{"error":"labels.map is not a function"}
Possible Fix
One-line guard in parseLabelDefaults() (lib/github.ts):
export function parseLabelDefaults(labels, title) {
- const names = labels.map(l => l.name);
+ const names = (labels || []).map(l => l.name);
Affected version
`v3.0.3`
Gitea forge:
labels.map is not a functioncrash in Tower overviewSummary
Tower overview returns HTTP 500 when the forge provider is
gitea. The root cause isparseLabelDefaults()inlib/github.jscallinglabels.map()on anull/empty-string value.Forgejo/Gitea issues that have no labels return
labels: ""(ornullfrom the API), butparseLabelDefaults()assumes
labelsis always anArray<{name: string}>(the GitHub format).Reproduction
codev initorcodev adoptwithforge.provider: "gitea"pointing at a Forgejo instanceFailed to load overview: Failed to fetch overview: 500{"error":"labels.map is not a function"}Possible Fix
One-line guard in
parseLabelDefaults()(lib/github.ts):export function parseLabelDefaults(labels, title) { - const names = labels.map(l => l.name); + const names = (labels || []).map(l => l.name); Affected version `v3.0.3`