fbe 0.48.0 → 0.48.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 538f8ba632b6f0b3990005e4b685dd6ae566cd6c7716f873ffffce71374762f6
4
- data.tar.gz: a6caf3ed9674d00f32bb63663d654bb32f98f2c958ca9002cb707f5c778705eb
3
+ metadata.gz: 4392267bd1f65b17c78d201c2a4516ffdcae3b94c23635d069080bfe605a4108
4
+ data.tar.gz: aec58a15b372a499cebbc83030780299e76a9f0410aa4fb4f36a6edd078d90eb
5
5
  SHA512:
6
- metadata.gz: 3897f73ce91ee6ccb0e41d9831f4fb812ed305d1a79e35bde091cc58d209718fb660a5a6cd0175365d1b3c77ff75b74f3fd04fb7865fd636fc7b886688527fbb
7
- data.tar.gz: f0c988a409b17630d786b79a17b5e02204c42693e419861948502db001d959eedd90101c80faf5131d5475ed9aee85376923cb8a89f00d40643331f42576d613
6
+ metadata.gz: 2dd7e4369b69c8a81c84d464928b00c6841dfd322dda9cbc0dd0a060ae6c5c54a1be30f22be08e72a8598771681ac0f0902372fede811f17bf9ce201dc529567
7
+ data.tar.gz: '08047926731e07c24ee1d61d8cb2d3fb01c56d0b8a093e53ee8def31d9251b90c50e3a4214c2d559d629f4bdf3b74c5b86b8619f12432ebeac8437af9e3be02a'
data/Gemfile CHANGED
@@ -6,7 +6,8 @@
6
6
  source 'https://rubygems.org'
7
7
  gemspec
8
8
 
9
- gem 'minitest', '~>5.25', require: false
9
+ gem 'minitest', '~>6.0', require: false
10
+ gem 'minitest-mock', '~>5.27', require: false
10
11
  gem 'minitest-reporters', '~>1.7', require: false
11
12
  gem 'minitest-stub-const', '~>0.6', require: false
12
13
  gem 'os', '~>1.1', require: false
data/Gemfile.lock CHANGED
@@ -122,7 +122,7 @@ GEM
122
122
  intercepted (0.2.0)
123
123
  iri (0.11.3)
124
124
  joined (0.4.0)
125
- json (2.17.1)
125
+ json (2.18.0)
126
126
  judges (0.58.0)
127
127
  backtrace (~> 0.4)
128
128
  baza.rb (~> 0.10)
@@ -148,7 +148,9 @@ GEM
148
148
  logger (1.7.0)
149
149
  loog (0.6.1)
150
150
  logger (~> 1.0)
151
- minitest (5.27.0)
151
+ minitest (6.0.0)
152
+ prism (~> 1.5)
153
+ minitest-mock (5.27.0)
152
154
  minitest-reporters (1.7.1)
153
155
  ansi
154
156
  builder
@@ -198,7 +200,7 @@ GEM
198
200
  regexp_parser (2.11.3)
199
201
  retries (0.0.5)
200
202
  rexml (3.4.4)
201
- rubocop (1.81.7)
203
+ rubocop (1.82.0)
202
204
  json (~> 2.3)
203
205
  language_server-protocol (~> 3.17.0.2)
204
206
  lint_roller (~> 1.1.0)
@@ -206,7 +208,7 @@ GEM
206
208
  parser (>= 3.3.0.2)
207
209
  rainbow (>= 2.2.2, < 4.0)
208
210
  regexp_parser (>= 2.9.3, < 3.0)
209
- rubocop-ast (>= 1.47.1, < 2.0)
211
+ rubocop-ast (>= 1.48.0, < 2.0)
210
212
  ruby-progressbar (~> 1.7)
211
213
  unicode-display_width (>= 2.4.0, < 4.0)
212
214
  rubocop-ast (1.48.0)
@@ -278,7 +280,8 @@ PLATFORMS
278
280
 
279
281
  DEPENDENCIES
280
282
  fbe!
281
- minitest (~> 5.25)
283
+ minitest (~> 6.0)
284
+ minitest-mock (~> 5.27)
282
285
  minitest-reporters (~> 1.7)
283
286
  minitest-stub-const (~> 0.6)
284
287
  os (~> 1.1)
@@ -396,38 +396,49 @@ class Fbe::Graph
396
396
  # @param [Time] since The datetime from
397
397
  # @return [Hash] A hash with total commits and hocs
398
398
  def total_commits_pushed(owner, name, since)
399
- # @todo #1223:60min Missing pagination could cause performance issues or API failures. You need add
400
- # pagination for commit history, for more info see
401
- # https://github.com/zerocracy/fbe/pull/366#discussion_r2610751758
402
- result = query(
403
- <<~GRAPHQL
404
- {
405
- repository(owner: "#{owner}", name: "#{name}") {
406
- defaultBranchRef {
407
- target {
408
- ... on Commit {
409
- history(since: "#{since.utc.iso8601}") {
410
- totalCount
411
- nodes {
412
- oid
413
- parents {
414
- totalCount
399
+ cursor = nil
400
+ total = 0
401
+ hoc = 0
402
+ loop do
403
+ after = "after: \"#{cursor}\", " unless cursor.nil?
404
+ result = query(
405
+ <<~GRAPHQL
406
+ {
407
+ repository(owner: "#{owner}", name: "#{name}") {
408
+ defaultBranchRef {
409
+ target {
410
+ ... on Commit {
411
+ history(#{after}first: 100, since: "#{since.utc.iso8601}") {
412
+ totalCount
413
+ nodes {
414
+ oid
415
+ parents {
416
+ totalCount
417
+ }
418
+ additions
419
+ deletions
420
+ }
421
+ pageInfo {
422
+ endCursor
423
+ hasNextPage
415
424
  }
416
- additions
417
- deletions
418
425
  }
419
426
  }
420
427
  }
421
428
  }
422
429
  }
423
430
  }
424
- }
425
- GRAPHQL
426
- ).to_h
427
- commits = result.dig('repository', 'defaultBranchRef', 'target', 'history', 'nodes')
431
+ GRAPHQL
432
+ ).to_h
433
+ commits = result.dig('repository', 'defaultBranchRef', 'target', 'history', 'nodes')
434
+ hoc += commits.nil? ? 0 : commits.sum { (_1['additions'] || 0) + (_1['deletions'] || 0) }
435
+ total = result.dig('repository', 'defaultBranchRef', 'target', 'history', 'totalCount') || 0
436
+ break unless result.dig('repository', 'defaultBranchRef', 'target', 'history', 'pageInfo', 'hasNextPage')
437
+ cursor = result.dig('repository', 'defaultBranchRef', 'target', 'history', 'pageInfo', 'endCursor')
438
+ end
428
439
  {
429
- 'commits' => result.dig('repository', 'defaultBranchRef', 'target', 'history', 'totalCount') || 0,
430
- 'hoc' => commits.nil? ? 0 : commits.sum { (_1['additions'] || 0) + (_1['deletions'] || 0) }
440
+ 'commits' => total,
441
+ 'hoc' => hoc
431
442
  }
432
443
  end
433
444
 
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.48.0' unless const_defined?(:VERSION)
13
+ VERSION = '0.48.1' 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.48.0
4
+ version: 0.48.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko