Skip to content

Move the refresh header query to parent

What does this MR do and why?

Move the refresh header query to parent

As part of #228746 we are changing the fetching of a vulnerability to GraphQL. Currently, it's being injected through HAML. Since the GraphQL fields are still not complete, we decided to go step by step and work on this iteratively. The first step is moving the refetching of the header to the vulnerability component.

Screenshots or screen recordings

UI-wise nothing significant changes here. The only change is when the footer updates the header, the reload effect has been removed. This happens only because the footer keeps polling for discussions, and when it finds a system note with state change it notifies the header so that the header refreshes itself. Since this is a very rare case for the user to see it, I thought not adding additional complexity.

Despite not having any signification UI change here's screencast that shows that it works properly.

I first update the state. Then change the tab and update it again and change the tab back. Wait for footer to poll the changes and update the header.

vuln-header-change

How to set up and validate locally

If you already have a working runner, skip to the bullet-list below.

You should have the runner installed in order to run the pipeline. Then using the following command you can register the runner, it guides you pretty good on how to set the runner:

$ gitlab-runner register

Once it's installed this is how I run the runner:

$ gitlab-runner --log-level debug run local-runner --config ~/.gitlab-runner/config.toml restart

After you got the runner running:

  1. Clone https://gitlab.com/gitlab-examples/security/security-reports/
  2. Run the pipeline by going into Your project > CI/CD > Pipelines
  3. Click on run pipeline for master branch
  4. Go to Security & Compliance > Vulnerability Report
  5. Click on a vulnerability
  6. Play around with the dropdown on the header, it should reflect the changes when the state is updated.

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 #228746

Edited by Savas Vedova

Merge request reports