Skip to content

Fix cluster filter url naviation bug

What does this MR do and why?

Fix cluster filter url naviation bug

  • when a user selected a cluster filter, the agent name gets appended to the URL
  • when a user then tries to share this URL, the cluster agent wasn't being applied to the filter on page load
  • this was because the SimpleFilter mixin only checks the filters when the 'options' property changes
  • I have overridden the 'options' property in the cluster filter so that it changes when the cluster filter options are retrieved, which then rechecks the url paramaters and reapplies them

NOTE: This is a bandaid fix; the real fix is to abstract the query syncing code from the simple_filter.vue "mixin" (it was never intended to be one, but it is now) and replace it with a new query_path_sync.vue component as described in Abstract out Vulnerability Report filter query ... (#367557), but that is another conversation

Changelog: fixed

EE: true

Screenshots or screen recordings

Before After
cluster_filter_-_b cluster_filter_-_a

How to set up and validate locally

    1. Ensure your GDK has a GitLab Ultimate license
  1. Ensure your GDK is connected to the GitLab Runner
  2. Follow these docs to set up the kubernetes agent
  3. Clone test-cis-with-agentid and run the pipeline
  4. Link the agent to a project
  5. Run the pipeline to generate vulnerabilities
  6. Navigate to the agent/vulnerability report
  7. View the vulnerabilities
  8. Set the cluster filter and verify the URL parameter appears in the URL
  9. Refresh the page and verify the URL parameter is applied to the filter

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #337882 (closed)

Merge request reports