Fix date for state change in vulnerability discussions
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 |
---|---|
How to set up and validate locally
Prerequisites
- You need an EE license
- You need to have runners enabled (See $2408961 for setting up a runner)
- Import https://gitlab.com/gitlab-examples/security/security-reports
- Run a pipeline on master
Validate
- Go to any vulnerability details page from the vulnerability report
- Change the state
- Wait a moment and add a comment in the state change history entry below in the discussions
- Validate that the date of the state change reflects the time you changed the state
- Validate that the date of the comment reflects the time you added the comment