github / octocatalog-diff

Compile Puppet catalogs from 2 branches, versions, etc., and compare them
https://rubygems.org/gems/octocatalog-diff/
MIT License
239 stars 85 forks source link

Add "force" option for compare-file-text #251

Closed kpaulisse closed 3 years ago

kpaulisse commented 3 years ago

Overview

This pull request modifies the --compare-file-text option, which was previously just a binary option, to accept an additional parameter. There are now 3 behaviors:

We need this behavior because we're using --catalog-only in our workflow, and this currently auto-disables the feature because the second catalog in the non-existent diff is a "NoOp" catalog. With this change, our generated catalog will be populated with the content of static files rather than a reference to them, which is what we want.

I chose this implementation because it preserves existing behavior while still not introducing yet another command line argument. I added an integration test for this as well.

Checklist