Skip to content
This repository was archived by the owner on Apr 9, 2024. It is now read-only.

Commit 78a89c7

Browse files
committed
remove reviewer invitations
1 parent 4306408 commit 78a89c7

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

whedon_api.rb

+2-23
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,6 @@ def robawt_respond
163163
when /\A@whedon invite (.*) as editor/i
164164
check_eic
165165
invite_editor($1)
166-
when /\A@whedon re-invite (.*) as reviewer/i
167-
check_editor
168-
invite_reviewer($1)
169166
when /\A@whedon set (.*) as archive/
170167
check_editor
171168
assign_archive($1)
@@ -456,11 +453,8 @@ def set_reviewers(reviewer_list)
456453
new_reviewer_logins = reviewer_list.map { |reviewer_name| reviewer_name.sub(/^@/, "").downcase }.uniq
457454
label = reviewer_list.empty? ? "Pending" : reviewer_list.join(", ")
458455
new_body = issue.body.gsub(/\*\*Reviewers?:\*\*\s*(.+?)\r?\n/i, "**Reviewers:** #{label}\r\n")
459-
new_reviewer_logins.each do |reviewer_name|
460-
github_client.add_collaborator(@nwo, reviewer_name)
461-
end
462-
github_client.update_issue(@nwo, @issue_id, issue.title, new_body, :assignees => [])
463-
update_assignees([editor] | new_reviewer_logins)
456+
457+
github_client.update_issue(@nwo, @issue_id, issue.title, new_body)
464458
end
465459

466460
def editor?
@@ -471,21 +465,6 @@ def editor
471465
issue.body.match(/\*\*Editor:\*\*\s*.@(\S*)/)[1]
472466
end
473467

474-
def invite_reviewer(reviewer_name)
475-
reviewer_name = reviewer_name.sub(/^@/, "").downcase
476-
existing_invitees = github_client.repository_invitations(@nwo).collect {|i| i.invitee.login.downcase }
477-
478-
if existing_invitees.include?(reviewer_name)
479-
respond "The reviewer already has a pending invite.\n\n@#{reviewer_name} please accept the invite by clicking this link: https://github.com/#{@nwo}/invitations"
480-
elsif github_client.collaborator?(@nwo, reviewer_name)
481-
respond "@#{reviewer_name} already has access."
482-
else
483-
# Ideally we should check if a user exists here... (for another day)
484-
github_client.add_collaborator(@nwo, reviewer_name)
485-
respond "OK, the reviewer has been re-invited.\n\n@#{reviewer_name} please accept the invite by clicking this link: https://github.com/#{@nwo}/invitations"
486-
end
487-
end
488-
489468
def reviewers
490469
issue.body.match(/Reviewers?:\*\*\s*(.+?)\r?\n/)[1].split(", ") - ["Pending"]
491470
end

0 commit comments

Comments
 (0)