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

Added --no-check-for-updates in version command #2272

Closed
wants to merge 1 commit into from

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Aug 21, 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?

Adds the new flag --no-check-for-updates that disable the automatic check for new versions in the version command and print the current version without any delay.

What is the current behavior?

$ time ./arduino-cli version 
arduino-cli  Versione: 0.34.0-rc.1 Commit: 38479dc70 Data: 2023-08-21T14:55:23Z

real	0m1,464s
user	0m0,058s
sys	0m0,030s
$

What is the new behavior?

$ time ./arduino-cli version --no-check-for-updates
arduino-cli  Versione: git-snapshot Commit: 5a13de328 Data: 2023-08-21T14:53:24Z

real	0m0,020s
user	0m0,005s
sys	0m0,018s
$

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

Other information

@cmaglie cmaglie added type: enhancement Proposed improvement topic: CLI Related to the command line interface labels Aug 21, 2023
@cmaglie cmaglie self-assigned this Aug 21, 2023
@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Patch coverage: 50.00% and project coverage change: +0.04% 🎉

Comparison is base (38479dc) 62.93% compared to head (5a13de3) 62.98%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2272      +/-   ##
==========================================
+ Coverage   62.93%   62.98%   +0.04%     
==========================================
  Files         221      221              
  Lines       19730    19748      +18     
==========================================
+ Hits        12418    12439      +21     
+ Misses       6209     6207       -2     
+ Partials     1103     1102       -1     
Flag Coverage Δ
unit 62.98% <50.00%> (+0.04%) ⬆️

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

Files Changed Coverage Δ
internal/cli/version/version.go 56.75% <50.00%> (-0.39%) ⬇️

... and 2 files with indirect coverage changes

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

@MatteoPologruto
Copy link
Contributor

Question: can't it already be achieved by setting updater.enable_notification to false? #2055

@cmaglie
Copy link
Member Author

cmaglie commented Aug 21, 2023

no, version ignores that flag

Copy link
Contributor

@umbynos umbynos left a comment

Choose a reason for hiding this comment

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

Actually @MatteoPologruto is right, it was fixed in #2055

❰umberto❙~/Nextcloud/8tb/Lavoro/arduino-cli(git≠master)❱✔≻ arduino-cli config set updater.enable_notification true
❰umberto❙~/Nextcloud/8tb/Lavoro/arduino-cli(git≠master)❱✔≻ rm ~/.arduino15/inventory.yaml 
❰umberto❙~/Nextcloud/8tb/Lavoro/arduino-cli(git≠master)❱✔≻ time arduino-cli version
arduino-cli  Version: 0.33.1 Commit: 347bfeb0 Date: 2023-06-30T15:32:47Z

________________________________________________________
Executed in  919.12 millis    fish           external
   usr time   49.31 millis    1.35 millis   47.95 millis
   sys time   38.81 millis    0.45 millis   38.36 millis

❰umberto❙~/Nextcloud/8tb/Lavoro/arduino-cli(git≠master)❱✔≻ arduino-cli config set updater.enable_notification false
❰umberto❙~/Nextcloud/8tb/Lavoro/arduino-cli(git≠master)❱✔≻ rm ~/.arduino15/inventory.yaml
❰umberto❙~/Nextcloud/8tb/Lavoro/arduino-cli(git≠master)❱✔≻ time arduino-cli version
arduino-cli  Version: 0.33.1 Commit: 347bfeb0 Date: 2023-06-30T15:32:47Z

________________________________________________________
Executed in   37.48 millis    fish           external
   usr time   16.05 millis    1.10 millis   14.94 millis
   sys time   10.34 millis    0.38 millis    9.96 millis

@cmaglie
Copy link
Member Author

cmaglie commented Aug 21, 2023

You're right 🤔, apologies guys.

Actually, it's also possible to override it with the env var ARDUINO_UPDATER_ENABLE_NOTIFICATION=false:

ARDUINO_UPDATER_ENABLE_NOTIFICATION=false ./arduino-cli version

so, @kittaakos I think you're all set with the current Arduino CLI, no need to patch it :-)

@cmaglie cmaglie closed this Aug 21, 2023
@cmaglie cmaglie added the conclusion: invalid Issue/PR not valid label Aug 21, 2023
@cmaglie cmaglie deleted the selective_version_check branch August 21, 2023 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: invalid Issue/PR not valid topic: CLI Related to the command line interface type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants