Repository navigation
Conversation
Each log entry was marshalled with its own yaml.Marshal call and written back to back, so two or more entries produced one mapping with duplicate keys. Strict parsers reject that output, and permissive ones silently keep only the last entry. nonInteractiveLogs now writes every entry - listed history and tailed events alike - through one logWriter whose lazily created yaml.Encoder emits a `---`-separated multi-document stream. Zero entries still produce no output, each Encode flushes its document so tailing stays streaming, and JSON and text output are unchanged.
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.
Summary
render logs -o yamlmarshalled each entry with its ownyaml.Marshalcall and wrote them back to back. Two or more entries therefore produced a single mapping with duplicate keys:Strict parsers reject this; permissive parsers silently keep only the last entry, so automation gets an incomplete result while the command exits 0.
nonInteractiveLogsnow writes every entry — listed history and tailed events — through onelogWriterwhose lazily createdyaml.Encoderemits a----separated multi-document stream. Zero entries still produce no output, eachEncodeflushes its document so--tailkeeps streaming, and JSON and text output are unchanged.Motivation
Exporting logs as YAML for scripting returned unparseable output whenever the query matched more than one line.
How to verify
go test ./cmd -run TestLogs— newcmd/logs_output_test.gouses the fake Render API server:KnownFields) as two documents, in order, with matching ids, messages and timestamps;main.go test ./...passes excepte2e/TestE2E, which fails identically onmainwithout credentials.Release notes