fbe 0.31.0 → 0.31.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: 2621af2f5ed4213f7137482238a6c1fc2af0f534a88b196e277cdf17bb9d27de
4
- data.tar.gz: 65bfa710cd5680c579207ea1ce650c25ed743b39b835ce1500cd1b62d7d57fd4
3
+ metadata.gz: 5ed41fbbf01d78ba6023ca93c5956fc9c37bb32624fd0ff1e589deed34b5c5dd
4
+ data.tar.gz: 34495a35e25f5a6241080c4fca1a6c7d78728e66fe809f989dbadfbcebae2f8f
5
5
  SHA512:
6
- metadata.gz: a0d04610b4d6bd1bf32587b73baade530e6b22aead4fffe69f0bd6067f254d4f0899701ed84bf8a38f2fc9798ab39708d71a05d0a9681d001da5d12e8c4d47e5
7
- data.tar.gz: dc62b030009940330564967622a9e0c16f16bce715d0fcd9e00cb54a7e617a24bfd68e70409b98fcc7cfbcc70c1ff356286b4047530ebcf808fe2f20c68b1f55
6
+ metadata.gz: 2178c31a1bce0a392b717a8429036cf6018325a77714f68f25dd2d8bdb5bbaf8e822cb358a26d7a47a18cb894b00e9ea99040685a9c1f317f6bbcda0501edc6b
7
+ data.tar.gz: ca9db41e2ed0f7fcc618c9bce81d5720e3c3b820a54e74ff16661eccd6e111117f78a307358bcef7163527ea64adfa92f326112de9581b1d47934c80cd2f0a10
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.debug('We ran out of GitHub quota, must stop here')
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 = "#{Factbase::VERSION}/#{Judges::VERSION}/#{options.action_version}"
48
- f._job = options.job_id unless options.job_id.nil?
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.debug('We are off GitHub quota, cannot even start, sorry')
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.debug("We are off GitHub quota, we must skip #{repo}")
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}), stopping")
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
- id: 42,
717
- number:,
718
- repo: {
719
- full_name: repo
720
- },
721
- base: {
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
- state: 'closed',
727
- user: { login: 'yegor256', id: 526_301, type: 'User' },
728
- head: { ref: 'master', sha: '6dcb09b5b57875f334f61aebed695e2e4193db5e' },
729
- additions: 12,
730
- deletions: 5,
731
- changed_files: 3,
732
- comments: 2,
733
- review_comments: 2,
734
- closed_at: Time.parse('2024-12-20'),
735
- merged_at: Time.parse('2024-12-20'),
736
- created_at: Time.parse('2024-09-20')
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.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.31.0' unless const_defined?(:VERSION)
13
+ VERSION = '0.31.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.31.0
4
+ version: 0.31.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko