Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
kittaakos merged 1 commit into main from #1572
Jan 11, 2023
Merged

feat: no remote fetch when IDE gets CLI version #1802

kittaakos merged 1 commit into main from #1572
Jan 11, 2023

Conversation

Copy link
Contributor

@kittaakos kittaakos commented Jan 6, 2023

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

Other information

If the CLI version is a pinned commitish and not a semver, IDE2 will show the commitsh.

Assuming the following pinned CLI version:

diff --git a/arduino-ide-extension/package.json b/arduino-ide-extension/package.json
index 1b7cc2de..ab4414ea 100644
--- a/arduino-ide-extension/package.json
+++ b/arduino-ide-extension/package.json
@@ -159,7 +159,7 @@
 ],
 "arduino": {
 "cli": {
- "version": "0.29.0"
+ "version": "alma"
 },
 "fwuploader": {
 "version": "2.2.2"

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 on core index-update or lib install but not on version.

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

the CLI version is retrieved from the `package.json` of the extension:
`arduino.cli.version`
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@kittaakos kittaakos added type: enhancement Proposed improvement topic: code Related to content of the project itself topic: CLI Related to Arduino CLI labels Jan 6, 2023
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

Thanks Akos!

Copy link
Contributor

@AlbyIanna AlbyIanna left a 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.

@kittaakos kittaakos merged commit da0fecf into main Jan 11, 2023
@kittaakos kittaakos deleted the #1572 branch January 11, 2023 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@per1234 per1234 per1234 approved these changes

+1 more reviewer

@AlbyIanna AlbyIanna AlbyIanna approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
topic: CLI Related to Arduino CLI topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Use more efficient method to get Arduino CLI version

AltStyle によって変換されたページ (->オリジナル) /