fbe 0.41.5 → 0.42.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9518a5a77a906444fd8659fdbbe6e9be948ae5d40da3c217ea8a2c7ee176c3d
4
- data.tar.gz: 2e5c513b00aaf4cb7cb3a62e1627389ade43cf10c3ea56ef3807c176b321e1c4
3
+ metadata.gz: e20ce6012a663c91fa76f4e332db9fcca0df0a00b5fae7ef53bb559653b8657d
4
+ data.tar.gz: 76daff2e00b453611de5591b622b36e1ca16aaea86fd80966df27eec9738a187
5
5
  SHA512:
6
- metadata.gz: a4c3615dbbeac74eebd6789d5b53b1a66c82264b528e733ae1b6bb51235b9272d2ff1e9ecb97f8d192dc300f7ca26f123da6025deb28b3d0424f61d559e0de83
7
- data.tar.gz: f33440f66f32a61911684ee5ce7508c645110105fcf5c38a0c452e509d66f7e5376a2437fcc5a764546f37065cb4353a58caa883acdd525f56efa5bc0aebc390
6
+ metadata.gz: 535591e915b299f2ccd78d85e2a4f3876b539e9d6c39ac45e2da0e326cfc3309c13b84706567f94d2714b103da66abba634a90f155d42c8f68a4fe64b8417b3f
7
+ data.tar.gz: a36a7ee9b7349deb85d05245cc2ade4366d429ea450e3180926a9d092e6a5087898038d4b37866c8d80c4ca1939186fac67b1f1fc26a996d18946f60eabdfe74
@@ -15,7 +15,7 @@ jobs:
15
15
  timeout-minutes: 15
16
16
  runs-on: ubuntu-24.04
17
17
  steps:
18
- - uses: actions/checkout@v5
18
+ - uses: actions/checkout@v6
19
19
  - name: Download actionlint
20
20
  id: get_actionlint
21
21
  run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
@@ -12,7 +12,7 @@ jobs:
12
12
  timeout-minutes: 15
13
13
  runs-on: ubuntu-24.04
14
14
  steps:
15
- - uses: actions/checkout@v5
15
+ - uses: actions/checkout@v6
16
16
  - uses: ruby/setup-ruby@v1
17
17
  with:
18
18
  ruby-version: 3.4.7
@@ -11,5 +11,5 @@ jobs:
11
11
  timeout-minutes: 15
12
12
  runs-on: ubuntu-24.04
13
13
  steps:
14
- - uses: actions/checkout@v5
14
+ - uses: actions/checkout@v6
15
15
  - uses: yegor256/copyrights-action@0.0.12
@@ -19,5 +19,5 @@ jobs:
19
19
  timeout-minutes: 15
20
20
  runs-on: ubuntu-24.04
21
21
  steps:
22
- - uses: actions/checkout@v5
22
+ - uses: actions/checkout@v6
23
23
  - uses: DavidAnson/markdownlint-cli2-action@v20.0.0
@@ -15,5 +15,5 @@ jobs:
15
15
  timeout-minutes: 15
16
16
  runs-on: ubuntu-24.04
17
17
  steps:
18
- - uses: actions/checkout@v5
18
+ - uses: actions/checkout@v6
19
19
  - uses: volodya-lombrozo/pdd-action@master
@@ -18,7 +18,7 @@ jobs:
18
18
  ruby: [3.3]
19
19
  runs-on: ${{ matrix.os }}
20
20
  steps:
21
- - uses: actions/checkout@v5
21
+ - uses: actions/checkout@v6
22
22
  - uses: ruby/setup-ruby@v1
23
23
  with:
24
24
  ruby-version: ${{ matrix.ruby }}
@@ -15,5 +15,5 @@ jobs:
15
15
  timeout-minutes: 15
16
16
  runs-on: ubuntu-24.04
17
17
  steps:
18
- - uses: actions/checkout@v5
18
+ - uses: actions/checkout@v6
19
19
  - uses: fsfe/reuse-action@v6
