github_repo_statistics 2.2.9 → 2.2.11

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: f245b6049e774db333ca34b3adca5a17f88e4f3af89cbca24b51f4cbb348698b
4
- data.tar.gz: 54f0ff2e46b91d01a37f0f37a753d3e142f45d4e1453b582e0fb06afafa96648
3
+ metadata.gz: 45284d03e5ffb00cb2ed37dc99c775c4cd5270aa82ab8b56e71280d095fdc6f0
4
+ data.tar.gz: 14b0536562640711fc5219302932b55eaeae6d5a0ce08caf6fe01f50d3ad86b3
5
5
  SHA512:
6
- metadata.gz: 7c8744737e5f77bb61cc94d377f27f0b3441b55ca675810524fad0627f8580197ab4184d3b7539db448fef19dbcd22219b3bb9f253e2437418a706c2a8ef576b
7
- data.tar.gz: 5b3a2cfc158deaf6a867324851fab66f04ccb0bfbb4be6499bc375d1708fb37bc0c5c3979010e0ba953d28c2272729e1a254d6859f22d7765724fea884d249cf
6
+ metadata.gz: dd4cc361ad9a4e47ace0970e27fc201cfd73e14f2fe54d1be2378331c8e9de80b757c657bab8099633cf0c43cf57f972850e645e68649f19379cd0f6b613ef22
7
+ data.tar.gz: 93ac3757ec59d6ce9b433424bbf498635a9c26fa6b89324dcfb1b7164d4395588ed5cc31073b5692ae1014c8e474b374e160699d44904c6366b4181ef7119178
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- github_repo_statistics (2.2.8)
4
+ github_repo_statistics (2.2.10)
5
5
  date
6
6
  faraday-retry
7
7
  google-cloud-bigquery
@@ -31,6 +31,9 @@ class ForceMergeReport
31
31
 
32
32
  weeks = @duration_in_days / 7
33
33
 
34
+ require 'pry'
35
+ binding.pry
36
+
34
37
  (weekly_pull_requests.keys.sort[-weeks..] || []).each do |month|
35
38
  pull_requests_for_month = weekly_pull_requests[month]
36
39
  # Iterate through pull requests for the current month
@@ -52,7 +55,7 @@ class ForceMergeReport
52
55
 
53
56
  # Filter checks without meeting the required status checks
54
57
  failed_checks = all_checks.reject { |check| check.conclusion == 'success' || check.state == 'success' }
55
-
58
+
56
59
  failed_checks.select! do |check|
57
60
  ['UI Tests', 'Unit Tests'].include?(check.context) || ['Mergeable: Size check', 'SonarQube Code Analysis'].include?(check.name)
58
61
  end
@@ -90,7 +93,7 @@ class ForceMergeReport
90
93
  summary[:workflows].each do |workflow, count|
91
94
  puts " - #{workflow}: #{count}"
92
95
  end
93
- ENV['BQ_CREDENTIALS'] = `cat /Users/serghei.moret/.config/gcloud/application_default_credentials.json`
96
+
94
97
  if ENV['BQ_CREDENTIALS']
95
98
  require "google/cloud/bigquery"
96
99
  require "json"
@@ -106,6 +109,7 @@ class ForceMergeReport
106
109
  sonarqube_check = summary[:workflows]['SonarQube Code Analysis']
107
110
  ui_tests_check = summary[:workflows]['UI Tests']
108
111
  unit_tests_check = summary[:workflows]['Unit Tests']
112
+ total_prs = summary[:total]
109
113
 
110
114
  query = <<~SQL
111
115
  MERGE INTO force_merges AS target
@@ -117,10 +121,11 @@ class ForceMergeReport
117
121
  target.ui_tests_count = #{ui_tests_check},
118
122
  target.unit_tests_count = #{unit_tests_check},
119
123
  target.size_check_count = #{size_check},
120
- target.sonarqube_count = #{sonarqube_check}
124
+ target.sonarqube_count = #{sonarqube_check},
125
+ target.total_prs = #{total_prs}
121
126
  WHEN NOT MATCHED THEN
122
- INSERT (calendar_week, force_merges_count, ui_tests_count, unit_tests_count, size_check_count, sonarqube_count)
123
- VALUES ('#{week}', #{failed_count}, #{ui_tests_check}, #{unit_tests_check}, #{size_check}, #{sonarqube_check});
127
+ INSERT (calendar_week, force_merges_count, ui_tests_count, unit_tests_count, size_check_count, sonarqube_count, total_prs)
128
+ VALUES ('#{week}', #{failed_count}, #{ui_tests_check}, #{unit_tests_check}, #{size_check}, #{sonarqube_check}, #{total_prs});
124
129
  SQL
125
130
 
126
131
  dataset.query(query)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class GithubRepoStatistics
4
- VERSION = '2.2.9'
4
+ VERSION = '2.2.11'
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.9
4
+ version: 2.2.11
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-03-01 00:00:00.000000000 Z
11
+ date: 2024-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: date