Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deprecation notices #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### chef_stack has been deprecated.
The resources have been merged into [chef-ingredient](https://github.com/chef-cookbooks/chef-ingredient). Please update your cookbooks to use chef-ingredient.

chef_stack will continue to be used as a testing ground to test potentially breaking changes.

The last stable version was 0.9.0. Anything after this version, will likely break your infrastructure.

# chef_stack

Chef stack is a library cookbook that provides custom resources to build and manage your Chef infrastructure.
Expand Down
9 changes: 9 additions & 0 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,12 @@ def ensurekv(original_config, hash)
end
config
end

def deprecation_notice
message = 'Chef Stack is deprecated. The resources have been merged into chef-ingredient. Please update your cookbooks to use chef-ingredient.'
log 'Deprecation' do
level :warn
message message
end
Chef.deprecated(:internal_api, message)
end
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
issues_url 'https://github.com/ncerny/chef_stack/issues' if respond_to?(:issues_url)
source_url 'https://github.com/ncerny/chef_stack' if respond_to?(:source_url)

version '0.8.6'
version '0.9.0'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest a patch release for the deprecation warnings. Users pinning to 0.8 will not see it. I also recommend the follow up patch release that truly deprecates this cookbook so it can't be used unless pinned specifically to 0.8.6.

Maybe fully deprecate in 30 days or so?


depends 'chef-ingredient'
2 changes: 2 additions & 0 deletions resources/automate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
end

action :create do
deprecation_notice

required_config = <<-EOF
delivery['chef_username'] = '#{new_resource.chef_user}'
delivery['chef_private_key'] = '/etc/delivery/#{new_resource.chef_user}.pem'
Expand Down
2 changes: 2 additions & 0 deletions resources/backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
end

action :create do
deprecation_notice

raise 'Must accept the Chef License agreement before continuing.' unless new_resource.accept_license

new_resource.config = ensurekv(new_resource.config, publish_address: new_resource.publish_address)
Expand Down
2 changes: 2 additions & 0 deletions resources/chef_org.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
end

action :create do
deprecation_notice

directory '/etc/opscode/orgs' do
owner 'root'
group 'root'
Expand Down
2 changes: 2 additions & 0 deletions resources/chef_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
end

action :create do
deprecation_notice

directory '/etc/opscode/users' do
owner 'root'
group 'root'
Expand Down
2 changes: 2 additions & 0 deletions resources/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
end

action :install do
deprecation_notice

chef_ingredient 'chef' do
action :upgrade
version new_resource.version
Expand Down
2 changes: 2 additions & 0 deletions resources/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
end

action :create do
deprecation_notice

new_resource.source = (property_is_set?(:source) ? new_resource.source : "cookbook_file://#{new_resource.filename}")
if new_resource.source.start_with?('cookbook_file://')
src = new_resource.source.split('://')[1].split('::')
Expand Down
2 changes: 2 additions & 0 deletions resources/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
end

action :create do
deprecation_notice

if new_resource.data_collector_url
new_resource.config << "\ndata_collector['root_url'] = '#{new_resource.data_collector_url}'"
new_resource.config << "\ndata_collector['token'] = '#{new_resource.data_collector_token}'"
Expand Down
2 changes: 2 additions & 0 deletions resources/supermarket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
end

action :create do
deprecation_notice

chef_ingredient 'supermarket' do
action :upgrade
channel new_resource.channel
Expand Down
2 changes: 2 additions & 0 deletions resources/wf_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
end

action :create do
deprecation_notice

chef_ingredient 'chefdk' do
action :upgrade
channel new_resource.channel
Expand Down