Skip to content

client/pkg/jsonmessage: make DisplayJSONMessages accept a iter.Seq2#52062

Merged
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:stream_eazy
Feb 23, 2026
Merged

client/pkg/jsonmessage: make DisplayJSONMessages accept a iter.Seq2#52062
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:stream_eazy

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Feb 19, 2026

The DisplayJSONMessages only accepted a JSONMessagesStream. This meant that it would not accept the output from (for example) client.ImagePushResponse.

This patch:

  • Makes DisplayJSONMessages accept any iter.Seq2[jsonstream.Message, error]
  • Makes JSONMessagesStream an alias instead of a concrete type (TBD if we actually need the type).
  • Some minor cleanups in the implementation.

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

client/pkg/jsonmessage.DisplayJSONMessages now accepts an `iter.Seq2[jsonstream.Message, error]` instead of only a `JSONMessagesStream`,

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added status/2-code-review kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. impact/changelog area/go-sdk module/client labels Feb 19, 2026
@thaJeztah thaJeztah added this to the 29.3.0 milestone Feb 19, 2026
The `DisplayJSONMessages` only accepted a `JSONMessagesStream`. This meant that
it would not accept the output from (for example) [client.ImagePushResponse].

This patch:

- Makes `DisplayJSONMessages` accept any `iter.Seq2[jsonstream.Message, error]`
- Makes `JSONMessagesStream` an alias instead of a concrete type (TBD if we
  actually need the type).
- Some minor cleanups in the implementation.

[client.ImagePushResponse]: https://github.com/moby/moby/blob/fa87120ae64a170fd42096de3b873b439b95016b/client/image_push.go#L20-L24

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the DisplayJSONMessages function more flexible by accepting any iter.Seq2[jsonstream.Message, error] instead of only the JSONMessagesStream type. This enables the function to work directly with outputs from methods like ImagePushResponse.JSONMessages() without requiring type conversion.

Changes:

  • Changed JSONMessagesStream from a defined type to a type alias for iter.Seq2[jsonstream.Message, error]
  • Updated DisplayJSONMessages signature to accept iter.Seq2[jsonstream.Message, error] directly
  • Removed explicit type declaration in DisplayJSONMessagesStream (line 154) as it's now unnecessary with the type alias

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
client/pkg/jsonmessage/jsonmessage.go Changed JSONMessagesStream to type alias, updated DisplayJSONMessages to accept iter.Seq2 directly, simplified type declaration in DisplayJSONMessagesStream
vendor/github.com/moby/moby/client/pkg/jsonmessage/jsonmessage.go Identical changes to the vendored version of the package

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@thaJeztah thaJeztah requested review from robmry and vvoland February 23, 2026 13:53
@thaJeztah thaJeztah merged commit 65d8d0b into moby:master Feb 23, 2026
326 of 344 checks passed
@thaJeztah thaJeztah deleted the stream_eazy branch February 23, 2026 15:06
@thaJeztah thaJeztah modified the milestones: 29.3.0, 29.2.2 Feb 23, 2026
@vvoland vvoland modified the milestones: 29.2.2, 29.3.0 Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/go-sdk impact/changelog kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. module/client status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants