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

Host Software Table: Add vulnerability filters to API and UI #26995

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

RachelElysia
Copy link
Member

@RachelElysia RachelElysia commented Mar 10, 2025

Issue

For #22445

Description

Screenshots/screenrecordings

TODO

Checklist for submitter

If some of the following don't apply, delete the relevant line.

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes
  • A detailed QA plan exists on the associated ticket (if it isn't there, work with the product group's QA engineer to add it)
  • Manual QA for all new/changed functionality

Copy link

codecov bot commented Mar 10, 2025

Codecov Report

Attention: Patch coverage is 19.73684% with 61 lines in your changes missing coverage. Please review.

Project coverage is 63.96%. Comparing base (129e9d5) to head (fd722f2).
Report is 111 commits behind head on main.

Files with missing lines Patch % Lines
...ages/hosts/details/cards/Software/HostSoftware.tsx 2.94% 33 Missing ⚠️
server/datastore/mysql/software.go 41.17% 15 Missing and 5 partials ⚠️
...s/Software/HostSoftwareTable/HostSoftwareTable.tsx 0.00% 6 Missing ⚠️
...ftwarePage/SoftwareTitles/SoftwareTable/helpers.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #26995      +/-   ##
==========================================
- Coverage   63.99%   63.96%   -0.03%     
==========================================
  Files        1695     1707      +12     
  Lines      161602   163021    +1419     
  Branches     4299     4384      +85     
==========================================
+ Hits       103412   104276     +864     
- Misses      50166    50612     +446     
- Partials     8024     8133     +109     
Flag Coverage Δ
backend 64.74% <41.17%> (-0.02%) ⬇️
frontend 54.43% <2.38%> (-0.15%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

@RachelElysia RachelElysia marked this pull request as ready for review March 10, 2025 17:53
@RachelElysia RachelElysia requested review from a team as code owners March 10, 2025 17:53
@RachelElysia
Copy link
Member Author

Heads up we are doing this order from @ksykulev in this slack thread:

What we're going to do >
Take out the software name and cve name match into a new issue
merge Rachel's PR
merge my PR (i'll do the merge conflict resolution)
work on the new issue that will add software name + cve name matching
That way the commit history makes sense. And during testing, we can test all 3 issues at once.

@iansltx iansltx assigned ksykulev and unassigned iansltx Mar 10, 2025
}
}
@media (max-width: $break-sm) {
@media (max-width: ($break-lg - 1)) {
.status__cell {
display: none;
width: 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! Looks good on a small screen as well:
Screenshot 2025-03-10 at 6 46 01 PM
Screenshot 2025-03-10 at 6 46 14 PM

return nil, nil, fleet.NewInvalidArgumentError(
"query", "min_cvss_score, max_cvss_score, and exploit can only be provided with vulnerable=true",
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we care about any validations on MinimumCVSS is less than MaximumCVSS?

Copy link
Member Author

Choose a reason for hiding this comment

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

It'll just return no items right? I don't really care either way

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup! It will just return 0 items. Was just curious how in depth or validations get. 👍
This is a non-blocking.

Copy link
Member Author

Choose a reason for hiding this comment

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

sgtm, yeah idk, I'm not familiar with BE patterns for invalid options

Copy link
Contributor

ksykulev
ksykulev previously approved these changes Mar 11, 2025
Copy link
Contributor

@ksykulev ksykulev left a comment

Choose a reason for hiding this comment

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

These look good to me 👍

Copy link
Member

@iansltx iansltx left a comment

Choose a reason for hiding this comment

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

One code style thing, one legit question. Otherwise LGTM on the frontend side!

Comment on lines 300 to 304
const { available_for_install } = queryParams;
if (available_for_install) {
return "installableSoftware";
}
return "allSoftware";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const { available_for_install } = queryParams;
if (available_for_install) {
return "installableSoftware";
}
return "allSoftware";
return queryParams.available_for_install ? "installableSoftware" : "allSoftware";

Non-blocking, but the one-liner seems clear enough?

Copy link
Member Author

Choose a reason for hiding this comment

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

💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants