Skip to content

Added 'label' and 'properties' fields in board -w command (json output) #1845

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

Merged
merged 1 commit into from
Aug 24, 2022

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Aug 22, 2022

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)

What kind of change does this PR introduce?
Adds all the information available from discoveries to the board -w --format json output, in particular the label and properties fields that are missing from the output.

What is the current behavior?

$ arduino-cli board -w --format json
{
  "type": "add",
  "address": "/dev/ttyACM0",
  "protocol": "serial",
  "protocol_label": "Serial Port (USB)",
  "boards": [
    {
      "name": "Arduino Uno",
      "fqbn": "arduino:avr:uno"
    }
  ]
}

What is the new behavior?

$ arduino-cli board -w --format json
{
  "type": "add",
  "address": "/dev/ttyACM0",
  "label": "/dev/ttyACM0",
  "protocol": "serial",
  "protocol_label": "Serial Port (USB)",
  "properties": {
    "pid": "0x0043",
    "serialNumber": "754393237353511051D2",
    "vid": "0x2341"
  },
  "boards": [
    {
      "name": "Arduino Uno",
      "fqbn": "arduino:avr:uno"
    }
  ]
}

Does this PR introduce a breaking change, and is titled accordingly?
No

@cmaglie cmaglie self-assigned this Aug 22, 2022
@cmaglie cmaglie requested review from per1234 and umbynos August 22, 2022 12:36
@codecov
Copy link

codecov bot commented Aug 22, 2022

Codecov Report

Merging #1845 (7d3217d) into master (c756472) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #1845      +/-   ##
==========================================
- Coverage   36.26%   36.26%   -0.01%     
==========================================
  Files         232      232              
  Lines       19496    19498       +2     
==========================================
  Hits         7071     7071              
- Misses      11594    11596       +2     
  Partials      831      831              
Flag Coverage Δ
unit 36.26% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cli/board/list.go 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself topic: CLI Related to the command line interface labels Aug 23, 2022
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

Thanks Cristian!

@per1234 per1234 added type: imperfection Perceived defect in any part of project and removed type: enhancement Proposed improvement labels Aug 23, 2022
@cmaglie cmaglie merged commit 2bbb1b4 into arduino:master Aug 24, 2022
@cmaglie cmaglie deleted the output_port_address_label branch August 24, 2022 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: CLI Related to the command line interface topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants