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

Made core search results more similar to Arduino IDE 1.8.x search dialog #1904

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
cmaglie merged 5 commits into arduino:master from cmaglie:extend_core_search
Oct 4, 2022

Conversation

Copy link
Member

@cmaglie cmaglie commented Oct 4, 2022

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)

What kind of change does this PR introduce?

Made core search results more similar to Arduino IDE 1.8.x search dialog

What is the current behavior?

Search results are slightly different from Arduino IDE 1.8.x (especially if the query contains non-alphanumeric charactes)

What is the new behavior?

The search result should be the same (or at least much more similar)

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

No breaking

Other information

for reference the Arduino IDE 1.8.x uses this filter function:

 // Filter ContributedPlatformReleases based on search terms
 contributions.removeIf(releases -> {
 for (ContributedPlatform platform : releases.releases) {
 String compoundTargetSearchText = platform.getName() + "\n"
 + platform.getBoards().stream()
 .map(ContributedBoard::getName)
 .collect(Collectors.joining(" "));
 if (!filter.test(platform)) {
 continue;
 }
 if (!stringContainsAll(compoundTargetSearchText, filters))
 continue;
 return false;
 }
 return true;
 });

In the current implementation of the arudino-cli we use some more fields to extend the search (like FQBN or vendor URL).

@cmaglie cmaglie self-assigned this Oct 4, 2022
@cmaglie cmaglie added type: enhancement Proposed improvement priority: medium Resolution is a medium priority topic: code Related to content of the project itself criticality: medium Of moderate impact labels Oct 4, 2022
Copy link

codecov bot commented Oct 4, 2022
edited
Loading

Codecov Report

Base: 36.72% // Head: 36.69% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (28dd57d) compared to base (02e8c77).
Patch coverage: 90.00% of modified lines in pull request are covered.

Additional details and impacted files
@@ Coverage Diff @@
## master #1904 +/- ##
==========================================
- Coverage 36.72% 36.69% -0.04% 
==========================================
 Files 231 231 
 Lines 19724 19710 -14 
==========================================
- Hits 7244 7232 -12 
 Misses 11648 11648 
+ Partials 832 830 -2 
Flag Coverage Δ
unit 36.69% <90.00%> (-0.04%) ⬇️

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

Impacted Files Coverage Δ
commands/core/search.go 80.00% <81.25%> (-1.36%) ⬇️
arduino/utils/search.go 64.10% <100.00%> (-15.31%) ⬇️
commands/lib/search.go 90.76% <100.00%> (-1.74%) ⬇️
arduino/monitor/monitor.go 45.78% <0.00%> (+4.73%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

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

I did manual testing and compared the lib/platform search results with IDE 1.x.

I used the following CLI:

arduino-cli Version: test-1904-764d010f66cb2bf39885c94627c8a375d4eddec4-git-snapshot Commit: 764d010f Date: 2022年10月04日T10:05:08Z

All in all, it's working great. I mainly focused on the query terms listed in arduino/arduino-ide#1442.

I have noticed one regression, but I would call it an improvement.

When I search for yun with IDE 1.x, I have zero results.

Screen Shot 2022年10月04日 at 15 38 18

With the CLI from this PR, it lists the container platform.

/arduino-cli core search "yun" --config-file ~/.arduinoIDE/arduino-cli.yaml 
ID Version Name 
arduino:avr 1.8.5 Arduino AVR Boards

Thank you!

cmaglie reacted with thumbs up emoji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@per1234 per1234 Awaiting requested review from per1234

@umbynos umbynos Awaiting requested review from umbynos

1 more reviewer

@kittaakos kittaakos kittaakos approved these changes

Reviewers whose approvals may not affect merge requirements
Labels
criticality: medium Of moderate impact priority: medium Resolution is a medium priority 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.

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