Skip to content

Improve the message printed when a core is already up-to-date #2086

Closed
@alranel

Description

@alranel

Describe the problem

% arduino-cli core upgrade arduino:avr
Error during upgrade: Platform '' is already at the latest version

Empty string is used in the message.

To reproduce

see above

Expected behavior

  1. I'd expect the error message to contain the name of the platform.
  2. Bonus points if it contains also the current version number, which helps a lot in troubleshooting.
  3. I wonder if printing an error and exiting with 130 is the right thing here. A common pattern for upgrade commands in many tools is to say "xxx is already at the latest version" and exit with 0, thus adopting the "no-op" semantics rather than "failure".
    For instance, brew upgrade arduino-cli prints "Warning: arduino-cli 0.31.0 already installed" and exits with 0. apt-get upgrade arduino-cli does the same.
    The advantage of the no-op semantics is that in a script you can assume that exit code == 0 means that the resource is now up-to-date (regardless of whether an upgrade was performed now). With the current behavior of arduino-cli, non-zero exit code may mean both temporary failure or package up-to-date which is ambiguous in the context of the caller script.)

Arduino CLI version

arduino-cli Version: 0.31.0 Commit: 940c945 Date: 2023-02-20T15:09:19Z

Operating system

macOS

Operating system version

10.15.7

Additional context

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details

Metadata

Metadata

Labels

topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions