Repository navigation
Description
Problem
A star command that returns an empty list prints null where the list belongs, at every depth: a result with nothing
in it prints null instead of [], and a record's empty list prints, for example, "home": null instead of
"home": []. In cmd/star/extension/result.go, goSlice starts from var out []any; a list with no elements leaves
it a nil slice, and JSON writes a nil slice as null.
Anything that loops over such a list fails. star github schedule report gives nearly every issue an empty home,
labels, assignees, blocked_by and projects, and a query like
--jq 'map(select(any(.home[]; .schedule == "s1")))' stops at the first of them: jq exits 5, "Cannot iterate over
null". A search or a filter that matches nothing makes --jq '.[]' fail the same way.
Found on 2026-11-08 by tests/Test-StarGitHub in NobleFactor/noblefactor-engprod#436's worktree: its cases for the
report's home and the sweep's lists fail on it, and nothing in the extension can work around it.
Solution, if known
A list is always a list. goSlice starts from an empty slice, make([]any, 0), so that an empty list is [] in every
rendering; a key that holds one value, and holds none, stays null. The owner ruled on 2026-11-08 that star returns an
empty list in place of null everywhere: nothing in a result uses null on a list to mean anything but none. Every star
command's output changes with it, and where an empty list printed null it prints [].
Outstanding questions
- Whether
pkg/op/starlarkbridge's converter, which turns a Starlark list into a Go value for a provider's arguments,
makes the same nil slice of an empty list, and so whether "everywhere" reaches it too. - Whether a rendering other than JSON and YAML relies on an empty list being nil:
csv,value,tableandlist
render an empty input as no bytes today.
Evidence of completion
- A test in
cmd/star/extensionthat fails ifgoSlicereturns nil again: an empty list, and a dict holding one, come
back as[]and{"home": []}. - Run against a star built with the fix, star keeps every Triage project up to date, one for each team or user account noblefactor-engprod#436's
tests/Test-StarGitHubpasses its cases
3e to 8.
Plan and design documents
| Kind | Document |
|---|---|
| Plan | docs/plans/fix/1215-empty-list-not-null.md |
Activity
David-Noble-at-work commentedon Nov 9, 2026
Merged as #1216, 1ae1da7, 2026-11-09: every empty list in a star command's result is
[].feat(star): each account's model, every issue as a record, and the sw…
feat(star): each account's model, every issue as a record, and the tr…