sous-chefs / users

Development repository for the users cookbook
https://supermarket.chef.io/cookbooks/users
Apache License 2.0
138 stars 217 forks source link

Support Chef < 12 #99

Closed gsaslis closed 9 years ago

gsaslis commented 9 years ago

source_url and issues_url are Chef 12 attributes that do not have backwards compatibility, so only set them if running with a version of Chef that supports them.

Addresses PR #98 .

(many occurrences of this all over - e.g. see https://github.com/logentries/le_chef/pull/30 )

gsaslis commented 9 years ago

this should be an easy merge?

gsaslis commented 9 years ago

anything else I can do to have this merged in? : )

(think of the poor old devs stuck with chef < 12 ... :cry: )

mburns commented 9 years ago

+1 this seems to be the correct fix.

jblaine commented 9 years ago

+1

jtimberman commented 9 years ago

The version on supermarket does not have a metadata.rb.

This means that a new version needs to be uploaded to Supermarket w/o these metadata attributes.

We generally release using stove.

The metadata.rb needs to guard whether Stove is being used.

Users may be running Berkshelf to upload their cookbooks.

So the metadata.rb needs to guard whether Berkshelf is being used.

At least, I think that's the case. Newer versions of Berkshelf and Stove might have learned how to handle these metadata fields.

If the main problem is that using knife to upload fails, I'd strongly recommend upgrading local workstations where cookbooks are uploaded from to have the latest ChefDK installed. That comes with Chef 12.3.0, and Chef 12.3.0 is backwards compatible with Chef Server 11.

jtimberman commented 9 years ago

So, while this seems like a simple fix, there's more to it than that, and we have multiple scenarios in which to test things. "Just remove those metadata fields" seems like an approach but that means we aren't taking advantage of useful features in newer versions. Why else would we create new features if we didn't want to use them?

Users can always make use of older versions of the cookbook(s) that don't have those metadata fields. These are the kinds of tradeoffs everyone makes when developing software vs sticking with specific older versions.

gsaslis commented 9 years ago

ok - fair point @jtimberman .. hadn't really looked at the whole supermarket release process so far, so thanks for pointing that out!!

i think we can close this if you agree.

For completeness, the two attributes were added in this commit in version 1.8.1, so anyone still having this problem could use an older version, as @jtimberman suggested.
My only point would be that this should have had at least a minor version bump to stop anyone running with '~>1.8.0' running into this.. ; )