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 --compare-file-text=soft #252

Closed kpaulisse closed 2 months ago

kpaulisse commented 3 years ago

Overview

This pull request expands upon the "force" option added in https://github.com/github/octocatalog-diff/pull/251. This forces the "compare file text" feature to be used, but does not raise an exception if it fails. Hence "soft".

This is useful when octocatalog-diff runs are being broken into individual components (e.g. leveraging bazel for caching). One process compiles the "to" catalog and another compiles the "from" catalog, and then a third step takes those two catalogs as input and does the "diff". To make the "compare file text" function work in this case, we have to force it on for the compilation of the "to" catalog (hence https://github.com/github/octocatalog-diff/pull/251) and force it on, but not raise an exception for problems, for the compilation of the "from" catalog (this PR).

I updated the docs accordingly and added additional integration tests for these options, in addition to the unit tests at 💯 as per project requirements. In addition we have been using this for several months at my employer and it's been working as intended.

Checklist