Repository navigation
Fix stdout configuration format handling and defaults #1153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -757,9 +757,20 @@ pub fn build_sink_factory( | |||||||||||||||
| } | ||||||||||||||||
| OutputType::Stdout => { | ||||||||||||||||
| let fmt = match cfg.format.as_ref() { | ||||||||||||||||
| Some(Format::Json) => StdoutFormat::Json, | ||||||||||||||||
| Some(Format::Cri) | Some(Format::Raw) | Some(Format::Auto) => { | ||||||||||||||||
| return Err(OutputError::Construction(format!( | ||||||||||||||||
| "output '{name}': format '{}' is only supported for inputs", | ||||||||||||||||
| cfg.format.as_ref().unwrap() | ||||||||||||||||
|
Comment on lines
+760
to
+763
|
||||||||||||||||
| Some(Format::Cri) | Some(Format::Raw) | Some(Format::Auto) => { | |
| return Err(OutputError::Construction(format!( | |
| "output '{name}': format '{}' is only supported for inputs", | |
| cfg.format.as_ref().unwrap() | |
| Some(f @ (Format::Cri | Format::Raw | Format::Auto)) => { | |
| return Err(OutputError::Construction(format!( | |
| "output '{name}': format '{f}' is only supported for inputs" |
Copilot
AI
Apr 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is intended to cover the new stdout default format behavior, but it only asserts the factory name. As written it won’t catch regressions where the default format changes back to text. Consider asserting the chosen format (e.g. by factoring the stdout-format selection into a small pure helper and unit-testing that, or otherwise making the selected StdoutFormat observable in tests).
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -351,7 +351,7 @@ mod tests { | |||||
| Box::pin(async { Ok(()) }) | ||||||
| } | ||||||
|
|
||||||
| fn name(&self) -> &str { | ||||||
| fn name(&self) -> &'static str { | ||||||
|
||||||
| fn name(&self) -> &'static str { | |
| fn name(&self) -> &str { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test currently asserts
pipe.inputs[0].format == Some(Format::Text), but the PR description is about stdout/output format handling. To actually validate the intended behavior, setoutput.format: textin the YAML and assert againstpipe.outputs[0].format(and consider renaming the test sincetextis no longer an alias forconsole).