knapsack_pro 5.3.2 → 5.3.3

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: faf54d04d0dc54356dc2e748db408a9b05ee5d012eb0e56f57029f7341db3feb
4
- data.tar.gz: fdfc75c76af649348241cdfce8a4910e3647bb57dbd6058b013863e49f5e4640
3
+ metadata.gz: 388e3d47f2da2b0d9f1377677b912a44af5919111a86869115713488a83d84e2
4
+ data.tar.gz: '08fd59b79cc652a4045f11f24a363cac8928644a2cf2a705b766e558e77d104f'
5
5
  SHA512:
6
- metadata.gz: 14bd3b971bf915d2354cb06e6450d6db587d8df36d9c042e0379f5ad77d972e78361109f6bafd9624b86edfcbe8030805eb95a20efd519c85d9bc459a68c8985
7
- data.tar.gz: 5a4128dcc5b84d38cef6cb21f3a68685c7d68e41be16088cb8d5b76c11a82679a33cc3e95a0a4fb2f7bfb576a22bd42305763b6cbd738ebc83ebb76f8c56420e
6
+ metadata.gz: 881dc5a753a3af8ffc1320eab7dd5a50ba38909812e971a1aeb2e282a3566f27afea3b601d99784d27d9959d7cf13f2d93b8db7634f73ccfb72a82b33e4243b2
7
+ data.tar.gz: d7887b2f0bb7854b1d926f422b70ab1e4ac21904026e01863aa9b83e7a690a4df0d576f6ed863fe86e8f9dfb574db106553a7a61fc0913b1dc26ac22903c422b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ### 5.3.3
4
+
5
+ * Fix hanging CI when `git fetch --shallow-since` takes too long
6
+
7
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/213
8
+
9
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.3.2...v5.3.3
10
+
3
11
  ### 5.3.2
4
12
 
5
13
  * On top of 5.3.1, avoid noise to stderr when git is not available when collecting the build author
@@ -41,8 +41,15 @@ module KnapsackPro
41
41
  private
42
42
 
43
43
  def git_commit_authors
44
- if KnapsackPro::Config::Env.ci?
45
- `git fetch --shallow-since "one month ago" --quiet 2>/dev/null`
44
+ if KnapsackPro::Config::Env.ci? && shallow_repository?
45
+ command = 'git fetch --shallow-since "one month ago" --quiet 2>/dev/null'
46
+ begin
47
+ Timeout.timeout(5) do
48
+ `#{command}`
49
+ end
50
+ rescue Timeout::Error
51
+ KnapsackPro.logger.debug("Skip the `#{command}` command because it took too long.")
52
+ end
46
53
  end
47
54
 
48
55
  `git log --since "one month ago" 2>/dev/null | git shortlog --summary --email 2>/dev/null`
@@ -52,6 +59,11 @@ module KnapsackPro
52
59
  `git log --format="%aN <%aE>" -1 2>/dev/null`
53
60
  end
54
61
 
62
+ def shallow_repository?
63
+ result = `git rev-parse --is-shallow-repository 2>/dev/null`
64
+ result.strip == 'true'
65
+ end
66
+
55
67
  def working_dir
56
68
  dir = KnapsackPro::Config::Env.project_dir
57
69
  File.expand_path(dir)
@@ -1,3 +1,3 @@
1
1
  module KnapsackPro
2
- VERSION = '5.3.2'
2
+ VERSION = '5.3.3'
3
3
  end
data/lib/knapsack_pro.rb CHANGED
@@ -6,6 +6,7 @@ require 'uri'
6
6
  require 'rake/testtask'
7
7
  require 'digest'
8
8
  require 'securerandom'
9
+ require 'timeout'
9
10
  require_relative 'knapsack_pro/urls'
10
11
  require_relative 'knapsack_pro/version'
11
12
  require_relative 'knapsack_pro/extensions/time'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knapsack_pro
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.2
4
+ version: 5.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-20 00:00:00.000000000 Z
11
+ date: 2023-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake