Skip to content
This repository was archived by the owner on Nov 8, 2018. It is now read-only.

Commit 28c1f17

Browse files
nat-hendersonjtarchie
authored andcommitted
Remove 'manual approval' feature.
1 parent ced0ab8 commit 28c1f17

File tree

4 files changed

+0
-28
lines changed

4 files changed

+0
-28
lines changed

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ resource_types:
6464
* `require_review_approval`: *Optional*, default false. If set to `true`, it will
6565
filter out pull requests that do not have an Approved review.
6666

67-
* `require_manual_approval`: *Optional*, default false. If set to `true`, it will
68-
filter out pull requests, unless there is a comment on the PR containing the string
69-
`ci ok`, from a collaborator, repo owner, or organization member.
70-
7167
* `authorship_restriction`: *Optional*, default false. If set to `true`, will only
7268
return PRs created by someone who is a collaborator, repo owner, or organization member.
7369

assets/lib/filters/approval.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ def pull_requests
99
if @input.source.require_review_approval
1010
@pull_requests.delete_if {|x| !x.review_approved? }
1111
end
12-
if @input.source.require_manual_approval
13-
@pull_requests.delete_if {|x| !x.approved_by_collaborator? }
14-
end
1512
if @input.source.authorship_restriction
1613
@pull_requests.delete_if {|x| !x.author_associated? }
1714
end

assets/lib/pull_request.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ def author_associated?
3131
%w(OWNER COLLABORATOR MEMBER).include? @pr['author_association']
3232
end
3333

34-
def approved_by_collaborator?
35-
Octokit.pull_comments(base_repo, id).any? {|c| (%w(OWNER COLLABORATOR MEMBER).include?(c['author_association']) &&
36-
c['body'].downcase.include?('ci ok')) }
37-
end
38-
3934
def equals?(id:, sha:)
4035
[self.sha, self.id.to_s] == [sha, id.to_s]
4136
end

spec/filters/approval_spec.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,4 @@ def stub_json(uri, body)
6060
end
6161
end
6262

63-
context 'when manual approval filtering is enabled' do
64-
before do
65-
stub_json(%r{https://api.github.com/repos/user/repo/pulls/1/comments}, [{ 'author_association' => 'OWNER', 'body' => 'other comment' },
66-
{ 'author_association' => 'NONE', 'body' => 'ci ok' }])
67-
stub_json(%r{https://api.github.com/repos/user/repo/pulls/2/comments}, [{ 'author_association' => 'OWNER', 'body' => 'ci ok' }])
68-
end
69-
70-
it 'only returns PRs that are approved' do
71-
payload = { 'source' => { 'repo' => 'user/repo', 'require_manual_approval' => true, 'require_review_approval' => false, 'authorship_restriction' => false } }
72-
filter = described_class.new(pull_requests: pull_requests, input: Input.instance(payload: payload))
73-
74-
expect(filter.pull_requests).to eq [pr]
75-
end
76-
end
77-
78-
7963
end

0 commit comments

Comments
 (0)