fix(mq): skip closed MRs in list, next, and ready views (#563)
* fix(mq): skip closed MRs in list, next, and ready views (gt-qtb3w) The gt mq list command with --status=open filter was incorrectly displaying CLOSED merge requests as 'ready'. This occurred because bd list --status=open was returning closed issues. Added manual status filtering in three locations: - mq_list.go: Filter closed MRs in all list views - mq_next.go: Skip closed MRs when finding next ready MR - engineer.go: Skip closed MRs in refinery's ready queue Also fixed build error in mail_queue.go where QueueConfig struct (non-pointer) was being compared to nil. Workaround for upstream bd list status filter bug. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * style: fix gofmt issue in engineer.go comment block Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -71,6 +71,22 @@ func runMQList(cmd *cobra.Command, args []string) error {
|
|||||||
var scored []scoredIssue
|
var scored []scoredIssue
|
||||||
|
|
||||||
for _, issue := range issues {
|
for _, issue := range issues {
|
||||||
|
// Manual status filtering as workaround for bd list not respecting --status filter
|
||||||
|
if mqListReady {
|
||||||
|
// Ready view should only show open MRs
|
||||||
|
if issue.Status != "open" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
} else if mqListStatus != "" && !strings.EqualFold(mqListStatus, "all") {
|
||||||
|
// Explicit status filter should match exactly
|
||||||
|
if !strings.EqualFold(issue.Status, mqListStatus) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
} else if mqListStatus == "" && issue.Status != "open" {
|
||||||
|
// Default case (no status specified) should only show open
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// Parse MR fields
|
// Parse MR fields
|
||||||
fields := beads.ParseMRFields(issue)
|
fields := beads.ParseMRFields(issue)
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,10 @@ func runMQNext(cmd *cobra.Command, args []string) error {
|
|||||||
// Filter to only ready MRs (no blockers)
|
// Filter to only ready MRs (no blockers)
|
||||||
var ready []*beads.Issue
|
var ready []*beads.Issue
|
||||||
for _, issue := range issues {
|
for _, issue := range issues {
|
||||||
|
// Skip closed MRs (workaround for bd list not respecting --status filter)
|
||||||
|
if issue.Status != "open" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if len(issue.BlockedBy) == 0 && issue.BlockedByCount == 0 {
|
if len(issue.BlockedBy) == 0 && issue.BlockedByCount == 0 {
|
||||||
ready = append(ready, issue)
|
ready = append(ready, issue)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -630,11 +630,12 @@ func (e *Engineer) HandleMRInfoFailure(mr *MRInfo, result ProcessResult) {
|
|||||||
// Returns the created task's ID for blocking the MR until resolution.
|
// Returns the created task's ID for blocking the MR until resolution.
|
||||||
//
|
//
|
||||||
// Task format:
|
// Task format:
|
||||||
// Title: Resolve merge conflicts: <original-issue-title>
|
//
|
||||||
// Type: task
|
// Title: Resolve merge conflicts: <original-issue-title>
|
||||||
// Priority: inherit from original + boost (P2 -> P1)
|
// Type: task
|
||||||
// Parent: original MR bead
|
// Priority: inherit from original + boost (P2 -> P1)
|
||||||
// Description: metadata including branch, conflict SHA, etc.
|
// Parent: original MR bead
|
||||||
|
// Description: metadata including branch, conflict SHA, etc.
|
||||||
//
|
//
|
||||||
// Merge Slot Integration:
|
// Merge Slot Integration:
|
||||||
// Before creating a conflict resolution task, we acquire the merge-slot for this rig.
|
// Before creating a conflict resolution task, we acquire the merge-slot for this rig.
|
||||||
@@ -768,6 +769,11 @@ func (e *Engineer) ListReadyMRs() ([]*MRInfo, error) {
|
|||||||
// Convert beads issues to MRInfo
|
// Convert beads issues to MRInfo
|
||||||
var mrs []*MRInfo
|
var mrs []*MRInfo
|
||||||
for _, issue := range issues {
|
for _, issue := range issues {
|
||||||
|
// Skip closed MRs (workaround for bd list not respecting --status filter)
|
||||||
|
if issue.Status != "open" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
fields := beads.ParseMRFields(issue)
|
fields := beads.ParseMRFields(issue)
|
||||||
if fields == nil {
|
if fields == nil {
|
||||||
continue // Skip issues without MR fields
|
continue // Skip issues without MR fields
|
||||||
|
|||||||
Reference in New Issue
Block a user