Skip to content

Conversation

@LightOfHeaven1994
Copy link
Contributor

@LightOfHeaven1994 LightOfHeaven1994 commented Nov 28, 2025

Adding Applies to OS filter for CVEs page.

How to test

  1. Have few different systems (differrent major/minor versions) reported with CVEs
  2. Navigate to IoP page and check if filter works
  3. Select Major version and see all minor versions have been selected and applied correctly
  4. Select Major.Minor version and see if filter works correctly
Screenshot 2025-12-02 at 15 16 37

Summary by Sourcery

Add OS applicability filtering and column updates to IoP vulnerability CVE views, adjust styling, and integrate Tekton build pipelines for the Satellite IoP frontend.

New Features:

  • Introduce an "Applies to OS" hierarchy filter on the CVE list, driven by operating system versions fetched from inventory.
  • Expose RHEL versions as a column in the IoP CVE list and use last upload time as the primary timestamp column in CVE detail views.

Enhancements:

  • Set explicit OUIA IDs on key IoP tables to improve testability and observability.
  • Update the CVE list and detail page layout styling, including a white main-section background and flat Dashbar cards.
  • Switch CVE detail default sorting and column keys from generic updated to last_upload for clearer semantics.

Build:

  • Upgrade the declarative-table dependency to version 5.1.1.
  • Add Tekton PipelineRun definitions for pull-request and push builds of the iop-vulnerability-frontend-sat-6-18 component.

CI:

  • Configure Tekton pipelines-as-code triggers for PR and push events on the foreman-3.16 branch of the IoP vulnerability frontend.

Summary by Sourcery

New Features:

  • Introduce an "Applies to OS" hierarchy filter on the CVE list using operating system version data from inventory.

@LightOfHeaven1994 LightOfHeaven1994 self-assigned this Nov 28, 2025
@sourcery-ai
Copy link

sourcery-ai bot commented Nov 28, 2025

Reviewer's Guide

Adds an "Applies to OS" hierarchical filter to the IoP CVE list, wiring it to inventory-provided OS versions and exposing the new filter in the IoP environment configuration so it participates in the standard toolbar filtering system.

Sequence diagram for Applies to OS filter loading and application

sequenceDiagram
  actor User
  participant CveListTable
  participant ReactQuery_useQuery as ReactQuery_useQuery
  participant InventoryAPI
  participant AppliesToOSFilterUtils
  participant CVEBackend as CVE_API

  User->>CveListTable: Open_IoP_CVEs_page
  CveListTable->>ReactQuery_useQuery: useQuery(queryKey OsVersions, queryFn)
  ReactQuery_useQuery->>InventoryAPI: GET /system_profile/operating_system
  InventoryAPI-->>ReactQuery_useQuery: 200 OK results[value]
  ReactQuery_useQuery-->>CveListTable: osVersionData
  CveListTable->>AppliesToOSFilterUtils: convertOperatingSystemsToFilterGroupItems(version_values)
  AppliesToOSFilterUtils-->>CveListTable: osVersionFilterItems
  CveListTable->>CveListTable: Build_hierarchyFilter(urlParam rhel_version, groups osVersionFilterItems)
  User->>CveListTable: Select_Applies_to_OS_value
  CveListTable->>CVEBackend: Fetch_CVEs_with_param_rhel_version
  CVEBackend-->>CveListTable: Filtered_CVEs
  CveListTable-->>User: Render_filtered_CVE_table
Loading

Updated class diagram for CveListTable and IoP environment context filters

classDiagram
  class CveListTable {
    +DEFAULT_PARAMS
    +CveListTable()
    +ENV_CONTEXT_FILTER_FILTER(filter)
    +cvssMin
    +cvssMax
    +filters_including_rhel_version
  }

  class ReactQuery_useQuery {
    +useQuery(options)
  }

  class Axios {
    +get(url)
  }

  class AppliesToOSFilterUtils {
    +convertOperatingSystemsToFilterGroupItems(versions)
  }

  class IOP_ENVIRONMENT_CONTEXT {
    +cveList_title
    +cveList_columns
    +cveList_filters_including_rhel_version
    +cveList_areColumnsManageable
    +cveList_areParamsUrlBound
  }

  CveListTable ..> ReactQuery_useQuery : uses_for_OsVersions
  CveListTable ..> Axios : fetches_os_versions
  CveListTable ..> AppliesToOSFilterUtils : builds_Applies_to_OS_filter_groups
  CveListTable ..> IOP_ENVIRONMENT_CONTEXT : obeys_filter_config_including_rhel_version
Loading

File-Level Changes

Change Details Files
Wire inventory operating-system versions into the CVE list and expose them as a hierarchical "Applies to OS" filter.
  • Introduce a React Query call to fetch operating_system data from the inventory system_profile endpoint with a default empty result.
  • Transform fetched OS version records into filter group items via convertOperatingSystemsToFilterGroupItems and feed them into a hierarchyFilter config block for the primary toolbar.
  • Append the new hierarchy filter configuration (backed by rhel_version URL param) to the existing filters array on the CVE list table.
src/Components/SmartComponents/IoP/CveListTable.js
Register the new rhel_version filter in the IoP environment context configuration for the CVE list view.
  • Extend the CVE list filter configuration to include the rhel_version filter key alongside existing filters so the shared toolbar knows to render it.
src/Helpers/constants.js

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

@LightOfHeaven1994 LightOfHeaven1994 changed the title Rhineng 21983 feat(RHINENG-21983): Add 'Applies to OS' filter CVEs table Nov 28, 2025
@LightOfHeaven1994 LightOfHeaven1994 marked this pull request as ready for review December 2, 2025 14:18
@LightOfHeaven1994 LightOfHeaven1994 requested a review from a team as a code owner December 2, 2025 14:18
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • Consider including envContext.apiPaths.inventory (or the full URL string) in the useQuery queryKey so that if the inventory API path changes at runtime the OS versions query will refetch appropriately instead of reusing a stale cache entry.
  • You may want to guard osVersionData?.data?.results or memoize the osVersionFilterItems with useMemo to avoid recomputing the filter groups on every render and to make the component more robust if the shape of the query data changes.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider including `envContext.apiPaths.inventory` (or the full URL string) in the `useQuery` `queryKey` so that if the inventory API path changes at runtime the OS versions query will refetch appropriately instead of reusing a stale cache entry.
- You may want to guard `osVersionData?.data?.results` or memoize the `osVersionFilterItems` with `useMemo` to avoid recomputing the filter groups on every render and to make the component more robust if the shape of the query data changes.

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.

Copy link
Member

@bastilian bastilian left a comment

Choose a reason for hiding this comment

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

Awesome! Nice work! Thank you very much for implementing this @LightOfHeaven1994!

@jira-linking
Copy link

jira-linking bot commented Dec 4, 2025

Referenced Jiras:
https://issues.redhat.com/browse/RHINENG-21983

@LightOfHeaven1994 LightOfHeaven1994 enabled auto-merge (squash) December 4, 2025 11:42
@LightOfHeaven1994 LightOfHeaven1994 merged commit 216e87e into RedHatInsights:master Dec 4, 2025
7 of 8 checks passed
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.

2 participants