fix: gt done creates MR bead instead of file-based mrqueue (gt-wtfej)
Previously gt done wrote MRs to .beads/mq/*.json files, but gt mq list queried beads for issue_type=merge-request. These were two different storage systems, so MRs created by gt done never showed in gt mq list. Now gt done creates a proper MR bead with: - issue_type: merge-request - Description containing branch, target, source_issue, rig, worker Also updated mq_submit.go for consistency. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+15
-22
@@ -3,14 +3,12 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/steveyegge/gastown/internal/beads"
|
"github.com/steveyegge/gastown/internal/beads"
|
||||||
"github.com/steveyegge/gastown/internal/git"
|
"github.com/steveyegge/gastown/internal/git"
|
||||||
"github.com/steveyegge/gastown/internal/mail"
|
"github.com/steveyegge/gastown/internal/mail"
|
||||||
"github.com/steveyegge/gastown/internal/mrqueue"
|
|
||||||
"github.com/steveyegge/gastown/internal/style"
|
"github.com/steveyegge/gastown/internal/style"
|
||||||
"github.com/steveyegge/gastown/internal/workspace"
|
"github.com/steveyegge/gastown/internal/workspace"
|
||||||
)
|
)
|
||||||
@@ -144,34 +142,29 @@ func runDone(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build title
|
// Build MR bead title and description
|
||||||
title := fmt.Sprintf("Merge: %s", issueID)
|
title := fmt.Sprintf("Merge: %s", issueID)
|
||||||
|
description := fmt.Sprintf("branch: %s\ntarget: %s\nsource_issue: %s\nrig: %s",
|
||||||
|
branch, target, issueID, rigName)
|
||||||
|
if worker != "" {
|
||||||
|
description += fmt.Sprintf("\nworker: %s", worker)
|
||||||
|
}
|
||||||
|
|
||||||
// Note: Branch stays local. Refinery sees it via shared .git (worktree).
|
// Create MR bead (ephemeral wisp - will be cleaned up after merge)
|
||||||
// Only main gets pushed to origin after merge.
|
mrIssue, err := bd.Create(beads.CreateOptions{
|
||||||
|
|
||||||
// Submit to MR queue (wisp storage - ephemeral, not synced)
|
|
||||||
rigPath := filepath.Join(townRoot, rigName)
|
|
||||||
queue := mrqueue.New(rigPath)
|
|
||||||
|
|
||||||
mr := &mrqueue.MR{
|
|
||||||
Branch: branch,
|
|
||||||
Target: target,
|
|
||||||
SourceIssue: issueID,
|
|
||||||
Worker: worker,
|
|
||||||
Rig: rigName,
|
|
||||||
Title: title,
|
Title: title,
|
||||||
|
Type: "merge-request",
|
||||||
Priority: priority,
|
Priority: priority,
|
||||||
|
Description: description,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("creating merge request bead: %w", err)
|
||||||
}
|
}
|
||||||
|
mrID = mrIssue.ID
|
||||||
if err := queue.Submit(mr); err != nil {
|
|
||||||
return fmt.Errorf("submitting to merge queue: %w", err)
|
|
||||||
}
|
|
||||||
mrID = mr.ID
|
|
||||||
|
|
||||||
// Success output
|
// Success output
|
||||||
fmt.Printf("%s Work submitted to merge queue\n", style.Bold.Render("✓"))
|
fmt.Printf("%s Work submitted to merge queue\n", style.Bold.Render("✓"))
|
||||||
fmt.Printf(" MR ID: %s\n", style.Bold.Render(mr.ID))
|
fmt.Printf(" MR ID: %s\n", style.Bold.Render(mrID))
|
||||||
fmt.Printf(" Source: %s\n", branch)
|
fmt.Printf(" Source: %s\n", branch)
|
||||||
fmt.Printf(" Target: %s\n", target)
|
fmt.Printf(" Target: %s\n", target)
|
||||||
fmt.Printf(" Issue: %s\n", issueID)
|
fmt.Printf(" Issue: %s\n", issueID)
|
||||||
|
|||||||
+15
-22
@@ -4,7 +4,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@@ -12,7 +11,6 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/steveyegge/gastown/internal/beads"
|
"github.com/steveyegge/gastown/internal/beads"
|
||||||
"github.com/steveyegge/gastown/internal/git"
|
"github.com/steveyegge/gastown/internal/git"
|
||||||
"github.com/steveyegge/gastown/internal/mrqueue"
|
|
||||||
"github.com/steveyegge/gastown/internal/style"
|
"github.com/steveyegge/gastown/internal/style"
|
||||||
"github.com/steveyegge/gastown/internal/workspace"
|
"github.com/steveyegge/gastown/internal/workspace"
|
||||||
)
|
)
|
||||||
@@ -132,33 +130,28 @@ func runMqSubmit(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build title
|
// Build MR bead title and description
|
||||||
title := fmt.Sprintf("Merge: %s", issueID)
|
title := fmt.Sprintf("Merge: %s", issueID)
|
||||||
|
description := fmt.Sprintf("branch: %s\ntarget: %s\nsource_issue: %s\nrig: %s",
|
||||||
// Note: Branch stays local. Refinery sees it via shared .git (worktree).
|
branch, target, issueID, rigName)
|
||||||
// Only main gets pushed to origin after merge.
|
if worker != "" {
|
||||||
|
description += fmt.Sprintf("\nworker: %s", worker)
|
||||||
// Submit to MR queue (wisp storage - ephemeral, not synced)
|
|
||||||
rigPath := filepath.Join(townRoot, rigName)
|
|
||||||
queue := mrqueue.New(rigPath)
|
|
||||||
|
|
||||||
mr := &mrqueue.MR{
|
|
||||||
Branch: branch,
|
|
||||||
Target: target,
|
|
||||||
SourceIssue: issueID,
|
|
||||||
Worker: worker,
|
|
||||||
Rig: rigName,
|
|
||||||
Title: title,
|
|
||||||
Priority: priority,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := queue.Submit(mr); err != nil {
|
// Create MR bead (ephemeral wisp - will be cleaned up after merge)
|
||||||
return fmt.Errorf("submitting to merge queue: %w", err)
|
mrIssue, err := bd.Create(beads.CreateOptions{
|
||||||
|
Title: title,
|
||||||
|
Type: "merge-request",
|
||||||
|
Priority: priority,
|
||||||
|
Description: description,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("creating merge request bead: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Success output
|
// Success output
|
||||||
fmt.Printf("%s Submitted to merge queue\n", style.Bold.Render("✓"))
|
fmt.Printf("%s Submitted to merge queue\n", style.Bold.Render("✓"))
|
||||||
fmt.Printf(" MR ID: %s\n", style.Bold.Render(mr.ID))
|
fmt.Printf(" MR ID: %s\n", style.Bold.Render(mrIssue.ID))
|
||||||
fmt.Printf(" Source: %s\n", branch)
|
fmt.Printf(" Source: %s\n", branch)
|
||||||
fmt.Printf(" Target: %s\n", target)
|
fmt.Printf(" Target: %s\n", target)
|
||||||
fmt.Printf(" Issue: %s\n", issueID)
|
fmt.Printf(" Issue: %s\n", issueID)
|
||||||
|
|||||||
Reference in New Issue
Block a user