Description
I wonder if it would be possible and if so where would one start, to try and mock, in some way the puppetdb api specificity for exported resources and possibly queries issued with dalen/puppet-puppetdbquery
.
The scenario i have in mind is being able to use octocatalog-diff in CI pipeline which would preform the following steps
- install puppet
- download the current main/production/master branch in one dir
- download the change branch/commit into another dir
- run octocatalog-diff on the two branches to report on diffs.
This* mostly works unless a manifest needs to retrieve data from puppet i.e. exported_resources. for the purposes of testing we generally dont care what the content of the exported resources are we just want need something stable to be available at run time so we can compile the catalogue consistently without error. As such i wonder if there is currently a way, oir if you have considered implementing some way to mock the puppet api endpoint and fake the response to exported resources quires.
Im not sure how this might be implemented but it could be as simple as creating a yaml file with a bunch of valid resources to uses for puppetdb queries or dynamicly scan the puppet code base and generate exported resources on the fly based on some sane defaults.
*we currently uses a home grown tool to preform a similar function to octocatalog-diff however we also need to make changes to support puppet 6 and as such are considering switching to this tool. in our current set up we just spin up an empty puppetdb instance and populate it with some junk data