cbgit 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/gitbuild +14 -13
- data/lib/cbgit/version.rb +1 -1
- 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: 29ac1484be87d5a91ae309dd6cab38ed50351b11
|
4
|
+
data.tar.gz: b730e6f50f2913b251a34674d8fe316dfe8071ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c7164d12b28b93c6558454d6d735f6c51cf4fa96d3d82061b737e8fce57a8085fdef36832df4f0ca5dff43e1bb2212effb7dde5ef03210d4dc8f28737794115
|
7
|
+
data.tar.gz: b9ccc321e0c984f27cb5310184991283c88555f849851c84634856f84d78f3c497bab1d560ed9a1ffea06bc22d25cfb305eb1fc7bb7866c64d080c96fa4f6218
|
data/bin/gitbuild
CHANGED
@@ -88,11 +88,20 @@ def git command, *args
|
|
88
88
|
@g.lib.send :command, command, args
|
89
89
|
end
|
90
90
|
|
91
|
-
|
92
|
-
def fetch_github_pulls repo
|
93
|
-
# Access pull requests
|
91
|
+
ISSUES_LIMIT = 1000
|
92
|
+
def fetch_github_pulls repo
|
93
|
+
# Access pull requests via issues API, because PRs API does not expose labels
|
94
|
+
# but the issues API does. Technically, all the PRs are issues, so we just
|
95
|
+
# pull all the issues and sort the ones that are not PRs out.
|
94
96
|
@logger.debug "Fetching pull requests from #{repo}"
|
95
|
-
|
97
|
+
Octokit.issues(repo, state: :open, per_page: ISSUES_LIMIT)
|
98
|
+
.select { |i| i[:pull_request] }
|
99
|
+
end
|
100
|
+
|
101
|
+
def fetch_github_pulls_to_build repo=calculate_github_repo
|
102
|
+
fetch_github_pulls(repo).select { |pull|
|
103
|
+
pull[:labels].find { |label| label[:name] == OPTS[:BUILD_NAME] }
|
104
|
+
}
|
96
105
|
end
|
97
106
|
|
98
107
|
def calculate_github_repo
|
@@ -120,10 +129,6 @@ def calculate_build_number
|
|
120
129
|
end
|
121
130
|
end
|
122
131
|
|
123
|
-
def pull_tag_regex
|
124
|
-
/\B\##{OPTS[:BUILD_NAME]}\b/
|
125
|
-
end
|
126
|
-
|
127
132
|
# --------------------------------------------------
|
128
133
|
# MAIN SCRIPT
|
129
134
|
|
@@ -143,8 +148,7 @@ begin
|
|
143
148
|
|
144
149
|
# --------------------------------------------------------------------
|
145
150
|
# Figure out branches we will merge, by looking for the magic tag
|
146
|
-
pulls =
|
147
|
-
pulls = pulls.select{ |pull| pull.body.match pull_tag_regex }
|
151
|
+
pulls = fetch_github_pulls_to_build
|
148
152
|
raise 'No pull requests to merge!' if pulls.empty?
|
149
153
|
brnames = pulls.map{ |b| b.head.ref }
|
150
154
|
puts "---- Found Github branches to build:\n#{brnames.join "\n" }"
|
@@ -237,6 +241,3 @@ rescue
|
|
237
241
|
branch.delete rescue nil
|
238
242
|
raise
|
239
243
|
end
|
240
|
-
|
241
|
-
|
242
|
-
|
data/lib/cbgit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cbgit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jaime Cham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|