lib/gitlab_reviewbot/gitlab.rb in danger-gitlab_reviewbot-1.0.2 vs lib/gitlab_reviewbot/gitlab.rb in danger-gitlab_reviewbot-1.1.0
- old
+ new
@@ -40,9 +40,13 @@
def fetch_mrs_requiring_review(project_id)
merge_requests(project_id, :state => 'opened', :per_page => '100').select { |mr| mr.merge_status != 'can_be_merged' }
end
+ def find_user_with_username(username)
+ users({:username => username}).map { |u| User.new(u.id, u.username) }
+ end
+
def users_with_pending_mr_review(project_id)
outstanding_mrs = fetch_mrs_requiring_review(project_id)
all_assignees = outstanding_mrs.reduce([]) { |acc, mr| acc + mr.assignees }
assignees_id_map = all_assignees.reduce({}) { |acc, a|
aid = a['id']