Skip to content

Replace incident route with issue route

James Rushford requested to merge replace-incident-route-with-issues into master

What does this MR do and why?

Describe in detail what your merge request does and why.

Part of resolving #367856, required for added routing for tabs in incidents. This is a split off from !103414 (closed) as it got too large.

Previous to the MR, the routing for incidents was served via project route config.

This became an issue when it was required to pass the current url to incident pages for routing setup. The change needed is detailed in the changes made to ee/spec/helpers/ee/issuables_helper_spec.rb#L285 in !103414 (closed) where we are calling currentPath: url_for(safe_params) (link here).

url_for cannot always be called from project route, so the method call breaks a bunch of tests when implemented.

The change this MR introduces is to move incident routing to the issue route. This change requires a change to any function that requests the path for incidents, so each of these method calls has been replaced in this MR.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Create an incident via Monitor -> Incidents on left hand menu
  2. Access route using both issues path project/-/issues/35/ and incident path project/-/issues/incident/35/
  3. (I'm new to backend so forgive me if this is redundant) ensure that incident_project_issues_path(project, incident) does actually return a path similar to project/-/issues/incident/35/ (all the updated tests will also do this)

MR acceptance checklist

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

Edited by James Rushford

Merge request reports