Loading
feat(todo): expose group.full_path on todo list --output json
Summary
Group-scoped to-do items (epic mentions, group-level reviews) lose their namespace through the SDK. The gitlab.Todo type doesn't model the group object the REST API returns, so MCP clients can't tell a group-level epic mention from a project issue assignment without a second API call.
This MR:
- Adds a local
Todowrapper that embedsgitlab.Todoby value plus aTodoGroupstruct (mirrors RESTNamespaceBasic). - Routes
listTodosthroughclient.NewRequest/client.Doso the rawgroupkey flows through the wrapper. - Keeps the JSON shape additive: existing fields keep their names, the new
"group"key only appears on group-scoped items.
The wrapper pattern matches existing usage in mr/view (MRWithDiscussions) and issuable/view — same shape, different SDK type.
The wrapper change forced a test rewrite from gomock to httptest, because the new code path lives below the SDK method dispatch and gomock can't intercept it. Replaces table-driven fixture tests; coverage is preserved.
Context
Stack #3 (closed) of 6 split out from the closed MR !3154. Builds on !3254 (merged).
Test plan
-
go test ./internal/commands/todo/...passes. -
glab todo list --output jsonagainst a real account that has group-scoped TODOs surfaces"group": {"full_path": "..."}on those items and omits the field on project-only items.