chef-cli 5.6.12 → 5.6.13

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: 545307db6897b00d78f3b25421371e56f37fe7ef0f58698ad2cef26ff761ac1e
4
- data.tar.gz: f66467c288febf6b0f1a7ab85fac3a2a9881ca9976b571f29abd966372d91548
3
+ metadata.gz: 91bf4c20f2e571268b98a467e2f708ff7e87f5a6f1caddf6c1d2eaab0815e6a9
4
+ data.tar.gz: f337d8fefb2dfbc90cbb37f003b65948dffbf901918b81ddadd0c671df93547e
5
5
  SHA512:
6
- metadata.gz: 398f7c876022b50b7f6f35788c28e40cc722d1ebc66930d0ae93a1a8b276c731ae44b5c679a8b52b930d5bbc4442b2875dcb2bf8dd90ac0a260bc58db31ff540
7
- data.tar.gz: 18a0ff8e27a0d5aaabb95104091f134127f73db19c63fc1d4f3cb9b4ae6e475c09322b325fe624691f522058e4b78ea1cd2f1bea61324cf1e1a45a92636dd374
6
+ metadata.gz: 7fbf23fb835d00f629d14c1dfd1457874db6db968e2a9095d3869359aa73c8a8fd881fb6d0f98367e382482c63e8c035984270171be31510c7353ba47882df5f
7
+ data.tar.gz: 9d7737dc9edd87a309635c13de1819b7bf366612ed7a3f629adbe1ca8b8d6a0a840a2a4cf4de5dfe71ed2e211ef792f9f2f5f58077f51dba0c3582acb4b4265f
data/chef-cli.gemspec CHANGED
@@ -41,7 +41,7 @@ Gem::Specification.new do |gem|
41
41
 
42
42
  gem.add_dependency "mixlib-cli", ">= 1.7", "< 3.0"
43
43
  gem.add_dependency "mixlib-shellout", ">= 2.0", "< 4.0"
44
- gem.add_dependency "ffi-yajl", ">= 1.0", "< 3.0"
44
+ gem.add_dependency "ffi-yajl", ">= 1.0", "< 4.0"
45
45
  gem.add_dependency "minitar", "~> 0.6"
46
46
  gem.add_dependency "chef", ">= 16.0"
47
47
  gem.add_dependency "solve", "< 5.0", "> 2.0"
@@ -23,10 +23,17 @@ module ChefCLI
23
23
 
24
24
  include Helpers
25
25
 
26
+ @@git_memo = {}
27
+
26
28
  attr_reader :cookbook_path
27
29
 
30
+ def self.uncache
31
+ @@git_memo = {}
32
+ end
33
+
28
34
  def initialize(cookbook_path)
29
35
  @cookbook_path = cookbook_path
36
+ @repo_path = nil
30
37
  @unborn_branch = nil
31
38
  @unborn_branch_ref = nil
32
39
  end
@@ -111,8 +118,24 @@ module ChefCLI
111
118
  end
112
119
 
113
120
  def git(subcommand, options = {})
114
- options = { cwd: cookbook_path }.merge(options)
115
- system_command("git #{subcommand}", options)
121
+ # memoize commands per-repo
122
+ repo_path = get_repo_path
123
+ memo_key = [repo_path, subcommand, options]
124
+ if @@git_memo.key?(memo_key)
125
+ rv = @@git_memo[memo_key]
126
+ else
127
+ options = { cwd: cookbook_path }.merge(options)
128
+ rv = system_command("git #{subcommand}", options)
129
+ @@git_memo[memo_key] = rv
130
+ end
131
+ rv
132
+ end
133
+
134
+ def get_repo_path
135
+ unless @repo_path
136
+ @repo_path = system_command("git rev-parse --show-toplevel", { cwd: cookbook_path }).stdout.strip
137
+ end
138
+ @repo_path
116
139
  end
117
140
 
118
141
  def detect_current_branch
@@ -16,5 +16,5 @@
16
16
  #
17
17
 
18
18
  module ChefCLI
19
- VERSION = "5.6.12".freeze
19
+ VERSION = "5.6.13".freeze
20
20
  end
@@ -25,7 +25,8 @@ describe ChefCLI::CookbookProfiler::Git do
25
25
 
26
26
  include ChefCLI::Helpers
27
27
 
28
- let(:git_profiler) do
28
+ let!(:git_profiler) do
29
+ ChefCLI::CookbookProfiler::Git.uncache
29
30
  ChefCLI::CookbookProfiler::Git.new(cookbook_path)
30
31
  end
31
32
 
@@ -50,6 +50,10 @@ describe ChefCLI::PolicyfileLock, "building a lockfile", :skip_on_windows do
50
50
  ChefCLI::Policyfile::StorageConfig.new( cache_path: cache_path, relative_paths_root: relative_paths_root )
51
51
  end
52
52
 
53
+ let!(:git_memo) do
54
+ ChefCLI::CookbookProfiler::Git.uncache
55
+ end
56
+
53
57
  context "when a cached cookbook omits the cache key" do
54
58
 
55
59
  let(:policyfile_lock) do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.12
4
+ version: 5.6.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-22 00:00:00.000000000 Z
11
+ date: 2023-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-cli
@@ -59,7 +59,7 @@ dependencies:
59
59
  version: '1.0'
60
60
  - - "<"
61
61
  - !ruby/object:Gem::Version
62
- version: '3.0'
62
+ version: '4.0'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
@@ -69,7 +69,7 @@ dependencies:
69
69
  version: '1.0'
70
70
  - - "<"
71
71
  - !ruby/object:Gem::Version
72
- version: '3.0'
72
+ version: '4.0'
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: minitar
75
75
  requirement: !ruby/object:Gem::Requirement