@@ -15,7 +15,7 @@ jobs:
15
15
  timeout-minutes: 15
16
16
  runs-on: ubuntu-24.04
17
17
  steps:
18
- - uses: actions/checkout@v5
18
+ - uses: actions/checkout@v6
19
19
  - uses: crate-ci/typos@v1.39.0
20
20
  with:
21
21
  config: .github/.typos.toml
@@ -11,5 +11,5 @@ jobs:
11
11
  timeout-minutes: 15
12
12
  runs-on: ubuntu-24.04
13
13
  steps:
14
- - uses: actions/checkout@v5
14
+ - uses: actions/checkout@v6
15
15
  - uses: g4s8/xcop-action@master
@@ -15,7 +15,7 @@ jobs:
15
15
  timeout-minutes: 15
16
16
  runs-on: ubuntu-24.04
17
17
  steps:
18
- - uses: actions/checkout@v5
18
+ - uses: actions/checkout@v6
19
19
  - uses: ibiqlik/action-yamllint@v3
20
20
  with:
21
21
  config_file: .yamllint.yml
data/Gemfile CHANGED
@@ -12,12 +12,12 @@ gem 'minitest-stub-const', '~>0.6', require: false
12
12
  gem 'os', '~>1.1', require: false
13
13
  gem 'qbash', '~>0.4', require: false
14
14
  gem 'rake', '~>13.3', require: false
15
+ gem 'rdoc', '~>6.17', require: false
15
16
  gem 'rubocop', '~>1.75', require: false
16
17
  gem 'rubocop-minitest', '~>0.38', require: false
17
18
  gem 'rubocop-performance', '~>1.25', require: false
18
19
  gem 'rubocop-rake', '~>0.7', require: false
19
20
  gem 'simplecov', '~>0.22', require: false
20
21
  gem 'simplecov-cobertura', '~>3.0', require: false
21
- gem 'veils', '~>0.4', require: false
22
22
  gem 'webmock', '~>3.25', require: false
23
23
  gem 'yard', '~>0.9', require: false
data/Gemfile.lock CHANGED
@@ -23,6 +23,7 @@ PATH
23
23
  others (~> 0.1)
24
24
  sqlite3 (~> 2.6)
25
25
  tago (~> 0.1)
26
+ veils (~> 0.4)
26
27
  verbose (~> 0.0)
27
28
 
28
29
  GEM
@@ -41,13 +42,13 @@ GEM
41
42
  securerandom (>= 0.3)
42
43
  tzinfo (~> 2.0, >= 2.0.5)
43
44
  uri (>= 0.13.1)
44
- addressable (2.8.7)
45
- public_suffix (>= 2.0.2, < 7.0)
45
+ addressable (2.8.8)
46
+ public_suffix (>= 2.0.2, < 8.0)
46
47
  ansi (1.5.0)
47
48
  ast (2.4.3)
48
49
  backtrace (0.4.1)
49
50
  base64 (0.3.0)
50
- baza.rb (0.11.0)
51
+ baza.rb (0.11.2)
51
52
  backtrace (~> 0.4)
52
53
  elapsed (~> 0.2)
53
54
  faraday (~> 2.13)
@@ -62,10 +63,11 @@ GEM
62
63
  bigdecimal (3.3.1)
63
64
  builder (3.3.0)
64
65
  concurrent-ruby (1.3.5)
65
- connection_pool (2.5.4)
66
+ connection_pool (3.0.2)
66
67
  crack (1.0.1)
67
68
  bigdecimal
68
69
  rexml
70
+ date (3.5.0)
69
71
  decoor (0.1.0)
70
72
  docile (1.4.1)
71
73
  drb (2.2.3)
@@ -73,9 +75,10 @@ GEM
73
75
  loog (~> 0.6)
74
76
  tago (~> 0.1)
75
77
  ellipsized (0.3.0)
78
+ erb (6.0.0)
76
79
  ethon (0.15.0)
77
80
  ffi (>= 1.15.0)
78
- factbase (0.16.8)
81
+ factbase (0.17.1)
79
82
  backtrace (~> 0.4)
80
83
  decoor (~> 0.1)
81
84
  ellipsized (~> 0.3)
@@ -94,8 +97,8 @@ GEM
94
97
  faraday (>= 0.8)
95
98
  faraday-multipart (1.1.1)
96
99
  multipart-post (~> 2.0)
97
- faraday-net_http (3.4.1)
98
- net-http (>= 0.5.0)
100
+ faraday-net_http (3.4.2)
101
+ net-http (~> 0.5)
99
102
  faraday-retry (2.3.2)
100
103
  faraday (~> 2.0)
101
104
  ffi (1.17.2-arm64-darwin)
@@ -117,10 +120,10 @@ GEM
117
120
  i18n (1.14.7)
118
121
  concurrent-ruby (~> 1.0)
119
122
  intercepted (0.2.0)
120
- iri (0.11.2)
123
+ iri (0.11.3)
121
124
  joined (0.4.0)
122
- json (2.15.2)
123
- judges (0.55.0)
125
+ json (2.17.1)
126
+ judges (0.58.0)
124
127
  backtrace (~> 0.4)
125
128
  baza.rb (~> 0.10)
126
129
  concurrent-ruby (~> 1.2)
@@ -139,13 +142,13 @@ GEM
139
142
  typhoeus (~> 1.3)
140
143
  language_server-protocol (3.17.0.5)
141
144
  lint_roller (1.1.0)
142
- liquid (5.10.0)
145
+ liquid (5.11.0)
143
146
  bigdecimal
144
147
  strscan (>= 3.1.1)
145
148
  logger (1.7.0)
146
149
  loog (0.6.1)
147
150
  logger (~> 1.0)
148
- minitest (5.26.0)
151
+ minitest (5.26.2)
149
152
  minitest-reporters (1.7.1)
150
153
  ansi
151
154
  builder
@@ -154,8 +157,8 @@ GEM
154
157
  minitest-stub-const (0.6)
155
158
  moments (0.3.0)
156
159
  multipart-post (2.4.1)
157
- net-http (0.7.0)
158
- uri
160
+ net-http (0.8.0)
161
+ uri (>= 0.11.1)
159
162
  nokogiri (1.18.10-arm64-darwin)
160
163
  racc (~> 1.4)
161
164
  nokogiri (1.18.10-x64-mingw-ucrt)
@@ -176,8 +179,11 @@ GEM
176
179
  ast (~> 2.4.1)
177
180
  racc
178
181
  prism (1.6.0)
179
- public_suffix (6.0.2)
180
- qbash (0.4.7)
182
+ psych (5.2.6)
183
+ date
184
+ stringio
185
+ public_suffix (7.0.0)
186
+ qbash (0.4.8)
181
187
  backtrace (> 0)
182
188
  elapsed (> 0)
183
189
  loog (> 0)
@@ -185,6 +191,10 @@ GEM
185
191
  racc (1.8.1)
186
192
  rainbow (3.1.1)
187
193
  rake (13.3.1)
194
+ rdoc (6.17.0)
195
+ erb
196
+ psych (>= 4.0.0)
197
+ tsort
188
198
  regexp_parser (2.11.3)
189
199
  retries (0.0.5)
190
200
  rexml (3.4.4)
@@ -199,7 +209,7 @@ GEM
199
209
  rubocop-ast (>= 1.47.1, < 2.0)
200
210
  ruby-progressbar (~> 1.7)
201
211
  unicode-display_width (>= 2.4.0, < 4.0)
202
- rubocop-ast (1.47.1)
212
+ rubocop-ast (1.48.0)
203
213
  parser (>= 3.3.7.2)
204
214
  prism (~> 1.4)
205
215
  rubocop-minitest (0.38.2)
@@ -227,14 +237,16 @@ GEM
227
237
  simplecov (~> 0.19)
228
238
  simplecov-html (0.13.2)
229
239
  simplecov_json_formatter (0.1.4)
