Skip to content

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
merged 5 commits into from
Oct 4, 2022

Conversation

cmaglie
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
@codecov
Copy link

codecov bot commented Oct 4, 2022

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.

@cmaglie cmaglie force-pushed the extend_core_search branch from 24b6192 to 28dd57d Compare October 4, 2022 13:35
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-04T10: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 cmaglie merged commit 1021e76 into arduino:master Oct 4, 2022
@cmaglie cmaglie deleted the extend_core_search branch October 4, 2022 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Development

Successfully merging this pull request may close these issues.

2 participants