Issue/incident page links open threat monitoring alerts in alert managment details page
Summary
When a user clicks navigates to the incident/issue page from a threat monitoring alert, the page has a couple of links allowing the user to navigate back to the alert, but the links navigate the user to alert_management/:id/details#/
for all alerts when it should discern between alert_management and threat monitoring alerts.
Steps to reproduce
- Navigate to a project with threat monitoring alerts (e.g. https://staging.gitlab.com/defend-team-test/cnp-alert-demo)
- Navigate to a threat monitoring alerts
- Select an alert and navigate to its details page
- Click
Create incident
button in the top right. You should be navigated to an issue/incident page - Click on one of the couple of alert links on the page to navigate back to the alert details page
Example Project
https://staging.gitlab.com/defend-team-test/cnp-alert-demo/-/issues/2
What is the current bug behavior?
Clicking one of the alert links to navigate back to the alert ALWAYS takes the user to the alert management details page
What is the expected correct behavior?
Clicking one of the alert links to navigate back to the alert should know whether the user should go to the alert management or threat monitoring details page
Relevant logs and/or screenshots
Possible fixes
There are two links on the page that point to the details page
- comes from a
getAlerts
query in incident_tabs, which is thedetails_url
field on the alert graphql type, so this is going to be backend work to update thedetails_url
based onmonitoring_tool
(here)-
backend update https://gitlab.com/gitlab-org/gitlab/blob/b348db3cb7a68cf56510a84df2798a13414914f3/app/presenters/alert_management/alert_presenter.rb#L34 to generate the url based on alert.domain
-
- is unfortunately saved in the DB, so there will need to be some backend work for that to save a different URL when a user clicks the
Create Issue
button on the alert details page (probably here and probably a DB migration to fix the previous versions of it:-
backend ensure that proper value of details_url
is taken in https://gitlab.com/gitlab-org/gitlab/blob/b2626bcb4cd4eac20cfe1028b2eb5508a6048f86/app/services/alert_management/create_alert_issue_service.rb#L49
-
Edited by Alan (Maciej) Paruszewski