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

[BREAKING] Support only compatible platform versions #2285

Conversation

alessio-perugini
Copy link
Contributor

@alessio-perugini alessio-perugini commented Aug 28, 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?

  • We added the latest_compatible field in the cc.arduino.cli.commands.v1.Platform gRPC message.
  • We now always show the latest installable aka compatible version of a core.
  • The upgrade and install commands now will always pick the latest compatible version. A user can force the installation of an incompatible/potentially-incompatible version if they provide a specific version like: arduino-cli core install arduino:[email protected]

What is the current behavior?

We always try to install (and show) the latest version even if it contains tools not available for the current os.

What is the new behavior?

We show, install, and upgrade a core only if we're sure that all the tools are available for the current OS. Is possible to install a potentially incompatible version providing a specific version of a core.

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

yup

Other information

@alessio-perugini alessio-perugini self-assigned this Aug 28, 2023
@alessio-perugini alessio-perugini added type: enhancement Proposed improvement topic: code Related to content of the project itself topic: CLI Related to the command line interface topic: gRPC Related to the gRPC interface labels Aug 28, 2023
@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Attention: 35 lines in your changes are missing coverage. Please review.

Comparison is base (50a8bf5) 65.17% compared to head (2977bc4) 65.17%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2285   +/-   ##
=======================================
  Coverage   65.17%   65.17%           
=======================================
  Files         210      210           
  Lines       20465    20519   +54     
=======================================
+ Hits        13338    13374   +36     
- Misses       6005     6022   +17     
- Partials     1122     1123    +1     
Flag Coverage Δ
unit 65.17% <76.51%> (+<0.01%) ⬆️

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

Files Coverage Δ
arduino/cores/packagemanager/download.go 65.38% <100.00%> (+3.84%) ⬆️
arduino/cores/packagemanager/install_uninstall.go 58.00% <100.00%> (ø)
commands/core.go 100.00% <100.00%> (ø)
commands/core/search.go 84.48% <100.00%> (-0.86%) ⬇️
internal/cli/arguments/completion.go 89.47% <100.00%> (-0.10%) ⬇️
internal/cli/arguments/reference.go 100.00% <100.00%> (ø)
internal/cli/compile/compile.go 73.41% <100.00%> (-0.09%) ⬇️
internal/cli/core/upgrade.go 83.90% <100.00%> (-0.19%) ⬇️
internal/cli/feedback/result/rpc.go 80.38% <100.00%> (+0.66%) ⬆️
commands/board/search.go 0.00% <0.00%> (ø)
... and 5 more

... and 2 files with indirect coverage changes

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

@alessio-perugini alessio-perugini added this to the Arduino CLI 0.35.0 milestone Aug 29, 2023
arduino/cores/cores.go Outdated Show resolved Hide resolved
arduino/cores/packageindex/index.go Outdated Show resolved Hide resolved
@alessio-perugini alessio-perugini force-pushed the 1889-platform-versions-incompatible-with-host-architecture-are-offered-unnecessarily branch 2 times, most recently from 85fa9d8 to cc1bbab Compare September 21, 2023 11:20
@alessio-perugini alessio-perugini force-pushed the 1889-platform-versions-incompatible-with-host-architecture-are-offered-unnecessarily branch 2 times, most recently from 18af151 to cb800ab Compare September 21, 2023 14:04
@alessio-perugini alessio-perugini force-pushed the 1889-platform-versions-incompatible-with-host-architecture-are-offered-unnecessarily branch 6 times, most recently from 0df532f to 82bd9e7 Compare October 23, 2023 10:30
@alessio-perugini alessio-perugini force-pushed the 1889-platform-versions-incompatible-with-host-architecture-are-offered-unnecessarily branch 2 times, most recently from dfb4d40 to 679f014 Compare November 8, 2023 17:04
@alessio-perugini alessio-perugini force-pushed the 1889-platform-versions-incompatible-with-host-architecture-are-offered-unnecessarily branch 2 times, most recently from d898eea to 36a4e89 Compare November 9, 2023 15:45
We leave only the `latest_compatible` field from the API. This field
will have the same meaning the the former `latest_compatible_version`.
Meaning that if the `latest_compatible` contains a version it is a
release that can be installed. However it might happen that we have
newer releases that cannot be installed. If the client is interested to
show newer-non-installable-releases, the `releases` field can be used to
infer that.
@alessio-perugini alessio-perugini force-pushed the 1889-platform-versions-incompatible-with-host-architecture-are-offered-unnecessarily branch from 36a4e89 to 14e0d5c Compare November 9, 2023 16:02
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.

Just a small nit pick.
Incredible work! 👍🏼

arduino/cores/cores.go Outdated Show resolved Hide resolved
@alessio-perugini alessio-perugini merged commit b0e28d9 into master Nov 9, 2023
194 checks passed
@alessio-perugini alessio-perugini deleted the 1889-platform-versions-incompatible-with-host-architecture-are-offered-unnecessarily branch November 9, 2023 17:56
@anttiryt

This comment was marked as off-topic.

@arduino arduino locked as resolved and limited conversation to collaborators Aug 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic: CLI Related to the command line interface topic: code Related to content of the project itself topic: gRPC Related to the gRPC interface type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Platform versions incompatible with host architecture are offered unnecessarily
5 participants