fbe 0.0.61 → 0.0.63

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 714cfed283ff521d4b0c51a0520157a1663da7786a0665debdc835fefcb39ea2
4
- data.tar.gz: 61e090588bc4b073e00a3f496e382545d9e5a04f73d36225474fbee69d8423b3
3
+ metadata.gz: 1bfbf479f7d6cc0686058767d0b66c251d32fb5d810287098e719cba2c26fa21
4
+ data.tar.gz: 2109aa7b2b2c41e356ec8ed3aad4cbe328b9b5c3b65642aef434529f5a5d0fad
5
5
  SHA512:
6
- metadata.gz: f819bf9191c6f18fc5671578f3bb3368ff3a6220df378e6938d0412fbd088d3f41f17017d3bf5d1abb59fbda12b06df99fd984769931ab7d558a31cfa1a1cd71
7
- data.tar.gz: cf1a95c3f4ecbb8ed0a4c0bf644e2b2e286a0d041a8db93781bdf40280097f7ba5c2f6b21a891807067a2a92ee999a2f335bc255d58cbeaeeb2c63129b08adcd
6
+ metadata.gz: 969259e7bbbf1d4d0063bb8e1aa7ad3ee055590def1c8d09dd090cf9f1977f0f9593d8f65db72fb3d9312fe0fdf9be14f7e0df89e6cd6f16542da39d422b58e7
7
+ data.tar.gz: 27bb3190c5471fb5b8157e5e03b4678116b56951bf761f92c78a7f3aaf5984e4687be4e9feb8800c388fbe7aa665fc988821881560c4a6ab0b451eae37161233
@@ -1,7 +1,7 @@
1
1
  (award
2
2
  (explain "When a bug is reported and accepted by the team, the reporter gets a bonus")
3
3
  (aka
4
- (let bonus {{ 8 | times: love }})
4
+ (let bonus {{ 4 | times: love }})
5
5
  (give bonus "as a basis")
6
6
  "award ${bonus} points")
7
7
  )
@@ -5,12 +5,12 @@
5
5
  (in reviews "the number of reviews provided")
6
6
 
7
7
  (aka
8
- (let basis {{ 8 | times: love }})
8
+ (let basis {{ 2 | times: love }})
9
9
  (give basis "as a basis")
10
10
  "award ${basis} points")
11
11
 
12
12
  (aka
13
- (let hoc_k {{ 0.05 | times: love }})
13
+ (let hoc_k {{ 0.025 | times: love }})
14
14
  (let hoc_threshold {{ 400 | divided_by: paranoia }})
15
15
  (let hoc_max 16)
16
16
  (let hoc_min 5)
@@ -72,7 +72,7 @@
72
72
  "deduct ${few_hoc_fee} points if you contribute less than ${hoc_needed} hits-of-code")
73
73
 
74
74
  (aka
75
- (let max 32)
75
+ (let max 24)
76
76
  (set over (if (gt (total) max) (minus max (total)) 0))
77
77
  (give over "to not go over the cap")
78
78
  (let min 4)
@@ -5,7 +5,7 @@
5
5
  (in self "1 if the review was made for their own code contribution, otherwise zero")
6
6
 
7
7
  (aka
8
- (let basis {{ 4 | times: love }})
8
+ (let basis {{ 2 | times: love }})
9
9
  (give basis "as a basis")
10
10
  "award ${basis} points")
11
11
 
@@ -16,7 +16,7 @@
16
16
  "deduct ${self_fee} points if they reviewed their own contribution")
17
17
 
18
18
  (aka
19
- (let hoc_k {{ 0.01 | times: love }})
19
+ (let hoc_k {{ 0.005 | times: love }})
20
20
  (let hoc_max 16)
21
21
  (let hoc_min 5)
22
22
  (set bonus_for_hoc (times hoc hoc_k))
@@ -41,7 +41,7 @@
41
41
  "deduct ${silence_fee} points if there were absolutely no comments made during review")
42
42
 
