Skip to content
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

Allow port, protocol and port settings to be specified in profiles. #2717

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Oct 4, 2024

Please check if the PR fulfills these requirements

See how to contribute

  • 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)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

  • Allow specifying the default port and protocol on a per-profile basis.
  • Allows specifying default port settings (like baudrate, etc...) on a per-sketch and per-profile basis.

What is the current behavior?

Default port and protocol can not be specified per-profile.
Port settings can not be specified either per-sketch or per-profile.

What is the new behavior?

The above features are now allowed inside sketch.yaml:

profiles:
  uno:
    fqbn: arduino:avr:uno
    platforms:
      - platform: arduino:avr (1.8.6)
    libraries:
      - RTClib (2.1.4)
      - Adafruit BusIO (1.16.1)
    port: /dev/ttyACM2
    port_config:
      baudrate: 9600
      bits: 9

default_fqbn: arduino:samd:arduino_zero_native
default_port: /dev/ttyACM0
default_port_config:
  baudrate: 115200
  bits: 9

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

Other information

Fix #2640
FIx #2554

@cmaglie cmaglie self-assigned this Oct 4, 2024
@cmaglie cmaglie added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Oct 4, 2024
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 43.26923% with 59 lines in your changes missing coverage. Please review.

Project coverage is 67.57%. Comparing base (863c1ec) to head (0271d36).

Files with missing lines Patch % Lines
internal/arduino/sketch/profiles.go 17.24% 19 Missing and 5 partials ⚠️
internal/cli/monitor/monitor.go 61.81% 18 Missing and 3 partials ⚠️
internal/arduino/sketch/sketch.go 20.00% 7 Missing and 1 partial ⚠️
internal/cli/arguments/fqbn.go 14.28% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2717      +/-   ##
==========================================
- Coverage   67.68%   67.57%   -0.12%     
==========================================
  Files         234      234              
  Lines       22226    22283      +57     
==========================================
+ Hits        15043    15057      +14     
- Misses       6001     6036      +35     
- Partials     1182     1190       +8     
Flag Coverage Δ
unit 67.57% <43.26%> (-0.12%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@alessio-perugini alessio-perugini left a comment

Choose a reason for hiding this comment

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

LGTM.

It would be awesome to add a test similar to monitor_test.go
That tests for the new profile configs.

Do you think it can be done without too much pain?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
2 participants