rnelson0 / puppet-generate-puppetfile

Generate or update a Puppetfile for use with r10k or librarian-puppet. Optionally, create a fixtures file for rspec-puppet.
92 stars 22 forks source link

noop #67

Open cdenneen opened 6 years ago

cdenneen commented 6 years ago

Is there anyway to create a noop mode for this. Trying to compare either working dir to Puppetfile with create puppetfile and trying to compare Puppetfile -> .fixtures.yml (current vs what's to be changed).

So something like working modules has ntp 7.4.4 but Puppetfile has 7.0.0 or Puppetfile has 7.4.4 and fixtures has 7.0.0

I'm still trying to determine if should have a generate Puppetfile from .fixtures since .fixtures would technically come before Puppetfile during testing so maybe generate a Puppetfile or diff from what fixtures thinks should be in Puppetfile.

working dir -> Puppetfile Puppetfile -> fixtures fixtures -> Puppetfile?

rnelson0 commented 6 years ago

I'm not certain I understand the request fully. I believe you want two things. Let me know if I misunderstand the request.

A) A --diff type feature that compares the existing Puppetfile with the proposed and updated Puppetfile (and possibly extend it to .fixtures.yml) B) A way to generate the Puppetfile from a .fixtures.yml

A is very feasible. Though git diff or equivalent would show you the delta, I assume you want a nicer format.

B might be feasible, but I am not sure I agree with the logic. In a healthy setup, fixtures should be generated from the Puppetfile (you need the Puppetfile for r10k/librarian-puppet to work, but fixtures are "only" for testing). In an unhealthy setup, it is possible only the fixtures exist and you need to recreate the Puppetfile. Is there another mode of operation I am missing?

Thanks.

cdenneen commented 6 years ago

Yes those are both the scenario's... the reason for more of a diff vs git diff is want to see what it will change before it actually changes it.

As far as the "Healthy" setup... in TDD you are going to test upgrading dependencies in .fixtures.yml first and once you believe you are at a point that is "good state" you'd want to generate the Puppetfile. So I don't believe it's unhealthy to generate Puppetfile from fixtures or in that logic healthy to do the opposite.