From 696c84f6e4d93e668bec63ff69e51df026e178b8 Mon Sep 17 00:00:00 2001 From: Adam Bull Date: Tue, 7 Oct 2025 15:27:11 +0100 Subject: [PATCH 1/3] fix: guard against empty code samples url --- internal/run/run.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/run/run.go b/internal/run/run.go index affca742..58d0e5bc 100644 --- a/internal/run/run.go +++ b/internal/run/run.go @@ -249,7 +249,7 @@ func (w *Workflow) printGenerationOverview(ctx context.Context) error { additionalLines = append(additionalLines, "Review all targets with `speakeasy status`.") } - if t.CodeSamples != nil { + if t.CodeSamples != nil && t.CodeSamples.Output != "" { additionalLines = append(additionalLines, fmt.Sprintf("Code samples overlay file written to %s", t.CodeSamples.Output)) } From df65366b2737d25186953432062458727d071a88 Mon Sep 17 00:00:00 2001 From: Adam Bull Date: Tue, 7 Oct 2025 15:58:52 +0100 Subject: [PATCH 2/3] fix: code samples --- internal/run/run.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/run/run.go b/internal/run/run.go index 58d0e5bc..77bdbed9 100644 --- a/internal/run/run.go +++ b/internal/run/run.go @@ -249,10 +249,16 @@ func (w *Workflow) printGenerationOverview(ctx context.Context) error { additionalLines = append(additionalLines, "Review all targets with `speakeasy status`.") } + // Covers the case where code samples are configured to be written to a local file if t.CodeSamples != nil && t.CodeSamples.Output != "" { additionalLines = append(additionalLines, fmt.Sprintf("Code samples overlay file written to %s", t.CodeSamples.Output)) } + // Covers the case where code samples are configured to be published to a registry URI + if t.CodeSamples != nil && t.CodeSamples.Registry != nil { + additionalLines = append(additionalLines, fmt.Sprintf("Code samples uploaded to: %s", string(t.CodeSamples.Registry.Location))) + } + if len(w.criticalWarns) > 0 { additionalLines = append(additionalLines, "⚠ Critical warnings found. Please review the logs above.") } From 28da7148ac5cb2386af26458757fa727e3591d71 Mon Sep 17 00:00:00 2001 From: Adam Bull Date: Tue, 7 Oct 2025 16:00:39 +0100 Subject: [PATCH 3/3] fix: formatting --- internal/run/run.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/run/run.go b/internal/run/run.go index 77bdbed9..40ad9b3b 100644 --- a/internal/run/run.go +++ b/internal/run/run.go @@ -252,10 +252,8 @@ func (w *Workflow) printGenerationOverview(ctx context.Context) error { // Covers the case where code samples are configured to be written to a local file if t.CodeSamples != nil && t.CodeSamples.Output != "" { additionalLines = append(additionalLines, fmt.Sprintf("Code samples overlay file written to %s", t.CodeSamples.Output)) - } - - // Covers the case where code samples are configured to be published to a registry URI - if t.CodeSamples != nil && t.CodeSamples.Registry != nil { + // Covers the case where code samples are configured to be published to a registry URI + } else if t.CodeSamples != nil && t.CodeSamples.Registry != nil { additionalLines = append(additionalLines, fmt.Sprintf("Code samples uploaded to: %s", string(t.CodeSamples.Registry.Location))) }