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

Use more efficient method to get Arduino CLI version #1572

Closed
3 tasks done
per1234 opened this issue Oct 21, 2022 · 4 comments · Fixed by #1802
Closed
3 tasks done

Use more efficient method to get Arduino CLI version #1572

per1234 opened this issue Oct 21, 2022 · 4 comments · Fixed by #1802
Assignees
Labels
conclusion: resolved Issue was resolved topic: CLI Related to Arduino CLI topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@per1234
Copy link
Contributor

per1234 commented Oct 21, 2022

Use more efficient method to get Arduino CLI version

Describe the request

Employ a technique for obtaining the version of the bundled Arduino CLI that does not trigger the pointless update check.

🙂 The Help > About Arduino IDE menu item will be responsive.

Describe the current behavior

The Help > About Arduino IDE menu item opens a dialog which displays information about the Arduino IDE. This includes the version of the bundled copy of Arduino CLI.

The Arduino CLI version is obtained by running the following command:

arduino-cli version --format json

In addition to displaying the version, this command triggers a check for the availability of a newer version of Arduino CLI:

https://github.com/arduino/arduino-cli/blob/5efa9b5d3596d4dd88f16813d1018f3f60481b05/cli/version/version.go#L61

While that update check is useful to the users running the command directly, it is completely pointless for this application, both because the IDE does not even use the information about availability of an update and because the IDE is designed to use a specific version of Arduino CLI and updating the bundled Arduino CLI to a new version is strongly discouraged.

For unknown reasons (perhaps transient network conditions), this update check sometimes takes on the order of a few seconds to complete.

🙁 The dialog opening is blocked while waiting, which is a poor experience for the user who will frustrated that such a simple dialog should be so slow to open.

ide

Arduino IDE version

2.0.1-snapshot-32d904c

Operating system

Windows

Operating system version

10

Additional context

The update check will not be done when a non-release version of Arduino CLI is bundled with the IDE, so make sure your IDE meets that condition if trying to reproduce the slow dialog opening.


The slow update check is intermittent. It does happen frequently though so you should be able to reproduce it within several cycles of opening and closing the dialog.


Previously discussed in passing at #1289 (comment)

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest nightly build
  • My request contains all necessary details
@kittaakos
Copy link
Contributor

IDE2 wants to use the command line interface to get the version. It must work when something bad happens with the core gRPC client, or there is no connection to the daemon. I wrote the reasons here: #1289 (comment). The version must be available. Otherwise, users cannot specify the details when submitting a bug report.

I agree that the remote version check is not needed. CLI should provide a flag not to perform the update check when simply printing the version, and IDE2 will start using this new flag.

@per1234
Copy link
Contributor Author

per1234 commented Oct 24, 2022

An alternative would be to just get it from the arduino.cli.version field of arduino-ide-extension/package.json.

That won't be correct if someone swapped out the arduino-cli executable from the IDE installation, but the likelihood of that actually being a real world problem is probably incredibly low:

So far, there has never been a single time I found the need for this Arduino CLI version information in years of supporting IDE users. From a purely statistical point of view, this indicates that the information will be needed only rarely.

I have not seen any evidence that users are swapping out the Arduino CLI executable, nor any evidence that they are interested in doing this. So the chances of the Arduino CLI version in use not matching that in the package.json is very low.

The users who would swap out the Arduino CLI executable will be more advanced users, who are more likely to understand this is significant and mention it in support requests and bug reports.

@kittaakos kittaakos self-assigned this Oct 24, 2022
@kittaakos
Copy link
Contributor

I am OK with removing the commit hash of the CLI if @ubidefeo is OK with it. Originally, the CLI details were requested to be part of the About dialog in ATL-663.

@kittaakos kittaakos added the status: waiting for information More information must be provided before work can proceed label Oct 25, 2022
@per1234
Copy link
Contributor Author

per1234 commented Nov 26, 2022

Since we didn't receive any feedback after a month, I'll give the approval, for the reasons I explained above.

@per1234 per1234 removed the status: waiting for information More information must be provided before work can proceed label Nov 26, 2022
@per1234 per1234 added the conclusion: resolved Issue was resolved label Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: CLI Related to Arduino CLI topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants