Skip to content

fix: sbom Search by name instead of full search [Backport release/0.5.z]#1137

Merged
carlosthe19916 merged 1 commit into
release/0.5.zfrom
backport-1134-to-release/0.5.z
Jul 2, 2026
Merged

fix: sbom Search by name instead of full search [Backport release/0.5.z]#1137
carlosthe19916 merged 1 commit into
release/0.5.zfrom
backport-1134-to-release/0.5.z

Conversation

@trustify-ci-bot

@trustify-ci-bot trustify-ci-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Backport of #1134 to release/0.5.z.

Summary by Sourcery

Adjust SBOM search and filtering to operate on the SBOM name field instead of a generic text filter key.

Bug Fixes:

  • Ensure SBOM search queries use the name field so results align with name-based filtering expectations.

Enhancements:

  • Align SBOM filter configuration and UI controls with the explicit name filter category for consistency across search views.

Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
(cherry picked from commit 2e45be3)
@sourcery-ai

sourcery-ai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Backport change that makes SBOM search operate specifically on the SBOM name field instead of using a generic text filter, updating the search parameters, filter keys, and related UI wiring accordingly.

Sequence diagram for updated SBOM name-based search flow

sequenceDiagram
  actor User
  participant SearchMenu
  participant sbomTableControls
  participant useAllEntities
  participant useFetchSBOMs

  User->>SearchMenu: type searchValue
  SearchMenu->>sbomTableControls: filterState.setFilterValues(name=[searchValue])
  SearchMenu->>useAllEntities: useAllEntities(filterText, disableSearch)
  useAllEntities->>useFetchSBOMs: useFetchSBOMs(null, sbomParams, [], disableSearch)
  note over useFetchSBOMs: sbomParams.filters[0].field = name
Loading

File-Level Changes

Change Details Files
SBOM search now filters by the explicit "name" field instead of a generic text filter key across search and SBOM list views.
  • Introduced dedicated sbomParams in useAllEntities to query SBOMs using a name field filter with the '~' operator while keeping pagination the same.
  • Updated useFetchSBOMs invocation to use the new sbomParams instead of the shared params object used by other entities.
  • Changed appliedSearchValue in SearchMenu to read from the "name" filter key in sbomTableControls.filterState instead of FILTER_TEXT_CATEGORY_KEY.
  • Updated SearchTabs sbomFilterPanelProps generic types and omitFilterCategoryKeys to include and omit "name" rather than an empty-string category key.
  • Adjusted sbom search context and provider types so SBOM filter category keys explicitly include "name" instead of an empty-string placeholder.
  • Configured the SBOM search filter category in SbomSearchProvider to use categoryKey "name" instead of FILTER_TEXT_CATEGORY_KEY, keeping the UI label and behavior as a search field.
  • Modified Search page logic to set the SBOM table filter values under the "name" key when applying the main search input.
client/src/app/pages/search/components/SearchMenu.tsx
client/src/app/pages/search/components/SearchTabs.tsx
client/src/app/pages/sbom-list/sbom-context.ts
client/src/app/pages/sbom-list/sbom-provider.tsx
client/src/app/pages/search/search.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider avoiding the repeated hard-coded "name" filter key and instead introduce or reuse a shared constant (similar to the previous FILTER_TEXT_CATEGORY_KEY) so future changes to the key remain centralized.
  • After switching from the generic text filter to a name filter, it may be clearer to update the filter’s title/placeholderText to reflect that it specifically targets SBOM names rather than generic text.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider avoiding the repeated hard-coded "name" filter key and instead introduce or reuse a shared constant (similar to the previous `FILTER_TEXT_CATEGORY_KEY`) so future changes to the key remain centralized.
- After switching from the generic text filter to a `name` filter, it may be clearer to update the filter’s `title`/`placeholderText` to reflect that it specifically targets SBOM names rather than generic text.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.13%. Comparing base (96c9508) to head (9fdb8b7).
⚠️ Report is 2 commits behind head on release/0.5.z.

Additional details and impacted files
@@                Coverage Diff                @@
##           release/0.5.z    #1137      +/-   ##
=================================================
+ Coverage          51.10%   51.13%   +0.02%     
=================================================
  Files                256      256              
  Lines               5522     5521       -1     
  Branches            1672     1671       -1     
=================================================
+ Hits                2822     2823       +1     
+ Misses              2432     2430       -2     
  Partials             268      268              
Flag Coverage Δ
unit 6.16% <100.00%> (+0.03%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@carlosthe19916 carlosthe19916 merged commit 3427e85 into release/0.5.z Jul 2, 2026
17 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Trustify Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant