Skip to content

Commit 4864464

Browse files
committed
fix(pipeline): use string slice for errors to ensure json visibility
1 parent aed3242 commit 4864464

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

internal/core/pipeline/pipeline.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ type Result struct {
5858
Indexed bool
5959
SuggestedLabels []string
6060
LabelsApplied []string
61-
Errors []error
61+
Errors []string
6262

6363
// Quality assessment
6464
QualityScore float64 `json:"quality_score"`

internal/steps/action_executor.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (s *ActionExecutor) Run(ctx *pipeline.Context) error {
5858
err := s.client.CreateComment(ctx.Ctx, ctx.Issue.Org, ctx.Issue.Repo, ctx.Issue.Number, comment)
5959
if err != nil {
6060
log.Printf("[action_executor] Failed to post comment: %v", err)
61-
ctx.Result.Errors = append(ctx.Result.Errors, err)
61+
ctx.Result.Errors = append(ctx.Result.Errors, err.Error())
6262
} else {
6363
log.Printf("[action_executor] Posted comment on issue #%d", ctx.Issue.Number)
6464
ctx.Result.CommentPosted = true
@@ -70,7 +70,7 @@ func (s *ActionExecutor) Run(ctx *pipeline.Context) error {
7070
newURL, err := s.client.TransferIssue(ctx.Ctx, ctx.Issue.Org, ctx.Issue.Repo, ctx.Issue.Number, ctx.TransferTarget)
7171
if err != nil {
7272
log.Printf("[action_executor] Failed to transfer issue to %s: %v", ctx.TransferTarget, err)
73-
ctx.Result.Errors = append(ctx.Result.Errors, err)
73+
ctx.Result.Errors = append(ctx.Result.Errors, err.Error())
7474
} else {
7575
log.Printf("[action_executor] Transferred issue #%d to %s (new URL: %s)", ctx.Issue.Number, ctx.TransferTarget, newURL)
7676
ctx.Result.TransferTarget = ctx.TransferTarget
@@ -83,7 +83,7 @@ func (s *ActionExecutor) Run(ctx *pipeline.Context) error {
8383
err := s.client.AddLabels(ctx.Ctx, ctx.Issue.Org, ctx.Issue.Repo, ctx.Issue.Number, ctx.Result.SuggestedLabels)
8484
if err != nil {
8585
log.Printf("[action_executor] Failed to add labels: %v", err)
86-
ctx.Result.Errors = append(ctx.Result.Errors, err)
86+
ctx.Result.Errors = append(ctx.Result.Errors, err.Error())
8787
} else {
8888
log.Printf("[action_executor] Added labels: %v", ctx.Result.SuggestedLabels)
8989
ctx.Result.LabelsApplied = ctx.Result.SuggestedLabels

0 commit comments

Comments
 (0)