fbe 0.31.0 → 0.31.2
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/.github/workflows/typos.yml +1 -1
- data/Gemfile.lock +1 -1
- data/lib/fbe/conclude.rb +1 -1
- data/lib/fbe/fb.rb +6 -2
- data/lib/fbe/iterate.rb +2 -2
- data/lib/fbe/octo.rb +40 -22
- data/lib/fbe/tombstone.rb +5 -10
- 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: 3a677f7f6496d3ae71e301f9f495b4907391bbde215407b702a8fbb956912935
|
4
|
+
data.tar.gz: 2afe6bbef989ffc24291cf00db87f917513469f0ae2a99ecbac4429692dbf479
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed332e9aece1b31c3cc25716dd16dea036ebffa048caaaa8028b84a91702852d146910e46b1dfb731e7cbf9d6af54f8b0fd1409e282f61be5fd2398935cb4581
|
7
|
+
data.tar.gz: c0edfee023e86ccc3a669111b7c68492d35d030d2d1e31f0262059f91e12839709b0f73f15a14b7b3755347b44fa3b5e157754c6babbec7dee2c2ee33ae120f9
|
data/.github/workflows/typos.yml
CHANGED
data/Gemfile.lock
CHANGED
data/lib/fbe/conclude.rb
CHANGED
@@ -199,7 +199,7 @@ class Fbe::Conclude
|
|
199
199
|
oct = Fbe.octo(loog: @loog, options: @options, global: @global)
|
200
200
|
@fb.query(@query).each do |a|
|
201
201
|
if @quota_aware && oct.off_quota?
|
202
|
-
@loog.
|
202
|
+
@loog.info('We ran out of GitHub quota, must stop here')
|
203
203
|
break
|
204
204
|
end
|
205
205
|
if @lifetime_aware && @options.lifetime && Time.now - @start > @options.lifetime - 10
|
data/lib/fbe/fb.rb
CHANGED
@@ -44,8 +44,12 @@ def Fbe.fb(fb: $fb, global: $global, options: $options, loog: $loog)
|
|
44
44
|
max = fbt.query('(max _id)').one
|
45
45
|
f._id = (max.nil? ? 0 : max) + 1
|
46
46
|
f._time = Time.now
|
47
|
-
f._version =
|
48
|
-
|
47
|
+
f._version = [
|
48
|
+
Factbase::VERSION,
|
49
|
+
Judges::VERSION,
|
50
|
+
options.action_version
|
51
|
+
].compact.join('/')
|
52
|
+
f._job = options.job_id.to_i if options.job_id
|
49
53
|
end
|
50
54
|
Factbase::Impatient.new(
|
51
55
|
Factbase::Logged.new(
|
data/lib/fbe/iterate.rb
CHANGED
@@ -201,7 +201,7 @@ class Fbe::Iterate
|
|
201
201
|
seen = {}
|
202
202
|
oct = Fbe.octo(loog: @loog, options: @options, global: @global)
|
203
203
|
if oct.off_quota?
|
204
|
-
@loog.
|
204
|
+
@loog.info('We are off GitHub quota, cannot even start, sorry')
|
205
205
|
return
|
206
206
|
end
|
207
207
|
repos = Fbe.unmask_repos(
|
@@ -234,7 +234,7 @@ class Fbe::Iterate
|
|
234
234
|
end
|
235
235
|
repos.each do |repo|
|
236
236
|
if @quota_aware && oct.off_quota?
|
237
|
-
@loog.
|
237
|
+
@loog.info("We are off GitHub quota, we must skip #{repo}")
|
238
238
|
break
|
239
239
|
end
|
240
240
|
if Time.now - start > timeout
|
data/lib/fbe/octo.rb
CHANGED
@@ -164,7 +164,7 @@ def Fbe.octo(options: $options, global: $global, loog: $loog)
|
|
164
164
|
def off_quota?(threshold: 50)
|
165
165
|
left = @origin.rate_limit!.remaining
|
166
166
|
if left < threshold
|
167
|
-
@loog.info("Too much GitHub API quota consumed already (#{left} < #{threshold})
|
167
|
+
@loog.info("Too much GitHub API quota consumed already (#{left} < #{threshold})")
|
168
168
|
true
|
169
169
|
else
|
170
170
|
@loog.debug("Still #{left} GitHub API quota left (>#{threshold})")
|
@@ -712,29 +712,40 @@ class Fbe::FakeOctokit
|
|
712
712
|
# client.pull_request('octocat/Hello-World', 1)
|
713
713
|
# # => {:id=>42, :number=>1, :additions=>12, ...}
|
714
714
|
def pull_request(repo, number)
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
715
|
+
if number == 29
|
716
|
+
{
|
717
|
+
id: 42,
|
718
|
+
number:,
|
719
|
+
user: { id: 421, login: 'user' },
|
720
|
+
created_at: Time.parse('2024-08-20 15:35:30 UTC'),
|
721
|
+
additions: 12,
|
722
|
+
deletions: 5
|
723
|
+
}
|
724
|
+
else
|
725
|
+
{
|
726
|
+
id: 42,
|
727
|
+
number:,
|
722
728
|
repo: {
|
723
729
|
full_name: repo
|
724
|
-
}
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
730
|
+
},
|
731
|
+
base: {
|
732
|
+
repo: {
|
733
|
+
full_name: repo
|
734
|
+
}
|
735
|
+
},
|
736
|
+
state: 'closed',
|
737
|
+
user: { login: 'yegor256', id: 526_301, type: 'User' },
|
738
|
+
head: { ref: 'master', sha: '6dcb09b5b57875f334f61aebed695e2e4193db5e' },
|
739
|
+
additions: 12,
|
740
|
+
deletions: 5,
|
741
|
+
changed_files: 3,
|
742
|
+
comments: 2,
|
743
|
+
review_comments: 2,
|
744
|
+
closed_at: Time.parse('2024-12-20'),
|
745
|
+
merged_at: Time.parse('2024-12-20'),
|
746
|
+
created_at: Time.parse('2024-09-20')
|
747
|
+
}
|
748
|
+
end
|
738
749
|
end
|
739
750
|
|
740
751
|
# Lists pull requests for a repository.
|
@@ -831,6 +842,13 @@ class Fbe::FakeOctokit
|
|
831
842
|
]
|
832
843
|
end
|
833
844
|
|
845
|
+
def pull_request_review_comments(_repo, _number, _review, _options = {})
|
846
|
+
[
|
847
|
+
{ id: 22_447_120, user: { login: 'yegor256', id: 526_301, type: 'User' } },
|
848
|
+
{ id: 22_447_121, user: { login: 'yegor256', id: 526_301, type: 'User' } }
|
849
|
+
]
|
850
|
+
end
|
851
|
+
|
834
852
|
def review_comments(_repo, _number)
|
835
853
|
[
|
836
854
|
{
|
data/lib/fbe/tombstone.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Zerocracy
|
4
4
|
# SPDX-License-Identifier: MIT
|
5
5
|
|
6
|
+
require 'securerandom'
|
6
7
|
require_relative '../fbe'
|
7
8
|
require_relative 'fb'
|
8
9
|
require_relative 'if_absent'
|
@@ -38,20 +39,14 @@ class Fbe::Tombstone
|
|
38
39
|
issue.each do |i|
|
39
40
|
nn << [i, i]
|
40
41
|
end
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
merged << [a, b]
|
46
|
-
else
|
47
|
-
last = merged[-1]
|
48
|
-
if last[1] == a - 1
|
49
|
-
last[1] = b
|
42
|
+
merged =
|
43
|
+
nn.sort.each_with_object([]) do |(a, b), merged|
|
44
|
+
if !merged.empty? && merged[-1][0] <= a && a <= merged[-1][1] + 1
|
45
|
+
merged[-1][1] = b if b > merged[-1][1]
|
50
46
|
else
|
51
47
|
merged << [a, b]
|
52
48
|
end
|
53
49
|
end
|
54
|
-
end
|
55
50
|
Fbe.overwrite(f, 'issues', merged.map { |ii| "#{ii[0]}-#{ii[1]}" }, fb: @fb, fid: @fid)
|
56
51
|
end
|
57
52
|
|
data/lib/fbe.rb
CHANGED