lita-pullrequests 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +17 -5
- data/lib/lita/handlers/pullrequests.rb +22 -14
- data/lita-pullrequests.gemspec +1 -1
- data/spec/lita/handlers/pullrequests_spec.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf38c15c07dc898b239cec2885710ce57f6058db
|
4
|
+
data.tar.gz: e5eac46144f31a25048aebe81c41a3b34ee37a70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9a3d12b32a0b4264389a4e03ff4b5ff81cc444d12972b8ba8a7030553b3173b0252b5d5a0784b508932fc79edcf162a38b89b431bf6c89e0ae95245a44c8a6c
|
7
|
+
data.tar.gz: fe795650db0ba8249c355180bf7abf08108eeccafc6542d01c09ec33c1300919f13ebef483ab0c9c771a5eb386b6484ca8c098068f11b4eff3f1298d139679e2
|
data/README.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# lita-pullrequests
|
2
2
|
|
3
|
-
A Lita handler to help you keep track of your pull requests
|
3
|
+
A Lita handler to help you **keep track of your pull requests**. It can automatically post in your channels on a schedule and tell you about pull requests that need attention in all of your repositories.
|
4
4
|
|
5
|
-
|
5
|
+
1. Organize pull requests with labels on GitHub
|
6
|
+
2. Lita will remind you about them later
|
6
7
|
|
7
8
|
## Installation
|
8
9
|
|
@@ -14,13 +15,24 @@ gem "lita-pullrequests"
|
|
14
15
|
|
15
16
|
## Configuration
|
16
17
|
|
18
|
+
Pull request summaries include three sections:
|
19
|
+
|
20
|
+
1. Pull Requests that need a code review
|
21
|
+
2. Pull Requests that are ready to be merged
|
22
|
+
3. Pull Requests that need quality assurance
|
23
|
+
|
24
|
+
These are sorted based on GitHub labels attached to pull requests. You can configure your labels in your `lita_config`.
|
25
|
+
|
26
|
+
You will also need a personal access token for an account that has access to all of the repositories that are to be scraped. You can get one of these [here](https://github.com/settings/applications). You'll need to store the access token as an environment variable on Heroku or your server.
|
27
|
+
|
17
28
|
Add the following configuration lines to your `lita_config`:
|
18
29
|
|
19
30
|
``` ruby
|
20
|
-
config.handlers.pullrequests.access_token = "
|
31
|
+
config.handlers.pullrequests.access_token = ENV["GITHUB_ACCESS_TOKEN"]
|
21
32
|
config.handlers.pullrequests.repos = ["username/reponame"]
|
22
|
-
config.handlers.pullrequests.review_label = "
|
23
|
-
config.handlers.pullrequests.merge_label = "
|
33
|
+
config.handlers.pullrequests.review_label = "needs-review"
|
34
|
+
config.handlers.pullrequests.merge_label = "ready-for-merge"
|
35
|
+
config.handlers.pullrequests.qa_label = "qa-needed"
|
24
36
|
```
|
25
37
|
|
26
38
|
## Usage
|
@@ -7,6 +7,7 @@ module Lita
|
|
7
7
|
config :repos, type: Array, required: true
|
8
8
|
config :review_label, type: String, required: false
|
9
9
|
config :merge_label, type: String, required: false
|
10
|
+
config :qa_label, type: String, required: false
|
10
11
|
|
11
12
|
on :loaded, :remember_reminder
|
12
13
|
|
@@ -71,7 +72,7 @@ module Lita
|
|
71
72
|
chat.reply "No pull requests need a review right now!"
|
72
73
|
end
|
73
74
|
else
|
74
|
-
chat.reply
|
75
|
+
chat.reply "I'm not configured for a repo with that name."
|
75
76
|
end
|
76
77
|
end
|
77
78
|
|
@@ -93,21 +94,28 @@ module Lita
|
|
93
94
|
end
|
94
95
|
end
|
95
96
|
|
96
|
-
def
|
97
|
-
|
98
|
-
|
99
|
-
response += pulls_that_need_reviews.map do |pr|
|
100
|
-
title, user = pr["title"], pr["user"]["login"]
|
101
|
-
url = pr["pull_request"]["html_url"]
|
102
|
-
"- _#{title}_ - #{user} \n #{url}"
|
103
|
-
end.join("\n\n")
|
97
|
+
def pulls_that_need_qa
|
98
|
+
pulls = fetch_pull_requests
|
99
|
+
merge_label = config.qa_label || "QA Needed"
|
104
100
|
|
105
|
-
|
101
|
+
pulls.select do |pr|
|
102
|
+
pr["labels"] && pr["labels"].any? { |label| label["name"] == config.qa_label }
|
103
|
+
end
|
104
|
+
end
|
106
105
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
"
|
106
|
+
def formatted_pull_request_summary
|
107
|
+
{
|
108
|
+
":heavy_exclamation_mark: *Pull Requests that need review*:\n" => pulls_that_need_reviews,
|
109
|
+
":thought_balloon: *Pull Requests that need QA*:\n" => pulls_that_need_qa,
|
110
|
+
":white_check_mark: *Pull Requests that are ready for merging*:\n" => pulls_that_need_merging
|
111
|
+
}.map do |heading, pulls|
|
112
|
+
heading + if pulls.any?
|
113
|
+
pulls.map do |pr|
|
114
|
+
"- _#{pr['title']}_ - #{pr['user']['login']} \n #{pr['pull_request']['html_url']}"
|
115
|
+
end.join("\n\n")
|
116
|
+
else
|
117
|
+
"_None!_\n"
|
118
|
+
end
|
111
119
|
end.join("\n\n")
|
112
120
|
end
|
113
121
|
|
data/lita-pullrequests.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "lita-pullrequests"
|
3
|
-
spec.version = "0.0.
|
3
|
+
spec.version = "0.0.9"
|
4
4
|
spec.authors = ["Taylor Lapeyre"]
|
5
5
|
spec.email = ["taylorlapeyre@gmail.com"]
|
6
6
|
spec.description = %q{A Lita handler to help you keep track of your pull requests.}
|
@@ -6,6 +6,7 @@ describe Lita::Handlers::Pullrequests, lita_handler: true do
|
|
6
6
|
Lita.config.handlers.pullrequests.repos = ["taylorlapeyre/lita-pullrequests"]
|
7
7
|
Lita.config.handlers.pullrequests.review_label = "Needs Review"
|
8
8
|
Lita.config.handlers.pullrequests.merge_label = "Ready To Merge"
|
9
|
+
Lita.config.handlers.pullrequests.qa_label = "QA Needed"
|
9
10
|
end
|
10
11
|
|
11
12
|
it { is_expected.to route_command("give me something to review for lita-pullrequests").to(:get_random_pr) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-pullrequests
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taylor Lapeyre
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|