fix(list): populate dependencies field in JSON output (bd-tjxh) (#1296)
Previously, `bd list --json` only included dependency_count and dependent_count but not the actual dependency records. This broke callers like `gt hook --json` that need to know what each issue depends on to determine ready steps. Now populates issue.Dependencies using GetAllDependencyRecords, matching the behavior of `bd show --json`. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1189,10 +1189,12 @@ var listCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
labelsMap, _ := store.GetLabelsForIssues(ctx, issueIDs)
|
labelsMap, _ := store.GetLabelsForIssues(ctx, issueIDs)
|
||||||
depCounts, _ := store.GetDependencyCounts(ctx, issueIDs)
|
depCounts, _ := store.GetDependencyCounts(ctx, issueIDs)
|
||||||
|
allDeps, _ := store.GetAllDependencyRecords(ctx)
|
||||||
|
|
||||||
// Populate labels for JSON output
|
// Populate labels and dependencies for JSON output
|
||||||
for _, issue := range issues {
|
for _, issue := range issues {
|
||||||
issue.Labels = labelsMap[issue.ID]
|
issue.Labels = labelsMap[issue.ID]
|
||||||
|
issue.Dependencies = allDeps[issue.ID]
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build response with counts
|
// Build response with counts
|
||||||
|
|||||||
Reference in New Issue
Block a user