Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions internal/workflow/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package workflow //nolint:testpackage // needs access to unexported userHomeDir
import (
"os"
"path/filepath"
"strings"
"testing"
)

Expand Down Expand Up @@ -247,6 +248,24 @@ func TestReadPrompt_embeddedFallback(t *testing.T) { //nolint:paralleltest // mu
}
}

func TestReadPrompt_embeddedImplementPromptMentionsGitHubClosingReference(t *testing.T) { //nolint:paralleltest // mutates package-level userHomeDir
tmp := t.TempDir()
userHomeDir = func() (string, error) { return tmp, nil }
t.Cleanup(func() { userHomeDir = os.UserHomeDir })

data, err := ReadPrompt(tmp, "prompts/implement.md")
if err != nil {
t.Fatalf("expected embedded fallback, got error: %v", err)
}
content := string(data)
if !strings.Contains(content, "Closes #<number>") {
t.Fatalf("expected implement prompt to mention GitHub closing reference, got %q", content)
}
if !strings.Contains(content, "Do not use cross-repository issue references") {
t.Fatalf("expected implement prompt to restrict cross-repository references, got %q", content)
}
}

func TestReadPrompt_notFound(t *testing.T) { //nolint:paralleltest // mutates package-level userHomeDir
tmp := t.TempDir()
userHomeDir = func() (string, error) { return tmp, nil }
Expand Down
2 changes: 2 additions & 0 deletions internal/workflow/prompts/implement.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Read `.auto-pr/run-context.md`.
Read the ticket details from the latest `fetch-ticket-data` artifact path listed in the `Latest State Artifacts` section of `.auto-pr/run-context.md`.
Read the approved proposal from the latest `investigation` artifact path listed in the `Latest State Artifacts` section of `.auto-pr/run-context.md`.

If the fetched ticket has a GitHub issue `URL:` for this repository, include `Closes #<number>` in the pull request body when you create the PR. Do not use cross-repository issue references for this workflow.

If the `Feedback File` listed in `.auto-pr/run-context.md` exists, incorporate that feedback into your implementation.

If a `Guidelines File` is listed in `.auto-pr/run-context.md`, read and follow those guidelines.
Expand Down
Loading