Add --id flag to bd list for filtering by specific issue IDs
- Add --id flag accepting comma-separated IDs - Implements ID filtering at CLI, RPC, and storage layers - Normalizes IDs (trim, dedupe, remove empty) like labels - Guards against excessive ID lists (max 1000) - Works with other filters (status, priority, etc.) Closes bd-200 Amp-Thread-ID: https://ampcode.com/threads/T-377464f2-1e7f-46f9-b23e-1e3cfd611061 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -1705,6 +1705,16 @@ func (s *SQLiteStorage) SearchIssues(ctx context.Context, query string, filter t
|
||||
whereClauses = append(whereClauses, fmt.Sprintf("id IN (SELECT issue_id FROM labels WHERE label IN (%s))", strings.Join(placeholders, ", ")))
|
||||
}
|
||||
|
||||
// ID filtering: match specific issue IDs
|
||||
if len(filter.IDs) > 0 {
|
||||
placeholders := make([]string, len(filter.IDs))
|
||||
for i, id := range filter.IDs {
|
||||
placeholders[i] = "?"
|
||||
args = append(args, id)
|
||||
}
|
||||
whereClauses = append(whereClauses, fmt.Sprintf("id IN (%s)", strings.Join(placeholders, ", ")))
|
||||
}
|
||||
|
||||
whereSQL := ""
|
||||
if len(whereClauses) > 0 {
|
||||
whereSQL = "WHERE " + strings.Join(whereClauses, " AND ")
|
||||
|
||||
Reference in New Issue
Block a user