Skip to content
Open
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
29 changes: 29 additions & 0 deletions internal/orchestrator/orchestrator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,35 @@ func TestBuildPrompts(t *testing.T) {
}
}

func TestBuildPlanPrompt_ReleaseNotesIncludesDetailedInstructions(t *testing.T) {
o := New()

def, err := tasks.GetDefinition(tasks.TaskReleaseNotes)
if err != nil {
t.Fatalf("GetDefinition(TaskReleaseNotes) error: %v", err)
}

task := &tasks.Task{
ID: "release-notes:/repo",
Title: def.Name,
Description: def.Description,
Type: tasks.TaskReleaseNotes,
}

prompt := o.buildPlanPrompt(task)

for _, want := range []string{
"Inspect the latest tag and CHANGELOG.md first",
"Group the draft into clear user-facing sections",
"Call out breaking changes, migrations, config updates",
"state your assumptions",
} {
if !strings.Contains(prompt, want) {
t.Errorf("plan prompt missing %q\nGot:\n%s", want, prompt)
}
}
}

func TestExtractPRURL(t *testing.T) {
tests := []struct {
name string
Expand Down
14 changes: 10 additions & 4 deletions internal/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,16 @@ Apply safe updates directly, and leave concise follow-ups for anything uncertain
DefaultInterval: 168 * time.Hour,
},
TaskReleaseNotes: {
Type: TaskReleaseNotes,
Category: CategoryPR,
Name: "Release Note Drafter",
Description: "Draft release notes from changes",
Type: TaskReleaseNotes,
Category: CategoryPR,
Name: "Release Note Drafter",
Description: `Draft Nightshift release notes from repository changes.
Inspect the latest tag and CHANGELOG.md first to understand the last published release and the existing release-note tone.
Summarize the notable user-facing changes since that release, using commits and merged PRs as supporting evidence.
Group the draft into clear user-facing sections (for example: Features, Fixes, Improvements, Breaking Changes) based on what changed.
Call out breaking changes, migrations, config updates, and operator follow-up explicitly so upgrade impact is easy to scan.
Preserve the concise tone and heading style already used in CHANGELOG.md, and skip low-signal internal churn unless it matters to users.
If the release scope is unclear, state your assumptions, note missing evidence, and include follow-up questions or validation steps before publishing.`,
CostTier: CostLow,
RiskLevel: RiskLow,
DefaultInterval: 168 * time.Hour,
Expand Down
23 changes: 23 additions & 0 deletions internal/tasks/tasks_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package tasks

import (
"strings"
"testing"
"time"
)
Expand Down Expand Up @@ -280,6 +281,28 @@ func TestRegistryCompleteness(t *testing.T) {
}
}

func TestReleaseNotesDefinitionIncludesDraftingGuidance(t *testing.T) {
def, err := GetDefinition(TaskReleaseNotes)
if err != nil {
t.Fatalf("GetDefinition(TaskReleaseNotes) error: %v", err)
}

if def.Name != "Release Note Drafter" {
t.Fatalf("TaskReleaseNotes name = %q, want %q", def.Name, "Release Note Drafter")
}

for _, want := range []string{
"Inspect the latest tag and CHANGELOG.md first",
"Group the draft into clear user-facing sections",
"Call out breaking changes, migrations, config updates",
"state your assumptions",
} {
if !strings.Contains(def.Description, want) {
t.Errorf("TaskReleaseNotes description missing %q", want)
}
}
}

func TestAllDefinitionsHaveDefaultInterval(t *testing.T) {
for _, def := range AllDefinitions() {
if def.DefaultInterval == 0 {
Expand Down
Loading