fix: keep diagnostics off stdout for structured output#786
Merged
mcncl merged 2 commits intobuildkite:mainfrom Apr 15, 2026
Merged
fix: keep diagnostics off stdout for structured output#786mcncl merged 2 commits intobuildkite:mainfrom
mcncl merged 2 commits intobuildkite:mainfrom
Conversation
d9be599 to
7a5fda0
Compare
mcncl
reviewed
Apr 15, 2026
Comment on lines
+64
to
+68
| stdout, stderr := captureStandardStreams(t, func() { | ||
| if err := ValidateConfiguration(conf, "pipeline view"); err != nil { | ||
| t.Fatalf("expected no error when only org is missing, got %v", err) | ||
| } | ||
| }) |
Contributor
There was a problem hiding this comment.
Suggested change
| stdout, stderr := captureStandardStreams(t, func() { | |
| if err := ValidateConfiguration(conf, "pipeline view"); err != nil { | |
| t.Fatalf("expected no error when only org is missing, got %v", err) | |
| } | |
| }) | |
| var validationErr error | |
| stdout, stderr := captureStandardStreams(t, func() { | |
| validationErr = ValidateConfiguration(conf, "pipeline view") | |
| }) | |
| if validationErr != nil { | |
| t.Fatalf("expected no error when only org is missing, got %v", validationErr) | |
| } |
Kind of nitty, but if the output of the tests is redirected to a pipe then the output might be lost.
mcncl
approved these changes
Apr 15, 2026
Contributor
mcncl
left a comment
There was a problem hiding this comment.
Super minor thing which is more house-keepy than anything, but happy to approve/merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support machine-readable CLI output by keeping diagnostics off stdout.
Structured output commands currently print warnings and empty-state messages to stdout, which breaks callers that expect stdout to contain only JSON or YAML. Browser-open failures also use stdout even though they are diagnostics.
This routes shared warnings to stderr and makes JSON- and YAML-capable commands return structured empty values when no resources are found. It also adds focused regression coverage around the shared output helper and configuration validation warning so structured output stays clean.