43
43
  (aka
44
- (let comments_k {{ 0.25 | times: love }})
44
+ (let comments_k {{ 0.125 | times: love }})
45
45
  (let comments_max 8)
46
46
  (let comments_min 5)
47
47
  (set bonus_for_comments (times comments comments_k))
@@ -58,7 +58,7 @@
58
58
  "deduct ${hoc_fee} points if there were less than ${hoc_needed} hits-of-code")
59
59
 
60
60
  (aka
61
- (let max 32)
61
+ (let max 24)
62
62
  (set over (if (gt (total) max) (minus max (total)) 0))
63
63
  (give over "to not go over the cap")
64
64
  (let min 4)
@@ -1,7 +1,7 @@
1
1
  (award
2
2
  (explain "When an enhancement is suggested and accepted by the team, the reporter gets a bonus")
3
3
  (aka
4
- (let bonus {{ 8 | times: love }})
4
+ (let bonus {{ 4 | times: love }})
5
5
  (give bonus "as a basis")
6
6
  "award ${bonus} points")
7
7
  )
@@ -4,12 +4,12 @@
4
4
  (in self "1 if the bug was reported and resolved by the same person, otherwise zero")
5
5
  (set days (div hours 24))
6
6
  (aka
7
- (let basis {{ 8 | times: love }})
7
+ (let basis {{ 2 | times: love }})
8
8
  (give basis "as a basis")
9
9
  "award ${basis} points")
10
10
 
11
11
  (aka
12
- (let b1 {{ 4 | times: love }})
12
+ (let b1 {{ 2 | times: love }})
13
13
  (let hours_threshold {{ 48 | divided_by: paranoia }})
14
14
  (set b1 (if (lt hours hours_threshold) b1 0))
15
15
  (give b1 "for resolving it in less than ${hours_threshold} hours")
@@ -30,7 +30,7 @@
30
30
  "deduct ${day_fee} points for each day of delay, but no more than ${days_fee_max} points")
31
31
 
32
32
  (aka
33
- (let max 24)
33
+ (let max 16)
34
34
  (set over (if (gt (total) max) (minus max (total)) 0))
35
35
  (give over "to not go over the cap")
36
36
  (let min 4)
data/lib/fbe/octo.rb CHANGED
@@ -297,6 +297,29 @@ class Fbe::FakeOctokit
297
297
  }
298
298
  end
299
299
 
300
+ def pull_request_reviews(_repo, _number)
301
+ [
302
+ {
303
+ id: 22_449_327,
304
+ user: { login: 'yegor256', id: 526_301, type: 'User' },
305
+ body: 'Some text 2',
306
+ state: 'CHANGES_REQUESTED',
307
+ author_association: 'CONTRIBUTOR',
308
+ submitted_at: Time.parse('2024-08-22 10:00:00 UTC'),
309
+ commit_id: 'b15c2893f1b5453'
310
+ },
311
+ {
312
+ id: 22_449_326,
313
+ user: { login: 'yegor256', id: 526_301, type: 'User' },
314
+ body: 'Some text 1',
315
+ state: 'CHANGES_REQUESTED',
316
+ author_association: 'CONTRIBUTOR',
317
+ submitted_at: Time.parse('2024-08-21 22:00:00 UTC'),
318
+ commit_id: 'a15c2893f1b5453'
319
+ }
320
+ ]
321
+ end
322
+
300
323
  def add_comment(_repo, _issue, _text)
301
324
  {
302
325
  id: 42
@@ -335,12 +358,14 @@ class Fbe::FakeOctokit
335
358
  {
336
359
  id: 42,
337
360
  number: 10,
338
- title: 'Awesome PR 10'
361
+ title: 'Awesome PR 10',
362
+ created_at: Time.parse('2024-08-21 19:00:00 UTC')
339
363
  },
340
364
  {
341
365
  id: 43,
342
366
  number: 11,
343
- title: 'Awesome PR 11'
367
+ title: 'Awesome PR 11',
368
+ created_at: Time.parse('2024-08-21 20:00:00 UTC')
344
369
  }
345
370
  ]
346
371
  }
