feat: add --unassigned flag to bd ready command
Adds the ability to filter ready work for issues with no assignee, which is useful for the SCAVENGE protocol in Gas Town where polecats need to query the "Salvage Yard" for unclaimed work. Changes: - Add Unassigned bool field to types.WorkFilter - Add --unassigned/-u flag to bd ready command - Update SQL query in GetReadyWork to filter for NULL/empty assignee - Add Unassigned field to RPC ReadyArgs for daemon support - Add tests for the new functionality Closes: gt-3rp 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -183,6 +183,35 @@ func TestReadySuite(t *testing.T) {
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("ReadyWorkUnassigned", func(t *testing.T) {
|
||||
// Test filtering for unassigned issues
|
||||
readyUnassigned, err := s.GetReadyWork(ctx, types.WorkFilter{
|
||||
Unassigned: true,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("GetReadyWork with unassigned filter failed: %v", err)
|
||||
}
|
||||
|
||||
// All returned issues should have no assignee
|
||||
for _, issue := range readyUnassigned {
|
||||
if issue.Assignee != "" {
|
||||
t.Errorf("Expected empty assignee, got %q for issue %s", issue.Assignee, issue.ID)
|
||||
}
|
||||
}
|
||||
|
||||
// Should include test-unassigned from previous test
|
||||
found := false
|
||||
for _, issue := range readyUnassigned {
|
||||
if issue.ID == "test-unassigned" {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
t.Error("Expected to find test-unassigned in unassigned results")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("ReadyWorkInProgress", func(t *testing.T) {
|
||||
// Create in-progress issue (should be in ready work)
|
||||
issue := &types.Issue{
|
||||
|
||||
Reference in New Issue
Block a user