Unify all the cookbook version constraint

Registered by zhiwei

The official document about cookbook versions: http://docs.chef.io/cookbook_versions.html

The cookbook version constraint operators are:

< (less than)
<= (less than or equal to)
= (equal to)
>= (greater than or equal to)
~> (approximately greater than)
> (greater than)

Where:

~> 2.6 will match cookbooks that are greater than or equal to version 2.6, but less than version 3.0.
~> 2.6.5 will match cookbooks that are greater than or equal to 2.6.5, but less than version 2.7.0.
>= 2.6.5 will match cookbooks greater than or equal to 2.6.5, such as 2.6.5, 2.6.7 or 3.1.1.

There is one case below:

1. cookbookA depends on cookbookX with ~> 2.6.5, cookbookB depends on cookbookX with ~> 2.7.5, and cookbookC depends on both cookbookA and cookbookB. This will cause constrains issue, but using >= operator will avoid this.

2. For 1, we can specify ~> 2.6 and ~> 2.7, this will no cause any constraints issue. But we may have the case to specify exactly constraints such as the cookbookA must depends a higher version than 2.6.5.

We should avoid updating the cookbook version constraints when it is not exactly necessary. I think `>= x.y.z and < x + 1` covers more cases than `~> x.y`.

If we want to specify two version constraint operators for one cookbook, we need to specify the depends cookbook twice in metadata file like below:

depends 'mysql', '>= 5.0.0'
depends 'mysql', '< 6.0.0'

Berkshelf will fetch the highest version of mysql cookbook between 5.0 and 6.0.

In our cookbooks development version(i.e. master branch) we can simply set `>= x.y.z`, when cutting the new branch we can add `< x+1`.

Maybe this need further discussions, and then decide whether we need to treat version constraint like this or not.

Blueprint information

Status:
Complete
Approver:
Mark Vanderwiel
Priority:
Low
Drafter:
zhiwei
Direction:
Approved
Assignee:
Mark Vanderwiel
Definition:
Approved
Series goal:
Accepted for juno
Implementation:
Implemented
Milestone target:
None
Started by
Mark Vanderwiel
Completed by
Mark Vanderwiel

Related branches

Sprints

(?)

Work Items

Work items:
Update metadata in all cookbooks: INPROGRESS

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.