@@ -983,6 +1008,7 @@ class Fbe::FakeOctokit
983
1008
  conclusion: 'success',
984
1009
  name: 'copyrights',
985
1010
  started_at: '2024-08-18T08:04:44Z',
1011
+ run_started_at: '2024-08-18T08:04:44Z',
986
1012
  completed_at: '2024-08-18T08:20:17Z'
987
1013
  },
988
1014
  {
@@ -991,6 +1017,7 @@ class Fbe::FakeOctokit
991
1017
  conclusion: 'success',
992
1018
  name: 'markdown-lint',
993
1019
  started_at: '2024-08-18T08:04:44Z',
1020
+ run_started_at: '2024-08-18T08:04:44Z',
994
1021
  completed_at: '2024-08-18T08:20:17Z'
995
1022
  },
996
1023
  {
@@ -999,6 +1026,7 @@ class Fbe::FakeOctokit
999
1026
  conclusion: 'failure',
1000
1027
  name: 'pdd',
1001
1028
  started_at: '2024-08-18T08:04:44Z',
1029
+ run_started_at: '2024-08-18T08:04:44Z',
1002
1030
  completed_at: '2024-08-18T08:20:17Z'
1003
1031
  },
1004
1032
  {
@@ -1007,6 +1035,7 @@ class Fbe::FakeOctokit
1007
1035
  conclusion: 'success',
1008
1036
  name: 'rake',
1009
1037
  started_at: '2024-08-18T08:04:44Z',
1038
+ run_started_at: '2024-08-18T08:04:44Z',
1010
1039
  completed_at: '2024-08-18T08:20:17Z'
1011
1040
  },
1012
1041
  {
@@ -1015,6 +1044,7 @@ class Fbe::FakeOctokit
1015
1044
  conclusion: 'success',
1016
1045
  name: 'shellcheck',
1017
1046
  started_at: '2024-08-18T08:04:44Z',
1047
+ run_started_at: '2024-08-18T08:04:44Z',
1018
1048
  completed_at: '2024-08-18T08:20:17Z'
1019
1049
  },
1020
1050
  {
@@ -1023,6 +1053,7 @@ class Fbe::FakeOctokit
1023
1053
  conclusion: 'failure',
1024
1054
  name: 'yamllint',
1025
1055
  started_at: '2024-08-18T08:04:44Z',
1056
+ run_started_at: '2024-08-18T08:04:44Z',
1026
1057
  completed_at: '2024-08-18T08:20:17Z'
1027
1058
  }
1028
1059
  ].select { |json| json[:id] == id }.first || {
@@ -1035,6 +1066,7 @@ class Fbe::FakeOctokit
1035
1066
  conclusion: 'success',
1036
1067
  workflow_id: id,
1037
1068
  created_at: random_time,
1069
+ run_started_at: random_time,
1038
1070
  repository: repository(repo)
1039
1071
  }
1040
1072
  end
data/lib/fbe.rb CHANGED
@@ -27,5 +27,5 @@
27
27
  # License:: MIT
28
28
  module Fbe
29
29
  # Current version of the gem (changed by .rultor.yml on every release)
30
- VERSION = '0.0.61'
30
+ VERSION = '0.0.63'
31
31
  end
@@ -51,13 +51,13 @@ class TestBylaws < Minitest::Test
51
51
  { hoc: 30_000, contributors: 1 } => 32
52
52
  },
53
53
  'resolved-bug-was-rewarded' => {
54
- { hours: 1, self: 0 } => 24,
55
- { hours: 48, self: 0 } => 14,
56
- { hours: 80, self: 0 } => 13,
54
+ { hours: 1, self: 0 } => 8,
55
+ { hours: 48, self: 0 } => 4,
56
+ { hours: 80, self: 0 } => 4,
57
57
  { hours: 300, self: 0 } => 4,
58
58
  { hours: 3_000, self: 0 } => 4,
59
59
  { hours: 30_000, self: 0 } => 4,
60
- { hours: 1, self: 1 } => 8
60
+ { hours: 1, self: 1 } => 4
61
61
  },