230
- sqlite3 (2.7.4-arm64-darwin)
231
- sqlite3 (2.7.4-x64-mingw-ucrt)
232
- sqlite3 (2.7.4-x86_64-darwin)
233
- sqlite3 (2.7.4-x86_64-linux-gnu)
240
+ sqlite3 (2.8.1-arm64-darwin)
241
+ sqlite3 (2.8.1-x64-mingw-ucrt)
242
+ sqlite3 (2.8.1-x86_64-darwin)
243
+ sqlite3 (2.8.1-x86_64-linux-gnu)
244
+ stringio (3.1.9)
234
245
  strscan (3.1.5)
235
246
  tago (0.4.0)
236
- timeout (0.4.4)
237
- total (0.4.1)
247
+ timeout (0.5.0)
248
+ total (0.4.2)
249
+ tsort (0.2.0)
238
250
  typhoeus (1.5.0)
239
251
  ethon (>= 0.9.0, < 0.16.0)
240
252
  tzinfo (2.0.6)
@@ -242,7 +254,7 @@ GEM
242
254
  unicode-display_width (3.2.0)
243
255
  unicode-emoji (~> 4.1)
244
256
  unicode-emoji (4.1.0)
245
- uri (1.1.0)
257
+ uri (1.1.1)
246
258
  veils (0.4.0)
247
259
  verbose (0.1.0)
248
260
  loog (~> 0.2)
@@ -252,7 +264,7 @@ GEM
252
264
  crack (>= 0.3.2)
253
265
  hashdiff (>= 0.4.0, < 2.0.0)
254
266
  yaml (0.4.0)
255
- yard (0.9.37)
267
+ yard (0.9.38)
256
268
 
257
269
  PLATFORMS
258
270
  arm64-darwin-22
@@ -272,13 +284,13 @@ DEPENDENCIES
272
284
  os (~> 1.1)
273
285
  qbash (~> 0.4)
274
286
  rake (~> 13.3)
287
+ rdoc (~> 6.17)
275
288
  rubocop (~> 1.75)
276
289
  rubocop-minitest (~> 0.38)
277
290
  rubocop-performance (~> 1.25)
278
291
  rubocop-rake (~> 0.7)
279
292
  simplecov (~> 0.22)
280
293
  simplecov-cobertura (~> 3.0)
281
- veils (~> 0.4)
282
294
  webmock (~> 3.25)
283
295
  yard (~> 0.9)
284
296
 
data/Rakefile CHANGED
@@ -39,6 +39,7 @@ require 'yard'
39
39
  desc 'Build Yard documentation'
40
40
  YARD::Rake::YardocTask.new do |t|
41
41
  t.files = ['lib/**/*.rb']
42
+ t.options = ['--fail-on-warning']
42
43
  end
43
44
 
44
45
  require 'rubocop/rake_task'
data/fbe.gemspec CHANGED
@@ -43,6 +43,7 @@ Gem::Specification.new do |s|
43
43
  s.add_dependency 'others', '~>0.1'
44
44
  s.add_dependency 'sqlite3', '~> 2.6'
45
45
  s.add_dependency 'tago', '~>0.1'
46
+ s.add_dependency 'veils', '~>0.4'
46
47
  s.add_dependency 'verbose', '~>0.0'
47
48
  s.metadata['rubygems_mfa_required'] = 'true'
48
49
  end
@@ -95,7 +95,7 @@ class Fbe::Graph
95
95
  # @param [String] owner The repository owner (username or organization)
96
96
  # @param [String] name The repository name
97
97
  # @param [String] branch The branch name (e.g., "master" or "main")
98
- # @param [Array<Array<String, String, String>> repos List of owner, name, branch
98
+ # @param [Array<Array<String, String, String>>] repos List of owner, name, branch
99
99
  # @return [Integer, Array<Hash>] The total number of commits in the branch or array with hash
100
100
  # @example
101
101
  # graph = Fbe::Graph.new(token: 'github_token')
@@ -485,7 +485,7 @@ class Fbe::Graph
485
485
  # @param [String] owner Repository owner
486
486
  # @param [String] name Repository name
487
487
  # @param [String] branch Branch name
488
- # @param [Array<Array<String, String, String>> repos List of owner, name, branch
488
+ # @param [Array<Array<String, String, String>>] repos List of owner, name, branch
489
489
  # @return [Integer, Array<Hash>] Returns 1484 for single repo or array of hashes
490
490
  def total_commits(owner = nil, name = nil, branch = nil, repos: nil)
491
491
  raise 'Need owner, name and branch or repos' if owner.nil? && name.nil? && branch.nil? && repos.nil?
data/lib/fbe/octo.rb CHANGED
@@ -16,6 +16,7 @@ require 'octokit'
16
16
  require 'others'
17
17
  require 'tago'
18
18
  require 'uri'
19
+ require 'veil'
19
20
  require 'verbose'
20
21
  require_relative '../fbe'
21
22
  require_relative 'middleware'
@@ -284,12 +285,9 @@ class Fbe::FakeOctokit
284
285
  # fake_client = Fbe::FakeOctokit.new
285
286
  # fake_client.rate_limit.remaining #=> 100
286
287
  def rate_limit
287
- o = Object.new
288
- def o.remaining
289
- 100
290
- end
291
- o
288
+ Veil.new(nil, remaining: 100)
292
289
  end
290
+
293
291
  alias rate_limit! rate_limit
294
292
 
295
293
  # Lists repositories for a user or organization.
data/lib/fbe/overwrite.rb CHANGED
@@ -39,10 +39,15 @@ def Fbe.overwrite(fact, property_or_hash, values = nil, fb: Fbe.fb, fid: '_id')
39
39
  fact.all_properties.each do |k|
40
40
  before[k.to_s] = fact[k]
41
41
  end
42
- property_or_hash.each do |k, v|
43
- raise "The value for #{k} is nil" if v.nil?
44
- before[k.to_s] = v.is_a?(Array) ? v : [v]
42
+ modified = false
43
+ property_or_hash.each do |k, vv|
44
+ raise "The value for #{k} is nil" if vv.nil?
45
+ vv = [vv] unless vv.is_a?(Array)
46
+ next if before[k.to_s] == vv
47
+ before[k.to_s] = vv
48
+ modified = true
45
49
  end
50
+ return fact unless modified
46
51
  id = fact[fid]&.first
47
52
  raise "There is no #{fid} in the fact, cannot use Fbe.overwrite" if id.nil?
48
53
  raise "No facts by #{fid} = #{id}" if fb.query("(eq #{fid} #{id})").delete!.zero?
data/lib/fbe/tombstone.rb CHANGED
@@ -22,11 +22,32 @@ class Fbe::Tombstone
22
22
  @fid = fid
23
23
  end
24
24
 
25
+ # See all issues in the tombstone, as array of numbers.
26
+ # @param [String] where The place, e.g. "github"
27
+ # @param [Integer] repo ID of repository
28
+ # @return [Array<Integer>] IDs of issue
29
+ def issues(where, repo)
30
+ raise 'The type of "where" is not String' unless where.is_a?(String)
31
+ raise 'The type of "repo" is not Integer' unless repo.is_a?(Integer)
32
+ f = @fb.query(
33
+ "(and (eq where '#{where}') (eq what 'tombstone') (eq repository #{repo}) (exists issues))"
34
+ ).each.first
35
+ return [] if f.nil?
36
+ f['issues'].map do |ii|
37
+ a, b = ii.split('-').map(&:to_i)
38
+ b = a if b.nil?
39
+ (a..b).map { |i| i }
40
+ end.flatten
41
+ end
42
+
25
43
  # Put it there.
26
44
  # @param [String] where The place, e.g. "github"
27
45
  # @param [Integer] repo ID of repository
28
- # @param [Integer] issue ID of issue (or array of them)
46
+ # @param [Integer, Array<Integer>] issue ID of issue (or array of them)
29
47
  def bury!(where, repo, issue)
