-
-
Notifications
You must be signed in to change notification settings - Fork 489
feat: no remote fetch when IDE gets CLI version #1802
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
Conversation
the CLI version is retrieved from the `package.json` of the extension: `arduino.cli.version` Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Akos!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✅
On a side note though, I have noticed that this change breaks the localized string "arduino/about/detail"
when the ide language is one that has that string already translated. That happens because the number of parameters used the localized string changed from 7 to 5.
For example, if you set the language to "Italiano", you get this dialog
Screenshot 2023年01月10日 at 14 22 28
Anyway, I won't request changes in this PR because I'm not sure how we should proceed about this kind of localization issues.
Motivation
To speed up the load time of the About dialog in IDE2. As requested in #1572, IDE2 reads the CLI version from the
package.json
.Change description
2.0.3:
Screen Shot 2023年01月06日 at 09 59 43A dev build with the changes:
Screen Shot 2023年01月06日 at 10 06 39Local IDE2 build with the changes:
Screen Shot 2023年01月06日 at 10 24 32Other information
If the CLI version is a pinned commitish and not a semver, IDE2 will show the commitsh.
Assuming the following pinned CLI version:
The expected About dialog (with a dev build) is:
Screen Shot 2023年01月06日 at 10 07 45
Closes #1572
It should be possible to run
arduino-cli version --no-fetch
or similar to avoid checking for updates. I have never used a CLI tool before that does a silent remote fetch when getting the only version. If there is a good example, please let me know. CLIs usually warn about the outdated version (brew
,npm
,yarn
, etc.) when users execute a command that requires the Intenet connection. The Arduino CLI ought to warn the user oncore index-update
orlib install
but not onversion
.Reviewer checklist