feat(ready): add --type flag for filtering by issue type (gt-ktf3)
Enables bd ready --type=merge-request for MQ integration. The Engineer can now query for ready merge-requests. Files changed: - cmd/bd/ready.go: Add -t/--type flag - internal/types/types.go: Add Type field to WorkFilter - internal/rpc/protocol.go: Add Type to ReadyArgs - internal/storage/sqlite/ready.go: Filter by issue_type column
This commit is contained in:
@@ -214,6 +214,7 @@ type ReadyArgs struct {
|
||||
Assignee string `json:"assignee,omitempty"`
|
||||
Unassigned bool `json:"unassigned,omitempty"`
|
||||
Priority *int `json:"priority,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Limit int `json:"limit,omitempty"`
|
||||
SortPolicy string `json:"sort_policy,omitempty"`
|
||||
Labels []string `json:"labels,omitempty"`
|
||||
|
||||
@@ -27,6 +27,12 @@ func (s *SQLiteStorage) GetReadyWork(ctx context.Context, filter types.WorkFilte
|
||||
args = append(args, filter.Status)
|
||||
}
|
||||
|
||||
// Filter by issue type (gt-ktf3: MQ integration)
|
||||
if filter.Type != "" {
|
||||
whereClauses = append(whereClauses, "i.issue_type = ?")
|
||||
args = append(args, filter.Type)
|
||||
}
|
||||
|
||||
if filter.Priority != nil {
|
||||
whereClauses = append(whereClauses, "i.priority = ?")
|
||||
args = append(args, *filter.Priority)
|
||||
|
||||
@@ -478,6 +478,7 @@ func (s SortPolicy) IsValid() bool {
|
||||
// WorkFilter is used to filter ready work queries
|
||||
type WorkFilter struct {
|
||||
Status Status
|
||||
Type string // Filter by issue type (task, bug, feature, epic, merge-request, etc.)
|
||||
Priority *int
|
||||
Assignee *string
|
||||
Unassigned bool // Filter for issues with no assignee
|
||||
|
||||
Reference in New Issue
Block a user