Issue type change to incident results in 404
Problem
@gerardo reported the following:
Hi team. A customer reported ( and I replicated) that on gitlab.com when they create an issue, and later on you try to change it to an Incident you get a 404 now, and the url shows
/issue/incident/<id>
. I tested this on older version of gitlab, 15.11 and as expected it works. Has anyone seen this? or know if this is a know bug?
I tested this on my local and I can reproduce the behaviour.
Investigation
We have the route:
$ rails routes -T | grep incident
shows that we do have issues/incident/123
as a route ...
incident_namespace_project_issues GET /*namespace_id/:project_id/-/issues/incident/:id(/:incident_tab)(.:format) projects/incidents#show
However, I also noticed on my local that the issue type was never updated.
Looks like incident
is no longer an allowed type for work items
So I think what's happening is that the incident type is being stripped out of the params before it hits the update bit, so it doesn't actually update the type. But it still updates everything else, such as issue metrics, and return a 200
, and the frontend sees a success message so it forwards to the incident URL, but the issue isn't an incident, resulting in a 404
.
To reproduce
- create a new issue in a project
- edit the issue and select "incident"
- save. The page refreshes as 404 with a URL of
<project_path>/-/issues/incident/iid
Workaround
GraphQL API can be used to update the incident