lib/gitlab_reviewbot/gitlab.rb in danger-gitlab_reviewbot-1.1.10 vs lib/gitlab_reviewbot/gitlab.rb in danger-gitlab_reviewbot-1.2.0

- old
+ new

@@ -24,11 +24,11 @@ @client = client 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_with_review(project_id, mr.iid, mr.assignees)} + all_assignees = outstanding_mrs.reduce([]) { |acc, mr| acc + mr.reviewers - assignees_with_review(project_id, mr.iid, mr.reviewers)} assignees_id_map = all_assignees.each_with_object({}) do |a, acc| aid = a["id"] ausername = a["username"] assignee = acc[aid] || User.new(aid, ausername) assignee.review_count += 1 @@ -51,11 +51,11 @@ res.select { |u| u.state == "active" && u.access_level >= developer_access_level }.map { |u| User.new(u.id, u.username) } end def assign_mr_to_users(project_id, mr_iid, users) user_ids = users.map(&:id) - @client.update_merge_request(project_id, mr_iid, "assignee_ids" => user_ids) + @client.update_merge_request(project_id, mr_iid, "reviewer_ids" => user_ids) end def fetch_author_for_mr(project_id, mr_iid) res = @client.merge_request(project_id, mr_iid) @@ -65,10 +65,10 @@ def find_user_with_username(username) @client.users({ username: username }).map { |u| User.new(u.id, u.username) } end def fetch_mr_reviewers(project_id, mr_iid) - @client.merge_request(project_id, mr_iid).assignees.map { |u| User.new(u["id"], u["username"]) } + @client.merge_request(project_id, mr_iid).reviewers.map { |u| User.new(u["id"], u["username"]) } end private def search_group_with_path(group_name)