62
62
  'push-to-master-was-punished' => {
63
63
  {} => -16
@@ -65,10 +65,10 @@ class TestBylaws < Minitest::Test
65
65
  'code-review-was-rewarded' => {
66
66
  { hoc: 0, comments: 0, self: 0 } => 4,
67
67
  { hoc: 3, comments: 0, self: 0 } => 4,
68
- { hoc: 78, comments: 7, self: 0 } => 8,
69
- { hoc: 600, comments: 1, self: 0 } => 10,
70
- { hoc: 500, comments: 40, self: 0 } => 26,
71
- { hoc: 5_000, comments: 100, self: 0 } => 32,
68
+ { hoc: 78, comments: 7, self: 0 } => 4,
69
+ { hoc: 600, comments: 1, self: 0 } => 4,
70
+ { hoc: 500, comments: 40, self: 0 } => 17,
71
+ { hoc: 5_000, comments: 100, self: 0 } => 24,
72
72
  { hoc: 100, comments: 50, self: 1 } => 4,
73
73
  { hoc: 10_000, comments: 200, self: 1 } => 4
74
74
  },
@@ -77,20 +77,21 @@ class TestBylaws < Minitest::Test
77
77
  { hoc: 3, comments: 0, reviews: 0 } => 4,
78
78
  { hoc: 78, comments: 0, reviews: 0 } => 4,
79
79
  { hoc: 78, comments: 1, reviews: 0 } => 4,
80
- { hoc: 50, comments: 15, reviews: 0 } => 5,
80
+ { hoc: 50, comments: 15, reviews: 0 } => 4,
81
81
  { hoc: 50, comments: 25, reviews: 0 } => 4,
82
- { hoc: 180, comments: 7, reviews: 2 } => 32,
83
- { hoc: 150, comments: 5, reviews: 1 } => 27,
82
+ { hoc: 180, comments: 7, reviews: 2 } => 13,
83
+ { hoc: 199, comments: 8, reviews: 3 } => 14,
84
+ { hoc: 150, comments: 5, reviews: 1 } => 8,
84
85
  { hoc: 500, comments: 25, reviews: 2 } => 4,
85
- { hoc: 99, comments: 6, reviews: 1 } => 26,
86
+ { hoc: 99, comments: 6, reviews: 1 } => 4,
86
87
  { hoc: 1_500, comments: 3, reviews: 0 } => 4,
87
88
  { hoc: 15_000, comments: 40, reviews: 0 } => 4
88
89
  },
89
90
  'bug-report-was-rewarded' => {
90
- {} => 16
91
+ {} => 8
91
92
  },
92
93
  'enhancement-suggestion-was-rewarded' => {
93
- {} => 16
94
+ {} => 8
94
95
  },
95
96
  'dud-was-punished' => {
96
97
  {} => -16
@@ -104,7 +105,7 @@ class TestBylaws < Minitest::Test
104
105
  assert(!formula.nil?, title)
105
106
  a = Fbe::Award.new(formula)
106
107
  help = [
107
- " '#{title.gsub('-', '_')}' => {\n ",
108
+ " '#{title.gsub('_', '-')}' => {\n ",
108
109
  pairs.map do |args, _|
109
110
  [
110
111
  '{',
@@ -160,7 +160,7 @@ class TestOcto < Minitest::Test
160
160
  assert(!o.off_quota) if n > 100
161
161
  limit -= 1
162
162
  end
163
- assert_in_delta(pause, Time.now - start_time, 1)
163
+ assert_in_delta(pause, Time.now - start_time, 5)
164
164
  end
165
165
 
166
166
  def test_fetches_fake_check_runs_for_ref
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.61
4
+ version: 0.0.63
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-25 00:00:00.000000000 Z
11
+ date: 2024-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace