cobench 0.0.36 → 0.0.38

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: 96be8a2561b910ee67b624e728bf639f5c232ad76fb7773cb8575cb9e6581882
4
- data.tar.gz: 19050e7f9ee743cab744e380abd704e16f47ee7f6aa21f31553f53522d56410c
3
+ metadata.gz: 581c5998a978db8683fa8e675b8e293aa5b66f75a37ec52e72fabc92994c4e8b
4
+ data.tar.gz: 76b7dd517e81bdd4011d294f3a325e4b9bc271a6130fedb8c3d36c97aac49f5e
5
5
  SHA512:
6
- metadata.gz: 5589979370cf2ef019c57ecaf942ba1fab9992a5bc75736e4f681728bd6695864b8135475501ed0ee7e73fc68da8d3c1105ed3dea31eee283a9fdd2c3d1c1ab9
7
- data.tar.gz: 852309017ddf77403244d73391d6b6c8b01fd11e25f9d328f0ff98283210d6d011e1d24f6fcfc89e3a84706b7b16c7049351b880b7b822b8dbc7eed6859008a7
6
+ metadata.gz: 85618ec2a17dc04c0d6fadc20547468432fff9daa79e8cf58929a0ad81790328fc9533a8d015010ab164f05b59f23098a795e30c4a8ca14de64f3b39dbdfb901
7
+ data.tar.gz: 295d72ce7a9cd87396066e8d0f6831b1bd5830f9ad3311b86723eb1377dd4bb8772bd9bd4f48a3b6789f208313360cc549d6c88cc3c3281e7cf87ce2f4dcaf04
@@ -7,5 +7,5 @@ jobs:
7
7
  pdd:
8
8
  runs-on: ubuntu-20.04
9
9
  steps:
10
- - uses: actions/checkout@v2
10
+ - uses: actions/checkout@v3
11
11
  - uses: g4s8/pdd-action@master
@@ -15,7 +15,7 @@ jobs:
15
15
  ruby: ['2.7', '3.0']
16
16
  runs-on: ${{ matrix.os }}
17
17
  steps:
18
- - uses: actions/checkout@v2
18
+ - uses: actions/checkout@v3
19
19
  - uses: ruby/setup-ruby@v1
20
20
  with:
21
21
  ruby-version: ${{ matrix.ruby }}
@@ -7,5 +7,5 @@ jobs:
7
7
  xcop:
8
8
  runs-on: ubuntu-20.04
9
9
  steps:
10
- - uses: actions/checkout@v2
10
+ - uses: actions/checkout@v3
11
11
  - uses: g4s8/xcop-action@master
data/bin/cobench CHANGED
@@ -49,6 +49,7 @@ opts = Slop.parse(args, strict: true, help: true) do |o|
49
49
  o.bool '--dry', 'Make no real round trips to GitHub'
50
50
  o.bool '--reuse', 'Don\'t fetch from GitHub, reuse the existing XML file'
51
51
  o.integer '--days', 'How many days to measure', default: 7
52
+ o.integer '--delay', 'Delay between HTTP calls to GitHub API, in milliseconds', default: 1000
52
53
  o.string '--to', 'Directory where to save all files to', default: './cobench'
53
54
  o.string '--token', 'GitHub authentication token'
54
55
  o.array '--coder', 'GitHub nickname of a coder to track'
@@ -93,7 +94,7 @@ def build_xml(opts, loog)
93
94
  loog.warn("Connecting to GitHub without a token, this may lead to errors, use --token")
94
95
  end
95
96
  api.auto_paginate = true
96
- api = Obk.new(api, pause: 2000)
97
+ api = Obk.new(api, pause: opts[:delay])
97
98
  loog.info("Reading GitHub data for the last #{opts[:days]} days")
98
99
  titles = {}
99
100
  data = {}
@@ -169,6 +170,10 @@ def build_xml(opts, loog)
169
170
  data[u]['Score'] = { total: score }
170
171
  end
171
172
  averages = {
173
+ 'CpP': {
174
+ f: lambda { |ms| div(actual(ms['Commits']), actual(ms['Pulls'])) },
175
+ title: 'Commits per Pull Request'
176
+ },
172
177
  'HpP': {
173
178
  f: lambda { |ms| div(actual(ms['HoC']), actual(ms['Pulls'])) },
174
179
  title: 'HoC per Pull Request'
@@ -177,9 +182,9 @@ def build_xml(opts, loog)
177
182
  f: lambda { |ms| div(actual(ms['HoC']), actual(ms['Commits'])) },
178
183
  title: 'HoC per Commit'
179
184
  },
180
- 'MpP': {
181
- f: lambda { |ms| div(actual(ms['Msgs']), actual(ms['Pulls'])) },
182
- title: 'Messages per Pull Request'
185
+ 'MpRP': {
186
+ f: lambda { |ms| div(actual(ms['Msgs']), actual(ms['Reviews']) + actual(ms['Pulls'])) },
187
+ title: 'Messages per Review+Pulls'
183
188
  }
184
189
  }
185
190
  data.each do |u, ms|
data/features/cli.feature CHANGED
@@ -16,7 +16,7 @@ Feature: Simple Reporting
16
16
  And Exit code is zero
17
17
 
18
18
  Scenario: Simple report through real GitHub API
19
- When I run bin/cobench with "--coder=yegor256 --include=*/* --days=1 --verbose"
19
+ When I run bin/cobench with "--coder=yegor256 --include=*/* --days=1 --verbose --delay=5000"
20
20
  Then Stdout contains "XML saved to"
21
21
  And Exit code is zero
22
22
 
@@ -23,5 +23,5 @@
23
23
  # Copyright:: Copyright (c) 2022 Yegor Bugayenko
24
24
  # License:: MIT
25
25
  module Cobench
26
- VERSION = '0.0.36'.freeze
26
+ VERSION = '0.0.38'.freeze
27
27
  end
data/renovate.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "config:base"
5
+ ]
6
+ }
@@ -33,5 +33,7 @@ class TestReviews < Minitest::Test
33
33
  m = Cobench::Reviews.new(api, 'graur', { days: 2 })
34
34
  ms = m.take(Loog::VERBOSE)
35
35
  assert !ms.empty?
36
+ rescue Octokit::TooManyRequests
37
+ skip
36
38
  end
37
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cobench
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.36
4
+ version: 0.0.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-06 00:00:00.000000000 Z
11
+ date: 2022-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace
@@ -272,6 +272,7 @@ files:
272
272
  - lib/cobench/metrics/reviews.rb
273
273
  - lib/cobench/version.rb
274
274
  - logo.svg
275
+ - renovate.json
275
276
  - test/metrics/test_reviews.rb
276
277
  - test/test__helper.rb
277
278
  - test/test_mask.rb