update merge_request comments API to support line and path

#7813 
Shadowing outer local variable - `diff_line`.<br>Prefer `detect` over `find`.