Skip to content

[breaking] Refactoring of board autodetection #1717

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 12 commits into from
May 2, 2022

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Apr 21, 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?
Some redundancy and wrong usage of the arduino-cli golang modules are fixed:

  • The subroutine DetectConnectedBoard has been removed since is a duplicate of the already implemented board.List
  • Some error messages have been improved
  • Removed SupportedUserFieldsRequest.Address parameter from gRPC call (it was useless)
  • The --discovery-timeout flag has been factored.

What is the current behavior?
No changes in behavior

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

Yes, docs have been updated.

Other information:
This PR is a prerequisite for profiles.

cmaglie added 10 commits April 20, 2022 17:33
…ctedError

- The message formatting has been fixed
- The errors now accepts a *rpc.Port instead of a *discovery.Port
- The new error NoBoardsDetectedError has been added
fqbn -> fqbnArg
port -> portArgs
detectedFqbn -> fqbn
discoveryPort -> port
fqbn -> fqbnArg
port -> portArgs
discoveryPort -> port
fqbn -> fqbnArg
port -> portArgs
discoveryPort -> port
- use `board.List()` instead of implementing a duplicate of it
- factored the logic that calculates FQBN, Port and possibly
  autodetects FQBN, so we have a single implementation for all
  commands of the cli.
@cmaglie cmaglie force-pushed the factoring_arguments branch from 9102b90 to 3e0cf80 Compare April 21, 2022 14:19
@cmaglie cmaglie self-assigned this Apr 21, 2022
@cmaglie cmaglie force-pushed the factoring_arguments branch from 839291f to d7d5411 Compare April 21, 2022 15:02
@cmaglie cmaglie requested a review from a team April 21, 2022 15:19
Co-authored-by: Umberto Baldi <34278123+umbynos@users.noreply.github.com>
@cmaglie cmaglie merged commit 9299579 into arduino:master May 2, 2022
@cmaglie cmaglie deleted the factoring_arguments branch May 2, 2022 10:05
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels May 4, 2022
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.

3 participants