github_repo_statistics 2.3.9 → 2.3.11
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 457f849fab6ab424a4079de9c938b8af018be4fa5f8cb36d7db8a5b778b65781
|
4
|
+
data.tar.gz: 3980125eac8f50a329e55a168d1fab47010ce0f4359afb7900b2cae7d92fb577
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 538eb468eeb7248876094bbfb1335cf6b0aeeca89a1119e4e1e8339d8171e70f3605510e91c866a27a90beaa3cd11c2e3979613f7eb9bb40f13408faa39c62a9
|
7
|
+
data.tar.gz: a9a1cb832f47d651049e6bb84dabd0758a283be329a4d0e713c4833104014edab051e62322d6858ee0f32f3bbb12253756bd9edb0bace209fe1b4ab43b219cc9
|
data/Gemfile.lock
CHANGED
data/bin/github_repo_statistics
CHANGED
@@ -158,14 +158,20 @@ if options[:hotspot_check]
|
|
158
158
|
puts "Feature branch: #{feature_branch}"
|
159
159
|
changed_files = `git diff --name-only master...#{feature_branch} | grep #{REPO_PATH} | grep '\.swift'`.split
|
160
160
|
puts "Changed files: #{changed_files}"
|
161
|
+
return if changed_files.empty?
|
162
|
+
|
161
163
|
branch_hotspot_files = GithubRepoStatistics.new(duration_in_days: options[:duration_in_days] || 30, directory_path: REPO_PATH,
|
162
164
|
begin_time: DateTime.now, steps: options[:steps].to_i, debug: options[:debug]).hotspot_check(files: changed_files, branch: feature_branch)
|
163
165
|
puts "branch_hotspot_files = #{branch_hotspot_files}"
|
166
|
+
return if branch_hotspot_files.empty?
|
167
|
+
|
164
168
|
system("git checkout #{DEFAULT_BRANCH}", [:out] => File::NULL)
|
165
169
|
master_hotspot_files = GithubRepoStatistics.new(duration_in_days: options[:duration_in_days] || 30, directory_path: REPO_PATH,
|
166
|
-
begin_time: DateTime.now, steps: options[:steps].to_i, debug: options[:debug]).hotspot_check(files:
|
170
|
+
begin_time: DateTime.now, steps: options[:steps].to_i, debug: options[:debug]).hotspot_check(files: branch_hotspot_files, branch: DEFAULT_BRANCH)
|
167
171
|
puts "master_hotspot_files = #{master_hotspot_files}"
|
168
|
-
|
172
|
+
system('git pull', %i[out err] => File::NULL)
|
173
|
+
|
174
|
+
raise 'New hotspot was introduced, contact foundation to unblock the PR' if branch_hotspot_files.count > master_hotspot_files.count
|
169
175
|
else
|
170
176
|
system("git checkout #{DEFAULT_BRANCH}", [:out] => File::NULL)
|
171
177
|
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
|
-
|
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
|
-
|
424
|
+
resulting_files.filter { |f| resulting_files[f].first.count > 1 }.keys
|
425
425
|
end
|
426
426
|
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.
|
4
|
+
version: 2.3.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-06-
|
11
|
+
date: 2024-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: date
|