Skip to content

Fix date for state change in vulnerability discussions

Lorenz van Herwaarden requested to merge fix-history-entry-created-date into master

What does this MR do and why?

Related #428190 (closed)

The history entry notes on the vulnerability details pages shows the updatedAt date for both the state change and the comment. This is incorrect because the updated at date only reflects when the comment was added, not when the original state change was done. The state can't be changed later because that would generate a new entry in the history.

This MR fixes this by using the createdAt date of the system note for the state change date.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
Screenshot_2024-01-10_at_07.34.13 Screenshot_2024-01-10_at_07.29.28

How to set up and validate locally

Prerequisites

  1. You need an EE license
  2. You need to have runners enabled (See $2408961 for setting up a runner)
  3. Import https://gitlab.com/gitlab-examples/security/security-reports
  4. Run a pipeline on master

Validate

  1. Go to any vulnerability details page from the vulnerability report
  2. Change the state
  3. Wait a moment and add a comment in the state change history entry below in the discussions
  4. Validate that the date of the state change reflects the time you changed the state
  5. Validate that the date of the comment reflects the time you added the comment

Merge request reports

Loading