lita-github_pr_list 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd136b46fd37967324c1e940dfc9206fd3a1f92e
|
4
|
+
data.tar.gz: f7b266b71e0db502fe7fe35b078c1ace31720a60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9e2fecd95d0a77b25c14b032ebee689128ea7e5b9a7758a0f2c939c3098ac1dd1cfa5b6c1124d59718949b05372fb30bec185613d8f8459723738d43ddddbd4
|
7
|
+
data.tar.gz: 9ac698d88b237191bc1639c170afa24e4e83dcb5df6b2daf9990c2d5516ca72b0d41f138f4b9a83dc0eebcd83826cdb820f08ef4bbab95aa732816fa4f5ffdd4
|
@@ -20,8 +20,7 @@ module Lita
|
|
20
20
|
|
21
21
|
def add_hooks
|
22
22
|
response.reply "Adding webhooks to #{github_organization}, this may take awhile..."
|
23
|
-
|
24
|
-
github_client.repositories(github_organization).each do |repo|
|
23
|
+
github_client.organization_repositories(github_organization, type: 'all').each do |repo|
|
25
24
|
begin
|
26
25
|
create_hook(repo.full_name)
|
27
26
|
rescue => ex
|
@@ -37,7 +36,7 @@ module Lita
|
|
37
36
|
def remove_hooks
|
38
37
|
response.reply "Removing #{web_hook} webhooks from #{github_organization}, this may take awhile..."
|
39
38
|
|
40
|
-
github_client.
|
39
|
+
github_client.organization_repositories(github_organization, åtype: 'all').each do |repo|
|
41
40
|
github_client.hooks(repo.full_name).each do |hook|
|
42
41
|
if hook.config.url == web_hook
|
43
42
|
github_client.remove_hook(repo.full_name, hook.id)
|
@@ -30,7 +30,7 @@ describe Lita::Handlers::GithubPrList, lita_handler: true do
|
|
30
30
|
it { routes_command("pr remove hooks").to(:remove_pr_hooks) }
|
31
31
|
|
32
32
|
it "adds web hooks to an org's repos" do
|
33
|
-
expect_any_instance_of(Octokit::Client).to receive(:
|
33
|
+
expect_any_instance_of(Octokit::Client).to receive(:organization_repositories).and_return(repos)
|
34
34
|
expect_any_instance_of(Octokit::Client).to receive(:create_hook).twice.and_return(nil)
|
35
35
|
|
36
36
|
send_command("pr add hooks")
|
@@ -40,7 +40,7 @@ describe Lita::Handlers::GithubPrList, lita_handler: true do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
it "removes web hooks from an org's repos" do
|
43
|
-
expect_any_instance_of(Octokit::Client).to receive(:
|
43
|
+
expect_any_instance_of(Octokit::Client).to receive(:organization_repositories).and_return(repos)
|
44
44
|
expect_any_instance_of(Octokit::Client).to receive(:hooks).twice.and_return(hooks)
|
45
45
|
expect_any_instance_of(Octokit::Client).to receive(:remove_hook).twice.and_return(nil)
|
46
46
|
|
@@ -51,7 +51,7 @@ describe Lita::Handlers::GithubPrList, lita_handler: true do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
it "catches exceptions when the hook already exists and continues" do
|
54
|
-
expect_any_instance_of(Octokit::Client).to receive(:
|
54
|
+
expect_any_instance_of(Octokit::Client).to receive(:organization_repositories).and_return(repos)
|
55
55
|
expect_any_instance_of(Octokit::Client).to receive(:create_hook).twice.and_return(nil)
|
56
56
|
exception = Octokit::UnprocessableEntity.new
|
57
57
|
allow(exception).to receive(:errors).and_return([OpenStruct.new(message: "Hook already exists on this repository")])
|