48
+ raise 'The type of "where" is not String' unless where.is_a?(String)
49
+ raise 'The type of "repo" is not Integer' unless repo.is_a?(Integer)
50
+ raise 'The type of "issue" is neither Integer nor Array' unless issue.is_a?(Integer) || issue.is_a?(Array)
30
51
  f =
31
52
  Fbe.if_absent(fb: @fb, always: true) do |n|
32
53
  n.what = 'tombstone'
@@ -48,16 +69,20 @@ class Fbe::Tombstone
48
69
  end
49
70
  end
50
71
  Fbe.overwrite(
51
- f, 'issues', merged.map { |ii| ii[0] == ii[1] ? ii[0].to_s : "#{ii[0]}-#{ii[1]}" }, fb: @fb, fid: @fid
72
+ f, 'issues', merged.map { |ii| ii[0] == ii[1] ? ii[0].to_s : "#{ii[0]}-#{ii[1]}" },
73
+ fb: @fb, fid: @fid
52
74
  )
53
75
  end
54
76
 
55
77
  # Is it there?
56
78
  # @param [String] where The place, e.g. "github"
57
79
  # @param [Integer] repo ID of repository
58
- # @param [Integer] issue ID of issue (or array of them)
80
+ # @param [Integer, Array<Integer>] issue ID of issue (or array of them)
59
81
  # @return [Boolean] True if it's there
60
82
  def has?(where, repo, issue)
83
+ raise 'The type of "where" is not String' unless where.is_a?(String)
84
+ raise 'The type of "repo" is not Integer' unless repo.is_a?(Integer)
85
+ raise 'The type of "issue" is neither Integer nor Array' unless issue.is_a?(Integer) || issue.is_a?(Array)
61
86
  f = @fb.query(
62
87
  "(and (eq where '#{where}') (eq what 'tombstone') (eq repository #{repo}) (exists issues))"
63
88
  ).each.first
@@ -52,9 +52,9 @@ end
52
52
  # @param [Loog] loog Logger for debug output
53
53
  # @param [Time] epoch When the entire update started
54
54
  # @param [Time] kickoff When the particular judge started
55
- # @param [quota_aware] Boolean Should we stop if quota is off?
56
- # @param [lifetime_aware] Boolean Should we stop if lifetime is over?
57
- # @param [timeout_aware] Boolean Should we stop if timeout is over?
55
+ # @param [Boolean] quota_aware Should we stop if quota is off?
56
+ # @param [Boolean] lifetime_aware Should we stop if lifetime is over?
57
+ # @param [Boolean] timeout_aware Should we stop if timeout is over?
58
58
  # @return [Array<String>] Shuffled list of repository full names (e.g., 'org/repo')
59
59
  # @raise [RuntimeError] If no repositories match the provided masks
60
60
  # @note Exclusion patterns must start with '-' (e.g., '-org/pattern*')
data/lib/fbe.rb CHANGED
@@ -10,5 +10,5 @@
10
10
  # License:: MIT
11
11
  module Fbe
12
12
  # Current version of the gem (changed by +.rultor.yml+ on every release)
13
- VERSION = '0.41.5' unless const_defined?(:VERSION)
13
+ VERSION = '0.42.0' unless const_defined?(:VERSION)
14
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.41.5
4
+ version: 0.42.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
@@ -303,6 +303,20 @@ dependencies:
303
303
  - - "~>"
304
304
  - !ruby/object:Gem::Version
305
305
  version: '0.1'
306
+ - !ruby/object:Gem::Dependency
307
+ name: veils
308
+ requirement: !ruby/object:Gem::Requirement
309
+ requirements:
310
+ - - "~>"
311
+ - !ruby/object:Gem::Version
312
+ version: '0.4'
313
+ type: :runtime
314
+ prerelease: false
315
+ version_requirements: !ruby/object:Gem::Requirement
316
+ requirements:
317
+ - - "~>"
318
+ - !ruby/object:Gem::Version
319
+ version: '0.4'
306
320
  - !ruby/object:Gem::Dependency
307
321
  name: verbose
308
322
  requirement: !ruby/object:Gem::Requirement