knapsack_pro 5.3.1 → 5.3.3

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: 81a7fddcd84c41e4e3273ba731e8f68a0063762ebe8234ec8b68cd4cc3e1bcb0
4
- data.tar.gz: 213921c7b7d2789b213a80f8a943528f7ae10cf6427c455a04f38ff72a715901
3
+ metadata.gz: 388e3d47f2da2b0d9f1377677b912a44af5919111a86869115713488a83d84e2
4
+ data.tar.gz: '08fd59b79cc652a4045f11f24a363cac8928644a2cf2a705b766e558e77d104f'
5
5
  SHA512:
6
- metadata.gz: 47e7fd9c4c00952b3ebd83dba4de192718100460ad462eb68b90de24dea8df9aa066682771fc3173eaa93c5afa48bd837998711cbebc7dbb911a21d63b3d2cea
7
- data.tar.gz: f1b4ac0665596ffe4d83c83c3137f9289a36a709564854155bdf103f38151bcd63b1a58ec165593b0aa2dc3b588b7a497ed032e45ef8c3d5719ee11ee12b747b
6
+ metadata.gz: 881dc5a753a3af8ffc1320eab7dd5a50ba38909812e971a1aeb2e282a3566f27afea3b601d99784d27d9959d7cf13f2d93b8db7634f73ccfb72a82b33e4243b2
7
+ data.tar.gz: d7887b2f0bb7854b1d926f422b70ab1e4ac21904026e01863aa9b83e7a690a4df0d576f6ed863fe86e8f9dfb574db106553a7a61fc0913b1dc26ac22903c422b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
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
+
11
+ ### 5.3.2
12
+
13
+ * On top of 5.3.1, avoid noise to stderr when git is not available when collecting the build author
14
+
15
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.3.1...v5.3.2
16
+
3
17
  ### 5.3.1
4
18
 
5
19
  * Avoid noise to stderr when git is not available when collecting authors
@@ -41,15 +41,27 @@ 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`
49
56
  end
50
57
 
51
58
  def git_build_author
52
- `git log --format="%aN <%aE>" -1`
59
+ `git log --format="%aN <%aE>" -1 2>/dev/null`
60
+ end
61
+
62
+ def shallow_repository?
63
+ result = `git rev-parse --is-shallow-repository 2>/dev/null`
64
+ result.strip == 'true'
53
65
  end
54
66
 
55
67
  def working_dir
@@ -1,3 +1,3 @@
1
1
  module KnapsackPro
2
- VERSION = '5.3.1'
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.1
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-19 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