Infer merge request in Discussions::ResolveService
This change allows Discussions::ResolveService to infer the related Merge Request without the params[:merge_request] being present. Previously the param was expected to be passed and the service would error if it were not present. This change is being made for two reasons: 1) Discussions can be associated with Designs, which have no relationship with Merge Requests. In order to be able to use this service to resolve Discussions on Designs, we need to make this service able to treat the param as optional. 2) This service is to be called from within the GraphQL API. It shouldn't be the API's responsibility to find the related Merge Request and pass it to the service, but instead the service should be responsible for making sure the right services are called after resolving Discussions on Merge Requests. The params[:merge_request] has been kept as an optimisation for existing code that has fetched the Merge Request already before calling the service (this won't be the case for the GraphQL API). https://gitlab.com/gitlab-org/gitlab/-/issues/13049
Showing
Please register or sign in to comment