Skip to content

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

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

Closed
3 tasks done
alranel opened this issue Feb 24, 2023 · 1 comment · Fixed by #2207
Closed
3 tasks done

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

alranel opened this issue Feb 24, 2023 · 1 comment · Fixed by #2207
Assignees
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@alranel
Copy link
Contributor

alranel commented Feb 24, 2023

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
@alranel alranel added the type: imperfection Perceived defect in any part of project label Feb 24, 2023
@alranel alranel changed the title Empty platform name in error message after platform upgrade Improve the message printed when a core is already up-to-date Feb 24, 2023
@cmaglie
Copy link
Member

cmaglie commented Jun 9, 2023

The message been fixed somehow in 0.33.0

$ arduino-cli core upgrade arduino:avr
Si è verificato un errore durante l'aggiornamento: La piattaforma 'arduino:avr' è già aggiornata all'ultima versione
$ LANG=en arduino-cli core upgrade arduino:avr
Error during upgrade: Platform 'arduino:avr' is already at the latest version
$ echo $?
1

BTW the exit code is still 1, I agree that it should be 0, so I'll keep this open for that.

@cmaglie cmaglie added this to the Arduino CLI 0.34.0 milestone Jun 9, 2023
@alessio-perugini alessio-perugini linked a pull request Jun 9, 2023 that will close this issue
6 tasks
@per1234 per1234 added the topic: code Related to content of the project itself label Jun 12, 2023
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: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants