feat: add identify option to swarm peers command#9745
Conversation
Jorropo
left a comment
There was a problem hiding this comment.
Thx for your patch, I see minor things.
Co-authored-by: Jorropo <jorropo.pgm@gmail.com>
Co-authored-by: Jorropo <jorropo.pgm@gmail.com>
|
@Jorropo Are there any tests for the swarmPeersCmd ? sorry for the obvious questions, that's my first issue and I couldn't find the tests for this command, so that I could add my own |
|
@arthurgavazza here are the tests https://github.com/ipfs/kubo/blob/master/test/sharness/t0140-swarm.sh, this use the old sharness thing, you can add there but it's a pain, ideally you would use our newer go based test suite (https://github.com/ipfs/kubo/tree/master/test/cli) but that more work since you would be bootstrapping a new |
|
@Jorropo thx for the info! I'll try creating the tests using the new model, tomorrow I'll commit the updates |
|
@Jorropo sorry for asking again, can you take a look at this PR again please? If it's ok, what else do I need to do so we get this merged? |
Co-authored-by: Jorropo <jorropo.pgm@gmail.com>
|
The linter is unhappy, that needs to be fixed 🙂 https://github.com/ipfs/kubo/actions/runs/4559382268/jobs/8043302197?pr=9745 |
|
@Jorropo Is there a local command so I can verify any lint warnings? I fixed the warnings from the workflow. |
|
@arthurgavazza I belive you can do: go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest ./...At the root of the repo. You can also run the individual linters in a similar fashion ( |
|
Noting here, I had of unfilled values and type connInfo struct {
Addr string `json:",omitempty"`
Peer string `json:",omitempty"`
Latency string `json:",omitempty"`
Muxer string `json:",omitempty"`
Direction inet.Direction `json:",omitempty"`
Streams []streamInfo `json:",omitempty"`
Identify IdOutput `json:",omitempty"`
} |
It adds the feature requested on #9578. This PR adds a new opt-in flag called identify that adds Identify values to the command output.