Skip to content

Fix specs on resolve discussion by creating issue

What does this MR do and why?

There is no valid way to create an issue without a title and the removed specs asserted precisely that.

The specs didn't fail before because they were not asserting that the create operation was successful first.

Also, there's no way through the app to create a follow up issue with an empty title image

One thing I did notice is that in here https://gitlab.com/gitlab-org/gitlab/blob/e0d517f4ed2a604015a2d591208668ca33e636a8/app/services/issues/build_service.rb#L104 regardless of the order in which the hash merge happens, params from the request will always take precedence, and this is probably due to the fact that the create service assigns attributes to the issue after the initial build in https://gitlab.com/gitlab-org/gitlab/-/blob/a3c508558929018177c602032dea624dba9980e4/app/services/issuable_base_service.rb#L227

I created #372007 to follow up on that

MR acceptance checklist

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

Related to #368769 (closed)

Edited by Mario Celi

Merge request reports

Loading