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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion .github/workflows/go-file-size-reduction-project64.campaign.g.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/campaign/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ func BuildOrchestrator(spec *CampaignSpec, campaignFilePath string) (*workflow.W
TrackerLabel: strings.TrimSpace(spec.TrackerLabel),
CursorGlob: strings.TrimSpace(spec.CursorGlob),
MetricsGlob: strings.TrimSpace(spec.MetricsGlob),
Workflows: spec.Workflows,
}
if len(spec.KPIs) > 0 {
promptData.KPIs = spec.KPIs
Expand Down
43 changes: 43 additions & 0 deletions pkg/campaign/orchestrator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,49 @@ func TestBuildOrchestrator_CompletionInstructions(t *testing.T) {
}
}

func TestBuildOrchestrator_WorkflowsInDiscovery(t *testing.T) {
spec := &CampaignSpec{
ID: "test-campaign",
Name: "Test Campaign",
Description: "A test campaign",
ProjectURL: "https://github.com/orgs/test/projects/1",
Workflows: []string{
"daily-doc-updater",
"docs-noob-tester",
"daily-multi-device-docs-tester",
},
TrackerLabel: "campaign:test",
}

mdPath := ".github/workflows/test-campaign.campaign.md"
data, _ := BuildOrchestrator(spec, mdPath)

if data == nil {
t.Fatalf("expected non-nil WorkflowData")
}

// Verify that the workflows are explicitly listed in the discovery instructions
if !strings.Contains(data.MarkdownContent, "Worker workflows:") {
t.Errorf("expected markdown to list worker workflows, got: %q", data.MarkdownContent)
}

// Verify each workflow is mentioned
for _, workflow := range spec.Workflows {
if !strings.Contains(data.MarkdownContent, workflow) {
t.Errorf("expected markdown to mention workflow %q, got: %q", workflow, data.MarkdownContent)
}
}

// Verify the worker discovery step is present
if !strings.Contains(data.MarkdownContent, "Query worker-created issues") {
t.Errorf("expected markdown to include worker discovery step, got: %q", data.MarkdownContent)
}

if !strings.Contains(data.MarkdownContent, "tracker-id:") {
t.Errorf("expected markdown to mention tracker-id search, got: %q", data.MarkdownContent)
}
}

func TestBuildOrchestrator_ObjectiveAndKPIsAreRendered(t *testing.T) {
spec := &CampaignSpec{
ID: "test-campaign",
Expand Down
Loading
Loading