-
-
Notifications
You must be signed in to change notification settings - Fork 398
Add board search command and gRPC interface function #1210
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
@kittaakos you probably want to test this. |
The search result order is not deterministic. I get back the boards in a different order when searching with the same term: screencast.2021-03-04.14-35-36.mp4 |
Yep, that's not good. I'd say I could order them alphabetically, first the installed ones then the rest. |
It would be already a great improvement.
I am not sure about this 👆 part. |
I get unrelated matches. Search for
Why is Arduino Uno in the resultset when the term is {
"name": "Arduino Uno",
"FQBN": "arduino:avr:uno",
"platform": {
"ID": "arduino:avr",
"Installed": "1.8.3",
"Latest": "1.8.3",
"Name": "Arduino AVR Boards",
"Maintainer": "Arduino",
"Website": "http://www.arduino.cc/",
"Email": "[email protected]"
}
} |
This is rather a request and related to the I assume the match comes from the match on the ID of the platform: [
{
"name": "Arduino Portenta H7",
"platform": {
"ID": "arduino:mbed",
"Latest": "1.3.2",
"Name": "Arduino mbed-enabled Boards",
"Maintainer": "Arduino",
"Website": "http://www.arduino.cc/",
"Email": "[email protected]"
}
},
{
"name": "Arduino Nano 33 BLE",
"platform": {
"ID": "arduino:mbed",
"Latest": "1.3.2",
"Name": "Arduino mbed-enabled Boards",
"Maintainer": "Arduino",
"Website": "http://www.arduino.cc/",
"Email": "[email protected]"
}
}
] Can the gRPC API expose a flag to restrict the search to the |
@ubidefeo, can you please chime in and check if this is what we need in the new IDE? Thank you! |
I won't do it then. 👍 Sadly the fuzzy search is kind of a double edge sword, thus the results above.
Yes, it's probably that. The library I'm using for fuzzy searching returns the Levenshtein distance of the match, in this case I discard all results that have a distance greater than 20. Some times it's good, some times it's not, it all depends on the searched term and the boards' name/fqbn. If I don't discard those searching for a small string like I know it's not perfect, I don't like it either, am thinking of reverting all the fuzzy search changes cause of this.
I can do it but I'd like to keep the CLI and the gRPC interface aligned, so I'd do it for both. |
I think it would be useful to search the boards by only the |
I've updated the PR, now the results are sorted alphabetically and the search arg acts only on the boards name. |
I've changed it again, it should be much more reliable now. Now it uses a similar logic used by the Java IDE libraries search, I enhanced it a bit so that accents and other similar diatrics are removed before trying to match the search query case insensitively; this way we can still match Fuzzy search has been completely removed for this new command and I will do the same for other commands after this PR is merged. @ubidefeo tested this using the CLI and is happy about the result, let me know if it's fine for the IDE too @kittaakos. |
I am OK with the changes. The gRPC API remains the same no matter there is support for the fuzzy match or not. |
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
Please check if the PR fulfills these requirements
before creating one)
UPGRADING.md
has been updated with a migration guide (for breaking changes)Adds a new CLI command and related gRPC interface function.
There is currently no way to get or search a list of boards from installed and installable platforms, manually installed platforms are included in the search.
A new
board search
command and its related gRPC interface can now be used to get a list of boards from installed and installable platforms.Sample output:
Sample json output:
FQBN
is omitted if a board's platform is not installed because that information is not present in theindex.json
file but only in theboards.txt
file.The result can be filtered passing one or more argument to the command, a fuzzy search is done to return all boards that closely match the arg string:
Nope.
None.
See how to contribute