fbe 0.35.0 → 0.36.1
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/Gemfile.lock +8 -8
- data/lib/fbe/conclude.rb +9 -10
- data/lib/fbe/iterate.rb +20 -4
- data/lib/fbe/regularly.rb +2 -1
- data/lib/fbe.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b06cd95d05dd6dfa4e79d2c3e128bb3c8bae254dae8abe5842cc59e12adf26f5
|
4
|
+
data.tar.gz: 626b6720065bfdf41480b3728545963fc2477e5baa7d6e07f404a396b52df9ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9df729eb9a4e4733ccf08c68fa289c2c05da96e3360a285e7432bc7e2ba0a1cbce56e74b5b1c34dc12023eca1395b045af9ad2f8698ce63a7d47ad5ffdd1273e
|
7
|
+
data.tar.gz: 24fc078561ad2d0a6169a2aebf965325497f8feca78446fcc6c4f6890c3e685c3bae9ba9c2da049dbdd8090b4363ab9b4acdbfa476c8c1a9f6222d6cf7b28910
|
data/Gemfile.lock
CHANGED
@@ -76,7 +76,7 @@ GEM
|
|
76
76
|
ellipsized (0.3.0)
|
77
77
|
ethon (0.15.0)
|
78
78
|
ffi (>= 1.15.0)
|
79
|
-
factbase (0.16.
|
79
|
+
factbase (0.16.5)
|
80
80
|
backtrace (~> 0.4)
|
81
81
|
decoor (~> 0.1)
|
82
82
|
ellipsized (~> 0.3)
|
@@ -107,7 +107,7 @@ GEM
|
|
107
107
|
filesize (0.2.0)
|
108
108
|
gli (2.22.2)
|
109
109
|
ostruct
|
110
|
-
graphql (2.5.
|
110
|
+
graphql (2.5.12)
|
111
111
|
base64
|
112
112
|
fiber-storage
|
113
113
|
logger
|
@@ -157,13 +157,13 @@ GEM
|
|
157
157
|
multipart-post (2.4.1)
|
158
158
|
net-http (0.6.0)
|
159
159
|
uri
|
160
|
-
nokogiri (1.18.
|
160
|
+
nokogiri (1.18.10-arm64-darwin)
|
161
161
|
racc (~> 1.4)
|
162
|
-
nokogiri (1.18.
|
162
|
+
nokogiri (1.18.10-x64-mingw-ucrt)
|
163
163
|
racc (~> 1.4)
|
164
|
-
nokogiri (1.18.
|
164
|
+
nokogiri (1.18.10-x86_64-darwin)
|
165
165
|
racc (~> 1.4)
|
166
|
-
nokogiri (1.18.
|
166
|
+
nokogiri (1.18.10-x86_64-linux-gnu)
|
167
167
|
racc (~> 1.4)
|
168
168
|
obk (0.3.2)
|
169
169
|
octokit (10.0.0)
|
@@ -176,7 +176,7 @@ GEM
|
|
176
176
|
parser (3.3.9.0)
|
177
177
|
ast (~> 2.4.1)
|
178
178
|
racc
|
179
|
-
prism (1.
|
179
|
+
prism (1.5.1)
|
180
180
|
public_suffix (6.0.2)
|
181
181
|
qbash (0.4.5)
|
182
182
|
backtrace (> 0)
|
@@ -186,7 +186,7 @@ GEM
|
|
186
186
|
racc (1.8.1)
|
187
187
|
rainbow (3.1.1)
|
188
188
|
rake (13.3.0)
|
189
|
-
regexp_parser (2.11.
|
189
|
+
regexp_parser (2.11.3)
|
190
190
|
retries (0.0.5)
|
191
191
|
rexml (3.4.4)
|
192
192
|
rubocop (1.80.2)
|
data/lib/fbe/conclude.rb
CHANGED
@@ -71,8 +71,8 @@ class Fbe::Conclude
|
|
71
71
|
@query = nil
|
72
72
|
@follows = []
|
73
73
|
@lifetime_aware = true
|
74
|
+
@timeout_aware = true
|
74
75
|
@quota_aware = true
|
75
|
-
@timeout = 60
|
76
76
|
end
|
77
77
|
|
78
78
|
# Make this block not aware of GitHub API quota.
|
@@ -94,15 +94,13 @@ class Fbe::Conclude
|
|
94
94
|
@lifetime_aware = false
|
95
95
|
end
|
96
96
|
|
97
|
-
# Make
|
97
|
+
# Make this block NOT aware of timeout limitations.
|
98
98
|
#
|
99
|
-
# When the
|
100
|
-
# This helps prevent interruptions in long-running operations.
|
99
|
+
# When the timeout is over, the loop will NOT gracefully stop.
|
101
100
|
#
|
102
|
-
# @param [Float] sec Seconds
|
103
101
|
# @return [nil] Nothing is returned
|
104
|
-
def
|
105
|
-
@
|
102
|
+
def timeout_unaware
|
103
|
+
@timeout_aware = false
|
106
104
|
end
|
107
105
|
|
108
106
|
# Set the query that should find the facts in the factbase.
|
@@ -194,17 +192,18 @@ class Fbe::Conclude
|
|
194
192
|
def roll(&)
|
195
193
|
passed = 0
|
196
194
|
oct = Fbe.octo(loog: @loog, options: @options, global: @global)
|
195
|
+
started = Time.now
|
197
196
|
@fb.query(@query).each do |a|
|
198
197
|
if @quota_aware && oct.off_quota?
|
199
198
|
@loog.info('We ran out of GitHub quota, must stop here')
|
200
199
|
break
|
201
200
|
end
|
202
201
|
if @lifetime_aware && @options.lifetime && Time.now - @start > @options.lifetime - 10
|
203
|
-
@loog.debug(
|
202
|
+
@loog.debug("We ran out of lifetime (#{@start.ago} already), must stop here")
|
204
203
|
break
|
205
204
|
end
|
206
|
-
if Time.now > @
|
207
|
-
@loog.debug("We've spent more than #{
|
205
|
+
if @timeout_aware && @options.timeout && Time.now - started > @options.timeout - 5
|
206
|
+
@loog.debug("We've spent more than #{started.ago}, must stop here")
|
208
207
|
break
|
209
208
|
end
|
210
209
|
@fb.txn do |fbt|
|
data/lib/fbe/iterate.rb
CHANGED
@@ -32,7 +32,7 @@ require_relative 'unmask_repos'
|
|
32
32
|
# by '(and (eq what "issue") (gt created_at $before))'
|
33
33
|
# repeats 5
|
34
34
|
# quota_aware
|
35
|
-
# over
|
35
|
+
# over do |repository_id, issue_id|
|
36
36
|
# process_issue(repository_id, issue_id)
|
37
37
|
# issue_id + 1
|
38
38
|
# end
|
@@ -96,6 +96,7 @@ class Fbe::Iterate
|
|
96
96
|
@repeats = 1
|
97
97
|
@quota_aware = true
|
98
98
|
@lifetime_aware = true
|
99
|
+
@timeout_aware = true
|
99
100
|
end
|
100
101
|
|
101
102
|
# Makes the iterator aware of GitHub API quota limits.
|
@@ -119,6 +120,13 @@ class Fbe::Iterate
|
|
119
120
|
@lifetime_aware = false
|
120
121
|
end
|
121
122
|
|
123
|
+
# Makes the iterator aware of timeout limits.
|
124
|
+
#
|
125
|
+
# @return [nil] Nothing is returned
|
126
|
+
def timeout_unaware
|
127
|
+
@timeout_aware = false
|
128
|
+
end
|
129
|
+
|
122
130
|
# Sets the maximum number of iterations per repository.
|
123
131
|
#
|
124
132
|
# Controls how many times the query will be executed for each repository
|
@@ -202,7 +210,7 @@ class Fbe::Iterate
|
|
202
210
|
# @return [nil] Nothing is returned
|
203
211
|
# @raise [RuntimeError] If block doesn't return an Integer
|
204
212
|
# @example Process issues incrementally
|
205
|
-
# iterator.over
|
213
|
+
# iterator.over do |repo_id, issue_number|
|
206
214
|
# fetch_and_process_issue(repo_id, issue_number)
|
207
215
|
# issue_number + 1 # Return next issue number to process
|
208
216
|
# end
|
@@ -240,7 +248,11 @@ class Fbe::Iterate
|
|
240
248
|
break
|
241
249
|
end
|
242
250
|
if @lifetime_aware && @options.lifetime && Time.now - @start > @options.lifetime - 10
|
243
|
-
@loog.
|
251
|
+
@loog.debug("We ran out of lifetime (#{@start.ago} already), must stop here")
|
252
|
+
break
|
253
|
+
end
|
254
|
+
if @timeout_aware && @options.timeout && Time.now - started > @options.timeout - 5
|
255
|
+
@loog.debug("We've spent more than #{started.ago}, must stop here")
|
244
256
|
break
|
245
257
|
end
|
246
258
|
repos.each do |repo|
|
@@ -249,9 +261,13 @@ class Fbe::Iterate
|
|
249
261
|
break
|
250
262
|
end
|
251
263
|
if @lifetime_aware && @options.lifetime && Time.now - @start > @options.lifetime - 10
|
252
|
-
@loog.info("We are working for #{
|
264
|
+
@loog.info("We are working for #{@start.ago} already, won't check repository ##{repo}")
|
253
265
|
next
|
254
266
|
end
|
267
|
+
if @timeout_aware && @options.timeout && Time.now - started > @options.timeout - 5
|
268
|
+
@loog.debug("We've spent more than #{started.ago}, won't check repository ##{repo}")
|
269
|
+
break
|
270
|
+
end
|
255
271
|
next if restarted.include?(repo)
|
256
272
|
seen[repo] = 0 if seen[repo].nil?
|
257
273
|
if seen[repo] >= @repeats
|
data/lib/fbe/regularly.rb
CHANGED
@@ -43,12 +43,13 @@ def Fbe.regularly(area, p_every_days, p_since_days = nil, fb: Fbe.fb, judge: $ju
|
|
43
43
|
(gt when (minus (to_time (env 'TODAY' '#{Time.now.utc.iso8601}')) '#{interval} days')))"
|
44
44
|
).each.first
|
45
45
|
if recent
|
46
|
-
loog.
|
46
|
+
loog.info(
|
47
47
|
"#{$judge} statistics were collected #{recent.when.ago} ago, " \
|
48
48
|
"skipping now (we run it every #{interval} days)"
|
49
49
|
)
|
50
50
|
return
|
51
51
|
end
|
52
|
+
loog.info("#{$judge} statistics weren't collected for the last #{interval} days")
|
52
53
|
fb.txn do |fbt|
|
53
54
|
f = fbt.insert
|
54
55
|
f.what = judge
|
data/lib/fbe.rb
CHANGED