Lock vs. Snapshot


#1

Hi,

https://github.com/chef/chef-dk/blob/master/POLICYFILE_README.md talks about ‘lock’, but would ‘snapshot’ not be a better name? After all, it looks like a snapshot of cookbooks and their metadata (although granted the effect is to lock machines in the policy group to those cookbooks). Maybe I misunderstand?

Jos


#2

It parallels the nomenclature of Gemfile and Gemfile.lock and Berksfile
and Berksfile.lock. Both of which I could see the argument that they’re
’snapshots’, but the analogy with the prior usage of ‘lock’ in the
community is a pretty tight one and changing it will probably produce
more confusion not less with the same concept called ‘lock’ in one
context and ‘snapshot’ in another.

On 09/17/2015 04:01 PM, Jos Backus wrote:

Hi,

https://github.com/chef/chef-dk/blob/master/POLICYFILE_README.md talks
about ‘lock’, but would ‘snapshot’ not be a better name? After all, it
looks like a snapshot of cookbooks and their metadata (although
granted the effect is to lock machines in the policy group to those
cookbooks). Maybe I misunderstand?

Jos


#3

On Thursday, September 17, 2015 at 4:01 PM, Jos Backus wrote:

Hi,

https://github.com/chef/chef-dk/blob/master/POLICYFILE_README.md talks about ‘lock’, but would ‘snapshot’ not be a better name? After all, it looks like a snapshot of cookbooks and their metadata (although granted the effect is to lock machines in the policy group to those cookbooks). Maybe I misunderstand?

Jos
“lock” and “lockfile" are the terms I’d expect people to be familiar with, as they’re used by bundler and berkshelf and probably other tools as well.

To me the term “lock” feels more natural since you generally have dependencies that are floating to some degree (for example, if you specify a dependency in your metadata like “~> 2.0”) and you’re locking that to a specific version. Likewise, “snapshot” feels more like a “freeze frame” of a thing that’s changing naturally, like a nightly build of a project or something. I’m probably heavily biased by the way these terms are used elsewhere, but I suspect most users will have similar experiences with these terms.


Daniel DeLeo


#4

On 9/17/15, 4:18 PM, “Lamont Granquist” lamont@chef.io wrote:

It parallels the nomenclature of Gemfile and Gemfile.lock and Berksfile and Berksfile.lock. Both of which I could see the argument that they’re ‘snapshots’, but the analogy with the prior usage of ‘lock’ in the community is a pretty tight one and changing
it will probably produce more confusion not less with the same concept called ‘lock’ in one context and ‘snapshot’ in another.

Thanks for your response, and for reminding me of the unfortunate precedent of Gemfile.lock. It does make sense to be consistent indeed.

Jos

On 09/17/2015 04:01 PM, Jos Backus wrote:

Hi,

https://github.com/chef/chef-dk/blob/master/POLICYFILE_README.md talks about ‘lock’, but would ‘snapshot’ not be a better name? After all, it looks like
a snapshot of cookbooks and their metadata (although granted the effect is to lock machines in the policy group to those cookbooks). Maybe I misunderstand?

Jos


#5

On 9/17/15, 4:20 PM, “Daniel DeLeo” <ddeleo@kallistec.com on behalf of dan@kallistec.com> wrote:

On Thursday, September 17, 2015 at 4:01 PM, Jos Backus wrote:

Hi,

https://github.com/chef/chef-dk/blob/master/POLICYFILE_README.md talks about ‘lock’, but would ‘snapshot’ not be a better name? After all, it looks like a snapshot of cookbooks and their metadata (although granted the effect is to lock machines in the policy group to those cookbooks). Maybe I misunderstand?

Jos
“lock” and “lockfile" are the terms I’d expect people to be familiar with, as they’re used by bundler and berkshelf and probably other tools as well.

To me the term “lock” feels more natural since you generally have dependencies that are floating to some degree (for example, if you specify a dependency in your metadata like “~> 2.0”) and you’re locking that to a specific version. Likewise, “snapshot” feels more like a “freeze frame” of a thing that’s changing naturally, like a nightly build of a project or something. I’m probably heavily biased by the way these terms are used elsewhere, but I suspect most users will have similar experiences with these terms.

While I understand what you are saying, I’d argue that what it is and what it does are separate things. It is a snapshot with the effect of locking things down (because the ‘chef install/update’ resolves the cookbook versions and ultimately picks a single version of each cookbook, which together I’d call a snapshot of the state of the cookbook universe). So in that sense you could indeed call it a lock based on the effect that it has. But when I look at it, I can’t help but see a snapshot. :slight_smile:

At any rate, as you and Lamont point out, the consistency gained with other software is of course valuable.

Thanks for taking the time to explain, Daniel.

Jos


Daniel DeLeo