github_repo_statistics 2.2.5 → 2.2.7

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: '098bd667cda32241d7ab61dbb2e082f984ba37fdb97fc4c4eecbb3dc9ada2bf8'
4
- data.tar.gz: e9e1bc573dd268e24a800bfb073593d1f49e8b8a6f780e03fefeaa0cce93c0c1
3
+ metadata.gz: 59634e40931b882f4ee361ce7169a527319207e692e4107557456789b7059c7d
4
+ data.tar.gz: 5e70e25d137e0eb869c83750f946231d3d6222e5f8bf3aac1e22898035935e1e
5
5
  SHA512:
6
- metadata.gz: 1615cf4239d1fd36ebd8c57679e455b3d36942e06f799d3fb4bcf69df8dfd924933f5a408d151f483612719a2c68d655554aa042af8fdd8b97e789b7fddb39dc
7
- data.tar.gz: 05e59fd15569fceb54e44a5ffd76e4b0fca3fb761eeff78e13da89759f07df61fc10ba18708473eaa439649d483f2bfda6a1ae81e9d61cb40d6eef64e4b13344
6
+ metadata.gz: 15904f86e2c96e74e1396c5470ad3ef1698800b110840cc3b8b2d0000914a09984225c92eb3297878b8e4a4ab608d4efa5e134b2f6357ae048606573131f5c17
7
+ data.tar.gz: e1cb2e8c6e491e0cc30b55abc67fb39a2ae0be11907b05efe7b92299699317c00db25116a56a2386cb7ab227e8cade36ac71f2e74c52d4b77d66ba597ea864d2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- github_repo_statistics (2.1.0)
4
+ github_repo_statistics (2.2.6)
5
5
  date
6
6
  faraday-retry
7
7
  google-cloud-bigquery
@@ -13,9 +13,6 @@ class ForceMergeReport
13
13
  end
14
14
 
15
15
  def report
16
- require "json"
17
- puts JSON.parse(ENV['BQ_CREDENTIALS'])
18
-
19
16
  client = Octokit::Client.new(access_token: @token)
20
17
  client.auto_paginate = true
21
18
 
@@ -23,7 +20,7 @@ class ForceMergeReport
23
20
  pull_requests = client.list_issues(@repo, state: 'closed', since: DateTime.now - @duration_in_days)
24
21
 
25
22
  # Sort PRs into monthly chunks
26
- weekly_pull_requests = pull_requests.group_by { |pr| pr.closed_at.strftime('%Y-%U') }
23
+ weekly_pull_requests = pull_requests.group_by { |pr| pr.closed_at.strftime('%Y-%W') }
27
24
 
28
25
  # Initialize a hash to store monthly summaries
29
26
  weekly_summaries = Hash.new { |hash, key| hash[key] = { total: 0, failed: 0, workflows: Hash.new(0) } }
@@ -52,6 +49,10 @@ class ForceMergeReport
52
49
  # Filter checks without meeting the required status checks
53
50
  failed_checks = all_checks.reject { |check| check.conclusion == 'success' || check.state == 'success' }
54
51
 
52
+ failed_checks.select! do |check|
53
+ ['Mergeable: Size check', 'SonarQube Code Analysis', 'UI Tests'].include?(check.name)
54
+ end
55
+
55
56
  # Update monthly summary
56
57
  weekly_summaries[month][:total] += 1
57
58
  weekly_summaries[month][:failed] += 1 unless failed_checks.empty?
@@ -28,7 +28,7 @@ class ReviewReport
28
28
  pull_requests = client.list_issues(@repo, state: 'closed', since: DateTime.now - @duration_in_days)
29
29
 
30
30
  # Group pull requests by week
31
- pull_requests_by_week = pull_requests.group_by { |pr| pr[:closed_at].strftime('%Y-%U') }
31
+ pull_requests_by_week = pull_requests.group_by { |pr| pr[:closed_at].strftime('%Y-%W') }
32
32
 
33
33
  weeks = @duration_in_days / 7
34
34
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class GithubRepoStatistics
4
- VERSION = '2.2.5'
4
+ VERSION = '2.2.7'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_repo_statistics
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.5
4
+ version: 2.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serghei Moret
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-28 00:00:00.000000000 Z
11
+ date: 2024-02-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: date