diff --git a/internal/forge/forge.go b/internal/forge/forge.go index 64126b4ea..329bed5f7 100644 --- a/internal/forge/forge.go +++ b/internal/forge/forge.go @@ -60,9 +60,6 @@ type IssueForge interface { // CloseIssue closes an issue with an optional final comment. CloseIssue(ctx context.Context, owner, repo string, number int, comment string) error - // CreateIssue opens a new issue and returns its number. - CreateIssue(ctx context.Context, owner, repo, title, body string, labels []string) (int, error) - // React adds an emoji reaction to an issue. React(ctx context.Context, owner, repo string, number int, reaction string) error diff --git a/internal/forge/gitea.go b/internal/forge/gitea.go index 19fb7382e..816d384b1 100644 --- a/internal/forge/gitea.go +++ b/internal/forge/gitea.go @@ -294,15 +294,6 @@ func (c *GiteaClient) CloseIssue(ctx context.Context, owner, repo string, number return err } -// CreateIssue opens a new issue and returns its number. -func (c *GiteaClient) CreateIssue(ctx context.Context, owner, repo, title, body string, labels []string) (int, error) { - iss, _, err := c.cli.CreateIssue(owner, repo, gitea.CreateIssueOption{Title: title, Body: body}) - if err != nil { - return 0, err - } - return int(iss.Index), nil -} - // React adds an emoji reaction to an issue. func (c *GiteaClient) React(ctx context.Context, owner, repo string, number int, reaction string) error { _, _, err := c.cli.PostIssueReaction(owner, repo, int64(number), reaction) diff --git a/internal/forge/gitea_methods_test.go b/internal/forge/gitea_methods_test.go index a78db7071..c20c09b1a 100644 --- a/internal/forge/gitea_methods_test.go +++ b/internal/forge/gitea_methods_test.go @@ -230,21 +230,6 @@ func TestGiteaCloseIssueWithoutComment(t *testing.T) { } } -func TestGiteaCreateIssue(t *testing.T) { - c, mux := newTestGiteaClient(t) - mux.HandleFunc("POST /api/v1/repos/o/r/issues", func(w http.ResponseWriter, r *http.Request) { - writeJSON(t, w, map[string]any{"number": 11}) - }) - - num, err := c.CreateIssue(t.Context(), "o", "r", "title", "body", nil) - if err != nil { - t.Fatal(err) - } - if num != 11 { - t.Fatalf("num = %d, want 11", num) - } -} - func TestGiteaReact(t *testing.T) { c, mux := newTestGiteaClient(t) var got string diff --git a/internal/forge/github.go b/internal/forge/github.go index e1011b244..98d52be40 100644 --- a/internal/forge/github.go +++ b/internal/forge/github.go @@ -302,20 +302,6 @@ func (c *GitHubClient) LinkBranch(ctx context.Context, owner, repo string, issue return nil } -// CreateIssue opens a new issue and returns its number. -func (c *GitHubClient) CreateIssue(ctx context.Context, owner, repo, title, body string, labels []string) (int, error) { - req := &github.IssueRequest{ - Title: &title, - Body: &body, - Labels: &labels, - } - iss, _, err := c.gh.Issues.Create(ctx, owner, repo, req) - if err != nil { - return 0, fmt.Errorf("create issue %s/%s: %w", owner, repo, err) - } - return iss.GetNumber(), nil -} - // State labels mirror the task lifecycle onto the forge so archie's // status is visible at a glance. SQLite remains the source of truth; // labels are the human-facing projection -- and removing the parked diff --git a/internal/forge/noop.go b/internal/forge/noop.go index 08d45e9bb..2a2389c7f 100644 --- a/internal/forge/noop.go +++ b/internal/forge/noop.go @@ -38,10 +38,6 @@ func (n *NoopForge) CloseIssue(ctx context.Context, owner, repo string, number i return nil } -func (n *NoopForge) CreateIssue(ctx context.Context, owner, repo, title, body string, labels []string) (int, error) { - return 0, nil -} - func (n *NoopForge) React(ctx context.Context, owner, repo string, number int, reaction string) error { return nil } diff --git a/internal/forge/noop_test.go b/internal/forge/noop_test.go index 628e245cc..3000fb30c 100644 --- a/internal/forge/noop_test.go +++ b/internal/forge/noop_test.go @@ -40,11 +40,6 @@ func TestNoopForgeIsAllZeroValue(t *testing.T) { t.Errorf("CloseIssue() = %v, want nil", err) } - num, err := f.CreateIssue(ctx, "o", "r", "title", "body", nil) - if num != 0 || err != nil { - t.Errorf("CreateIssue() = (%d, %v), want (0, nil)", num, err) - } - if err := f.React(ctx, "o", "r", 1, "+1"); err != nil { t.Errorf("React() = %v, want nil", err) }