Fix a bug with promoting Issues with attachments to Epics
What does this MR do?
This MR fixes a bug when promoting an Issue with attachments to an Epic.
The bug was introduced in !38646 (merged) where the new MarkdownContentRewriterService was passed the target's #project (in two places: here and here), where previously new_parent was passed instead. new_parent was either the #project or the #group.
When an Issue is promoted to an Epic, the target was the Epic, and as Epic#project is nil, this meant that a nil was passed to MarkdownContentRewriterService as the target_parent, which would result in an error when that class called Gitlab::Gfm::UploadsRewriter and methods on nil were called (see #236190 (closed)).
This MR passed the object's #resource_parent to MarkdownContentRewriterService which will correctly be a Project or Group.
- Issue #236190 (closed)
QA Steps
- Create a group, and a project within the group, and an issue within that project.
- Attach an image to the issue, either in the issue's description, or in a comment on the issue.
- Save a comment on the issue with the quick action:
/promote
On master this will cause an error, on this branch it will promote the Issue to an Epic.
Does this MR meet the acceptance criteria?
Conformity
- Changelog entry
- [-] Documentation (if required)
- Code review guidelines
- Merge request performance guidelines
- Style guides
- Database guides
- Separation of EE specific content
Availability and Testing
- Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
- [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done