berkshelf 7.0.6 → 7.0.7

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: 547a8faa0841fb8dbd0c8f534bcc47d765dd0a36ac9414248a0d60e5cb55bb0f
4
- data.tar.gz: cc0b2093ad106ce83f9ff8903e78783d01aab14f71cb00983ef050ddf37c5252
3
+ metadata.gz: '0302691c0c7919915b431f9317cb068196609e0328b332a31dc8f0d6238ab7a1'
4
+ data.tar.gz: 615306cfb0d62b5fe127ccd70b1d1f576bd4aa982b9d83a79124833f94f1e89b
5
5
  SHA512:
6
- metadata.gz: 4feca3fb0ac9ad3f92dc8e97cc3ffd1b265d70e8d6bacbc381cf9dddf183f3529c464923d7d24f69344a20fcaf623e72093900bd2f5adccb141e769a8e538e71
7
- data.tar.gz: dac1553f7c1b03774847482c4adeee183deb874b9b2565ff71022bd4f88f38894f559ad01434f398d86e6ae98a1e4857e0aa12017e1aeb11b757c4600f78ce69
6
+ metadata.gz: 7cfcaba8dbd5f319d237817f98bb671cfbf431e9da5be4d9a9f6034055537fbed559104e04f8e3a64dcdbf3c2401da5da943f9f3986fce6606b670a064a95971
7
+ data.tar.gz: 6ecf7fffe3a862ac1c7ea3b2e7b1c41d6304782b7f4eb1c754a5b5ae082af29c825e1a477276154760201577b4e41bab861eabc13b225cf0499aee93e21e6fa0
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## [v7.0.6](https://github.com/berkshelf/berkshelf/tree/v7.0.6) (2018-08-06)
4
+ [Full Changelog](https://github.com/berkshelf/berkshelf/compare/v7.0.5...v7.0.6)
5
+
6
+ **Merged pull requests:**
7
+
8
+ - Use Strings to access options in try\_download. Fixes \#1764. [\#1782](https://github.com/berkshelf/berkshelf/pull/1782) ([xeron](https://github.com/xeron))
9
+
3
10
  ## [v7.0.5](https://github.com/berkshelf/berkshelf/tree/v7.0.5) (2018-08-06)
4
11
  [Full Changelog](https://github.com/berkshelf/berkshelf/compare/v6.3.3...v7.0.5)
5
12
 
data/Gemfile CHANGED
@@ -10,9 +10,6 @@ group :build do
10
10
  gem "rake", ">= 10.1"
11
11
  end
12
12
 
13
- # temporarily until 13.7.x is released
14
- gem "chef", git: "https://github.com/chef/chef", branch: "master"
15
-
16
13
  group :development do
17
14
  # these all deliberately float because berkshelf has a Gemfile.lock that
18
15
  # equality pins them. temporarily pin as necessary for API breaks.
@@ -24,11 +21,14 @@ group :development do
24
21
  gem "rspec", ">= 3.0"
25
22
  gem "rspec-its", ">= 1.2"
26
23
  gem "webmock", ">= 1.11"
27
- gem "yard", ">= 0.8"
28
24
  gem "http", ">= 0.9.8"
29
25
  gem "chefstyle", git: "https://github.com/chef/chefstyle.git", branch: "master"
30
26
  end
31
27
 
28
+ group :docs do
29
+ gem "yard", ">= 0.8"
30
+ end
31
+
32
32
  instance_eval(ENV["GEMFILE_MOD"]) if ENV["GEMFILE_MOD"]
33
33
 
34
34
  # If you want to load debugging tools into the bundle exec sandbox,
@@ -1,58 +1,15 @@
1
- GIT
2
- remote: https://github.com/chef/chef
3
- revision: 111bb019fed2eea16f43acd52635607f3a33373e
4
- branch: master
5
- specs:
6
- chef (14.4.23)
7
- addressable
8
- bundler (>= 1.10)
9
- chef-config (= 14.4.23)
10
- chef-zero (>= 13.0)
11
- diff-lcs (~> 1.2, >= 1.2.4)
12
- erubis (~> 2.7)
13
- ffi (~> 1.9, >= 1.9.25)
14
- ffi-yajl (~> 2.2)
15
- highline (~> 1.6, >= 1.6.9)
16
- iniparse (~> 1.4)
17
- iso8601 (~> 0.11.0)
18
- mixlib-archive (~> 0.4)
19
- mixlib-authentication (~> 2.1)
20
- mixlib-cli (~> 1.7)
21
- mixlib-log (~> 2.0, >= 2.0.3)
22
- mixlib-shellout (~> 2.0)
23
- net-sftp (~> 2.1, >= 2.1.2)
24
- net-ssh (~> 4.2)
25
- net-ssh-multi (~> 1.2, >= 1.2.1)
26
- ohai (~> 14.0)
27
- plist (~> 3.2)
28
- proxifier (~> 1.0)
29
- rspec-core (~> 3.5)
30
- rspec-expectations (~> 3.5)
31
- rspec-mocks (~> 3.5)
32
- rspec_junit_formatter (~> 0.2.0)
33
- serverspec (~> 2.7)
34
- specinfra (~> 2.10)
35
- syslog-logger (~> 1.6)
36
- uuidtools (~> 2.1.5)
37
- chef-config (14.4.23)
38
- addressable
39
- fuzzyurl
40
- mixlib-config (>= 2.2.12, < 3.0)
41
- mixlib-shellout (~> 2.0)
42
- tomlrb (~> 1.2)
43
-
44
1
  GIT
45
2
  remote: https://github.com/chef/chefstyle.git
46
- revision: 4a885da4a201b55f2a5568bc0ea054860ccbf3c3
3
+ revision: 5e596babac0e107170ce7c5cc706646bf609ab25
47
4
  branch: master
48
5
  specs:
49
- chefstyle (0.10.0)
6
+ chefstyle (0.11.0)
50
7
  rubocop (= 0.55.0)
51
8
 
52
9
  PATH
53
10
  remote: .
54
11
  specs:
55
- berkshelf (7.0.6)
12
+ berkshelf (7.0.7)
56
13
  chef (>= 13.6.52)
57
14
  chef-config
58
15
  cleanroom (~> 1.0)
@@ -69,7 +26,7 @@ PATH
69
26
  GEM
70
27
  remote: https://rubygems.org/
71
28
  specs:
72
- activesupport (5.2.0)
29
+ activesupport (5.2.1)
73
30
  concurrent-ruby (~> 1.0, >= 1.0.2)
74
31
  i18n (>= 0.7, < 2)
75
32
  minitest (~> 5.1)
@@ -84,18 +41,54 @@ GEM
84
41
  rspec-expectations (>= 2.99)
85
42
  thor (~> 0.19)
86
43
  ast (2.4.0)
87
- backports (3.11.3)
44
+ backports (3.11.4)
88
45
  builder (3.2.3)
89
- chef-zero (14.0.6)
46
+ chef (14.7.17)
47
+ addressable
48
+ bundler (>= 1.10)
49
+ chef-config (= 14.7.17)
50
+ chef-zero (>= 13.0)
51
+ diff-lcs (~> 1.2, >= 1.2.4)
52
+ erubis (~> 2.7)
53
+ ffi (~> 1.9, >= 1.9.25)
54
+ ffi-yajl (~> 2.2)
55
+ highline (~> 1.6, >= 1.6.9)
56
+ iniparse (~> 1.4)
57
+ mixlib-archive (~> 0.4)
58
+ mixlib-authentication (~> 2.1)
59
+ mixlib-cli (~> 1.7)
60
+ mixlib-log (~> 2.0, >= 2.0.3)
61
+ mixlib-shellout (~> 2.4)
62
+ net-sftp (~> 2.1, >= 2.1.2)
63
+ net-ssh (~> 4.2)
64
+ net-ssh-multi (~> 1.2, >= 1.2.1)
65
+ ohai (~> 14.0)
66
+ plist (~> 3.2)
67
+ proxifier (~> 1.0)
68
+ rspec-core (~> 3.5)
69
+ rspec-expectations (~> 3.5)
70
+ rspec-mocks (~> 3.5)
71
+ rspec_junit_formatter (~> 0.2.0)
72
+ serverspec (~> 2.7)
73
+ specinfra (~> 2.10)
74
+ syslog-logger (~> 1.6)
75
+ uuidtools (~> 2.1.5)
76
+ chef-config (14.7.17)
77
+ addressable
78
+ fuzzyurl
79
+ mixlib-config (>= 2.2.12, < 3.0)
80
+ mixlib-shellout (~> 2.0)
81
+ tomlrb (~> 1.2)
82
+ chef-zero (14.0.11)
90
83
  ffi-yajl (~> 2.2)
91
84
  hashie (>= 2.0, < 4.0)
92
85
  mixlib-log (~> 2.0)
93
- rack (~> 2.0)
86
+ rack (~> 2.0, >= 2.0.6)
94
87
  uuidtools (~> 2.1)
95
88
  childprocess (0.9.0)
96
89
  ffi (~> 1.0, >= 1.0.11)
97
90
  cleanroom (1.0.0)
98
- concurrent-ruby (1.0.5)
91
+ concurrent-ruby (1.1.3)
99
92
  contracts (0.16.0)
100
93
  crack (0.4.3)
101
94
  safe_yaml (~> 1.0.0)
@@ -123,7 +116,7 @@ GEM
123
116
  domain_name (0.5.20180417)
124
117
  unf (>= 0.0.5, < 1.0.0)
125
118
  erubis (2.7.0)
126
- faraday (0.15.2)
119
+ faraday (0.15.3)
127
120
  multipart-post (>= 1.2, < 3)
128
121
  faraday-http-cache (2.0.0)
129
122
  faraday (~> 0.8)
@@ -144,9 +137,9 @@ GEM
144
137
  rake (>= 10.0)
145
138
  retriable (~> 2.1)
146
139
  hashdiff (0.3.7)
147
- hashie (3.5.7)
140
+ hashie (3.6.0)
148
141
  highline (1.7.10)
149
- http (3.3.0)
142
+ http (4.0.0)
150
143
  addressable (~> 2.3)
151
144
  http-cookie (~> 1.0)
152
145
  http-form_data (~> 2.0)
@@ -155,15 +148,14 @@ GEM
155
148
  domain_name (~> 0.5)
156
149
  http-form_data (2.1.1)
157
150
  http_parser.rb (0.6.0)
158
- i18n (1.0.1)
151
+ i18n (1.1.1)
159
152
  concurrent-ruby (~> 1.0)
160
153
  iniparse (1.4.4)
161
154
  ipaddress (0.8.3)
162
- iso8601 (0.11.0)
163
155
  libyajl2 (1.2.0)
164
- minitar (0.6.1)
156
+ minitar (0.7)
165
157
  minitest (5.11.3)
166
- mixlib-archive (0.4.13)
158
+ mixlib-archive (0.4.18)
167
159
  mixlib-log
168
160
  mixlib-authentication (2.1.1)
169
161
  mixlib-cli (1.7.0)
@@ -171,7 +163,7 @@ GEM
171
163
  tomlrb
172
164
  mixlib-log (2.0.4)
173
165
  mixlib-shellout (2.4.0)
174
- molinillo (0.6.5)
166
+ molinillo (0.6.6)
175
167
  multi_json (1.13.1)
176
168
  multi_test (0.1.2)
177
169
  multipart-post (2.0.0)
@@ -185,15 +177,15 @@ GEM
185
177
  net-ssh-multi (1.2.1)
186
178
  net-ssh (>= 2.6.5)
187
179
  net-ssh-gateway (>= 1.2.0)
188
- net-telnet (0.2.0)
189
- octokit (4.9.0)
180
+ net-telnet (0.1.1)
181
+ octokit (4.13.0)
190
182
  sawyer (~> 0.8.0, >= 0.5.3)
191
- ohai (14.3.0)
183
+ ohai (14.6.2)
192
184
  chef-config (>= 12.8, < 15)
193
185
  ffi (~> 1.9)
194
186
  ffi-yajl (~> 2.2)
195
187
  ipaddress
196
- mixlib-cli
188
+ mixlib-cli (>= 1.7.0)
197
189
  mixlib-config (~> 2.0)
198
190
  mixlib-log (~> 2.0, >= 2.0.1)
199
191
  mixlib-shellout (~> 2.0)
@@ -201,13 +193,13 @@ GEM
201
193
  systemu (~> 2.6.4)
202
194
  wmi-lite (~> 1.0)
203
195
  parallel (1.12.1)
204
- parser (2.5.1.2)
196
+ parser (2.5.3.0)
205
197
  ast (~> 2.4.0)
206
198
  plist (3.4.0)
207
199
  powerpack (0.1.2)
208
200
  proxifier (1.0.3)
209
- public_suffix (3.0.2)
210
- rack (2.0.5)
201
+ public_suffix (3.0.3)
202
+ rack (2.0.6)
211
203
  rainbow (3.0.0)
212
204
  rake (12.3.1)
213
205
  retriable (2.1.0)
@@ -218,7 +210,7 @@ GEM
218
210
  rspec-mocks (~> 3.8.0)
219
211
  rspec-core (3.8.0)
220
212
  rspec-support (~> 3.8.0)
221
- rspec-expectations (3.8.0)
213
+ rspec-expectations (3.8.2)
222
214
  diff-lcs (>= 1.2.0, < 2.0)
223
215
  rspec-support (~> 3.8.0)
224
216
  rspec-its (1.2.0)
@@ -238,7 +230,7 @@ GEM
238
230
  rainbow (>= 2.2.2, < 4.0)
239
231
  ruby-progressbar (~> 1.7)
240
232
  unicode-display_width (~> 1.0, >= 1.0.1)
241
- ruby-progressbar (1.9.0)
233
+ ruby-progressbar (1.10.0)
242
234
  safe_yaml (1.0.4)
243
235
  sawyer (0.8.1)
244
236
  addressable (>= 2.3.5, < 2.6)
@@ -253,14 +245,14 @@ GEM
253
245
  solve (4.0.0)
254
246
  molinillo (~> 0.6)
255
247
  semverse (>= 1.1, < 3.0)
256
- specinfra (2.75.1)
248
+ specinfra (2.76.3)
257
249
  net-scp
258
250
  net-ssh (>= 2.7)
259
- net-telnet
251
+ net-telnet (= 0.1.1)
260
252
  sfl
261
253
  syslog-logger (1.6.8)
262
254
  systemu (2.6.5)
263
- thor (0.20.0)
255
+ thor (0.20.3)
264
256
  thread_safe (0.3.6)
265
257
  tomlrb (1.2.7)
266
258
  tzinfo (1.2.5)
@@ -275,7 +267,7 @@ GEM
275
267
  crack (>= 0.3.2)
276
268
  hashdiff
277
269
  wmi-lite (1.0.0)
278
- yard (0.9.15)
270
+ yard (0.9.16)
279
271
 
280
272
  PLATFORMS
281
273
  ruby
@@ -283,7 +275,6 @@ PLATFORMS
283
275
  DEPENDENCIES
284
276
  aruba (>= 0.10.0)
285
277
  berkshelf!
286
- chef!
287
278
  chef-zero (>= 4.0)
288
279
  chefstyle!
289
280
  cucumber-expressions (= 5.0.13)
@@ -298,4 +289,4 @@ DEPENDENCIES
298
289
  yard (>= 0.8)
299
290
 
300
291
  BUNDLED WITH
301
- 1.16.1
292
+ 1.16.3
@@ -75,6 +75,55 @@ Feature: berks outdated
75
75
  * bacon (1.0.0 => 1.5.8)
76
76
  """
77
77
 
78
+ Scenario: the dependency has a version constraint and there are new items that don't satisfy it
79
+ Given the Chef Server has cookbooks:
80
+ | bacon | 1.1.0 |
81
+ | bacon | 1.5.8 |
82
+ And the cookbook store has the cookbooks:
83
+ | bacon | 1.1.0 |
84
+ And I have a Berksfile pointing at the local Berkshelf API with:
85
+ """
86
+ cookbook 'bacon', '~> 1.1.0'
87
+ """
88
+ And I write to "Berksfile.lock" with:
89
+ """
90
+ DEPENDENCIES
91
+ bacon (~> 1.1.0)
92
+
93
+ GRAPH
94
+ bacon (1.1.0)
95
+ """
96
+ When I successfully run `berks outdated`
97
+ Then the output should contain:
98
+ """
99
+ All cookbooks up to date!
100
+ """
101
+
102
+ Scenario: the dependency has a version constraint and there are new items that satisfy it and --all is given
103
+ Given the Chef Server has cookbooks:
104
+ | bacon | 1.1.0 |
105
+ | bacon | 1.5.8 |
106
+ And the cookbook store has the cookbooks:
107
+ | bacon | 1.1.0 |
108
+ And I have a Berksfile pointing at the local Berkshelf API with:
109
+ """
110
+ cookbook 'bacon', '~> 1.1.0'
111
+ """
112
+ And I write to "Berksfile.lock" with:
113
+ """
114
+ DEPENDENCIES
115
+ bacon (~> 1.1.0)
116
+
117
+ GRAPH
118
+ bacon (1.1.0)
119
+ """
120
+ When I successfully run `berks outdated --all`
121
+ Then the output should contain:
122
+ """
123
+ The following cookbooks have newer versions:
124
+ * bacon (1.1.0 => 1.5.8)
125
+ """
126
+
78
127
  Scenario: When the lockfile is not present
79
128
  Given I have a Berksfile pointing at the local Berkshelf API with:
80
129
  """
@@ -468,6 +468,10 @@ module Berkshelf
468
468
  # List of all the cookbooks which have a newer version found at a source
469
469
  # that satisfies the constraints of your dependencies.
470
470
  #
471
+ # @param [Boolean] include_non_satisfying
472
+ # include cookbooks that would not satisfy the given constraints in the
473
+ # +Berksfile+. Defaults to false.
474
+ #
471
475
  # @return [Hash]
472
476
  # a hash of cached cookbooks and their latest version grouped by their
473
477
  # remote API source. The hash will be empty if there are no newer
@@ -483,7 +487,7 @@ module Berkshelf
483
487
  # }
484
488
  # }
485
489
  # }
486
- def outdated(*names)
490
+ def outdated(*names, include_non_satisfying: false)
487
491
  validate_lockfile_present!
488
492
  validate_lockfile_trusted!
489
493
  validate_dependencies_installed!
@@ -494,7 +498,7 @@ module Berkshelf
494
498
  cookbooks = source.versions(name)
495
499
 
496
500
  latest = cookbooks.select do |cookbook|
497
- dependency.version_constraint.satisfies?(cookbook.version) &&
501
+ (include_non_satisfying || dependency.version_constraint.satisfies?(cookbook.version)) &&
498
502
  Semverse::Version.coerce(cookbook.version) > dependency.locked_version
499
503
  end.sort_by { |cookbook| cookbook.version }.last
500
504
 
@@ -235,10 +235,15 @@ module Berkshelf
235
235
  type: :array,
236
236
  desc: "Only cookbooks that are in these groups.",
237
237
  aliases: "-o"
238
+ method_option :all,
239
+ type: :boolean,
240
+ desc: "Include cookbooks that don't satisfy the version constraints.",
241
+ aliases: "-a",
242
+ default: false
238
243
  desc "outdated [COOKBOOKS]", "List dependencies that have new versions available that satisfy their constraints"
239
244
  def outdated(*names)
240
245
  berksfile = Berksfile.from_options(options)
241
- outdated = berksfile.outdated(*names)
246
+ outdated = berksfile.outdated(*names, include_non_satisfying: options[:all])
242
247
  Berkshelf.formatter.outdated(outdated)
243
248
  end
244
249
 
@@ -68,7 +68,11 @@ module Berkshelf
68
68
  if source.type == :artifactory
69
69
  options[:headers] = { "X-Jfrog-Art-Api" => source.options[:api_key] }
70
70
  end
71
- CommunityREST.new(remote_cookbook.location_path, options).download(name, version)
71
+
72
+ # Allow Berkshelf install to function if a relative url exists in location_path
73
+ path = URI.parse(remote_cookbook.location_path).absolute? ? remote_cookbook.location_path : "#{source.uri_string}#{remote_cookbook.location_path}"
74
+
75
+ CommunityREST.new(path, options).download(name, version)
72
76
  when :chef_server
73
77
  tmp_dir = Dir.mktmpdir
74
78
  unpack_dir = Pathname.new(tmp_dir) + "#{name}-#{version}"
@@ -1,3 +1,3 @@
1
1
  module Berkshelf
2
- VERSION = "7.0.6".freeze
2
+ VERSION = "7.0.7".freeze
3
3
  end
@@ -59,6 +59,31 @@ module Berkshelf
59
59
  subject.try_download(source, name, version)
60
60
  end
61
61
 
62
+ context "supports location paths" do
63
+ before(:each) do
64
+ allow(source).to receive(:type) { :supermarket }
65
+ allow(source).to receive(:options) { { ssl: {} } }
66
+ allow(source).to receive(:uri_string).and_return("http://localhost:8081/repository/chef-proxy")
67
+ allow(remote_cookbook).to receive(:location_type) { :opscode }
68
+ end
69
+
70
+ let(:rest) { double("community-rest") }
71
+
72
+ it "that are relative and prepends the source URI for the download" do
73
+ allow(remote_cookbook).to receive(:location_path) { "/api/v1" }
74
+ expect(CommunityREST).to receive(:new).with("http://localhost:8081/repository/chef-proxy/api/v1", { ssl: {} }) { rest }
75
+ expect(rest).to receive(:download).with(name, version)
76
+ subject.try_download(source, name, version)
77
+ end
78
+
79
+ it "that are absolute and uses the given absolute URI" do
80
+ allow(remote_cookbook).to receive(:location_path) { "http://localhost:8081/repository/chef-proxy/api/v1" }
81
+ expect(CommunityREST).to receive(:new).with("http://localhost:8081/repository/chef-proxy/api/v1", { ssl: {} }) { rest }
82
+ expect(rest).to receive(:download).with(name, version)
83
+ subject.try_download(source, name, version)
84
+ end
85
+ end
86
+
62
87
  context "with an artifactory source" do
63
88
  it "supports the 'opscode' location type" do
64
89
  allow(source).to receive(:type) { :artifactory }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berkshelf
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.6
4
+ version: 7.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamie Winsor
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2018-08-06 00:00:00.000000000 Z
15
+ date: 2018-11-27 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: mixlib-shellout