github_repo_statistics 2.3.8 → 2.3.10

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: 45f9b41fdeece55840918ee51ada62d6c23509620e50c19e5a495df7bea0d0a8
4
- data.tar.gz: 1a128c270392e20ed6b0d48db13cac15f3d1dfd41ab5b5f8b0f97d46c263df9b
3
+ metadata.gz: 7c221dd45188c7427ef07040ed9d69a208ef7f3100f2e8a8b4e4c686ca608603
4
+ data.tar.gz: e179325e508dfd11feffcced476f17b989e323fda894d6d83054e8edb3915b1b
5
5
  SHA512:
6
- metadata.gz: 00c4d3572b32f831af53cec591c415828f1326875794da0df1b1009880ffd90cd1c99c01e8a6cc56b8d40ccd113fae09ecbb65d826ab273e635d1e036d782d29
7
- data.tar.gz: ceadd24b9ccc16eedaf41a99e9dc1ef7f7843994b162c0c4a89ba829528197f85715bc29305a0f6a3bbde6436f5aed7ef2ce7a716ff74168f2f72ef79e15554a
6
+ metadata.gz: 5a00ebdd94689c5e8fafc490165cbd1f71b19f07ea2e1577f571fd8af838e14eb3f2bb4ca6c61c6bc306644abc7f26f0fef421383ec31cc6e5f538bcb689cc72
7
+ data.tar.gz: 1070bf3071ed94ac590e7cfa40866b0cead2a2d3c5a5950fe476b9c6d081344d443c11f23d6ac0d80befd5ea200a7fe2d5cf65203f4366c41c72068397deacb3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- github_repo_statistics (2.3.8)
4
+ github_repo_statistics (2.3.10)
5
5
  date
6
6
  faraday-retry
7
7
  google-cloud-bigquery
@@ -155,15 +155,19 @@ end
155
155
 
156
156
  if options[:hotspot_check]
157
157
  feature_branch = `git rev-parse --abbrev-ref HEAD`.chomp
158
+ puts "Feature branch: #{feature_branch}"
158
159
  changed_files = `git diff --name-only master...#{feature_branch} | grep #{REPO_PATH} | grep '\.swift'`.split
160
+ puts "Changed files: #{changed_files}"
159
161
  branch_hotspot_files = GithubRepoStatistics.new(duration_in_days: options[:duration_in_days] || 30, directory_path: REPO_PATH,
160
162
  begin_time: DateTime.now, steps: options[:steps].to_i, debug: options[:debug]).hotspot_check(files: changed_files, branch: feature_branch)
163
+ puts "branch_hotspot_files = #{branch_hotspot_files}"
161
164
  system("git checkout #{DEFAULT_BRANCH}", [:out] => File::NULL)
162
- system('git pull', %i[out err] => File::NULL)
163
165
  master_hotspot_files = GithubRepoStatistics.new(duration_in_days: options[:duration_in_days] || 30, directory_path: REPO_PATH,
164
- begin_time: DateTime.now, steps: options[:steps].to_i, debug: options[:debug]).hotspot_check(files: changed_files, branch: DEFAULT_BRANCH)
166
+ begin_time: DateTime.now, steps: options[:steps].to_i, debug: options[:debug]).hotspot_check(files: branch_hotspot_files, branch: DEFAULT_BRANCH)
167
+ puts "master_hotspot_files = #{master_hotspot_files}"
168
+ system('git pull', %i[out err] => File::NULL)
165
169
 
166
- raise 'New hotspot was introduced, contact foundation to unblock the PR' if branch_hotspot_files > master_hotspot_files
170
+ raise 'New hotspot was introduced, contact foundation to unblock the PR' if branch_hotspot_files.count > master_hotspot_files.count
167
171
  else
168
172
  system("git checkout #{DEFAULT_BRANCH}", [:out] => File::NULL)
169
173
  system('git pull', %i[out err] => File::NULL)
@@ -211,7 +211,7 @@ class GithubRepoStatistics
211
211
  commit_count = git_commit_count(file:, start_date:, end_date:, branch:).to_i
212
212
  git_log = git_commit_info(file:, start_date:, end_date:, branch:).split("\n")
213
213
 
214
- if EXCLUDED_PRS
214
+ if EXCLUDED_PRS && branch != DEFAULT_BRANCH
215
215
  excluded_prs = EXCLUDED_PRS.split(',')
216
216
  git_log = git_log.reject { |c| excluded_prs.any? { |pr| c.include?(pr) } }
217
217
  end
@@ -417,10 +417,10 @@ class GithubRepoStatistics
417
417
  start_date = @begin_time.to_time.to_i - duration_in_days * 86_400
418
418
  end_date = @begin_time.to_time.to_i
419
419
 
420
- _, _, _, files_changed_by_many_teams, = analyze_changed_files(
420
+ resulting_files = analyze_changed_files(
421
421
  uniq_code_files_with_changes: files, start_date:, end_date:, branch:
422
- )
422
+ ).last
423
423
 
424
- files_changed_by_many_teams
424
+ resulting_files.filter { |f| resulting_files[f].first.count > 1 }.keys
425
425
  end
426
426
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class GithubRepoStatistics
4
- VERSION = '2.3.8'
4
+ VERSION = '2.3.10'
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.3.8
4
+ version: 2.3.10
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-06-05 00:00:00.000000000 Z
11
+ date: 2024-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: date