Commit 73a066c2 authored by Robert Schilling's avatar Robert Schilling 🎵

Merge branch 'cleanup-7180' into 'master'

A simpler implementation of finding a merge request

## What does this MR do?

This cleans up some code in the issues API as discussed in

The helper method `merge_request_for_resolving_discussions` was no longer needed as it was only used once. That made it possible to simplify the implementation.

## Does this MR meet the acceptance criteria?

- [x] ~~[Changelog entry]( added~~
- [x] ~~[Documentation created/updated](
- [x] ~~API support added~~
- Tests
  - [x] Added for this feature/bug
  - [ ] All builds are passing
- [x] Conform by the [merge request performance guides](
- [x] Conform by the [style guides](
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](

## What are the relevant issue numbers?


See merge request !7955
parents 180f87ca 51a921ba
......@@ -28,14 +28,6 @@ module API
def merge_request_for_resolving_discussions
return unless merge_request_iid = params[:merge_request_for_resolving_discussions]
@merge_request_for_resolving_discussions ||=, project_id:
find_by(iid: merge_request_iid)
resource :issues do
......@@ -179,7 +171,12 @@ module API
attrs = attributes_for_keys(keys)
attrs[:labels] = params[:labels] if params[:labels]
attrs[:merge_request_for_resolving_discussions] = merge_request_for_resolving_discussions if params[:merge_request_for_resolving_discussions]
if merge_request_iid = params[:merge_request_for_resolving_discussions]
attrs[:merge_request_for_resolving_discussions] =, project_id:
find_by(iid: merge_request_iid)
# Convert and filter out invalid confidential flags
attrs['confidential'] = to_boolean(attrs['confidential'])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment