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

Add support for default build profile #2203

Merged
merged 7 commits into from
Aug 23, 2023

Conversation

MatteoPologruto
Copy link
Contributor

@MatteoPologruto MatteoPologruto commented Jun 6, 2023

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?

Code enhancement

What is the new behavior?

It is now possible to compile and upload using the default_profile specified in the sketch.yaml file through the following commands:

compile [sketch]
upload -p [port] [sketch]

The gRPC interface also supports the default_profile. If present, it will be part of LoadSketchResponse (#2264).

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

No

@MatteoPologruto MatteoPologruto added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jun 6, 2023
@MatteoPologruto MatteoPologruto self-assigned this Jun 6, 2023
@MatteoPologruto MatteoPologruto linked an issue Jun 6, 2023 that may be closed by this pull request
3 tasks
@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Patch coverage: 69.69% and project coverage change: +0.13% 🎉

Comparison is base (086b77a) 62.98% compared to head (f028e75) 63.12%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2203      +/-   ##
==========================================
+ Coverage   62.98%   63.12%   +0.13%     
==========================================
  Files         221      221              
  Lines       19746    19771      +25     
==========================================
+ Hits        12438    12481      +43     
+ Misses       6206     6186      -20     
- Partials     1102     1104       +2     
Flag Coverage Δ
unit 63.12% <69.69%> (+0.13%) ⬆️

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

Files Changed Coverage Δ
commands/compile/compile.go 69.18% <40.00%> (-0.69%) ⬇️
commands/upload/upload.go 73.53% <40.00%> (-0.33%) ⬇️
internal/cli/upload/upload.go 60.48% <66.66%> (-0.20%) ⬇️
internal/cli/compile/compile.go 74.08% <100.00%> (+0.64%) ⬆️

... and 4 files with indirect coverage changes

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

docs/UPGRADING.md Outdated Show resolved Hide resolved
internal/cli/compile/compile.go Outdated Show resolved Hide resolved
internal/cli/upload/upload.go Outdated Show resolved Hide resolved
@MatteoPologruto MatteoPologruto changed the title [breaking] Add support for default build profile Add support for default build profile Jun 13, 2023
Copy link
Member

@cmaglie cmaglie left a comment

Choose a reason for hiding this comment

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

I tested it extensively, and works as expected! 👍🏼

I've added some more integration tests, as soon as the CI pass, it's mergeable for me.

@cmaglie cmaglie added this to the Arduino CLI 0.35.0 milestone Aug 23, 2023
@MatteoPologruto MatteoPologruto merged commit a47e35f into arduino:master Aug 23, 2023
91 checks passed
@MatteoPologruto MatteoPologruto deleted the default-profile branch August 23, 2023 11:25
cmaglie added a commit to cmaglie/arduino-cli that referenced this pull request Sep 8, 2023
* Add support for default profile to compile command

* Add support for default profiles to upload command

* Add TestCompileWithDefaultProfile to integration tests

* Get the profile's FQBN if it's not already specified in the request

* Update documentation regarding sketch projects

* Added integration tests for all default_profile cases

* Reverted old sketch_with_profile test

---------

Co-authored-by: Cristian Maglie <c.maglie@arduino.cc>
cmaglie added a commit that referenced this pull request Sep 11, 2023
…#2304 (#2305)

* Add support for default build profile (#2203)

* Add support for default profile to compile command

* Add support for default profiles to upload command

* Add TestCompileWithDefaultProfile to integration tests

* Get the profile's FQBN if it's not already specified in the request

* Update documentation regarding sketch projects

* Added integration tests for all default_profile cases

* Reverted old sketch_with_profile test

---------

Co-authored-by: Cristian Maglie <c.maglie@arduino.cc>

* [skip-changelog] Use `LoadSketch` in upload function and return `rpc.Port` in `GetPort` (#2297)

* Change GetPort's returned type to rpc.Port

* Use LoadSketch in runUploadCommand

---------

Co-authored-by: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com>
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
Development

Successfully merging this pull request may close these issues.

Add support for defining a default build profile
3 participants