puppet-nginx icon indicating copy to clipboard operation
puppet-nginx copied to clipboard

Add stream log changes

Open ardrigh opened this issue 4 years ago • 2 comments

Pull Request (PR) description

Following on work from previous PRs to add stream log changes.

Trying to fix the tests and the file conflicts again.

Explanation of the variables: https://github.com/voxpupuli/puppet-nginx/pull/1439#issuecomment-875198474

This Pull Request (PR) fixes the following issu

Closes: https://github.com/voxpupuli/puppet-nginx/pull/1439

ardrigh avatar Jul 30 '21 01:07 ardrigh

nginx::config is a class

Breaking changes to this file MAY impact these 2 modules (near match):

nginx is a class

Breaking changes to this file WILL impact these 15 modules (exact match):
Breaking changes to this file MAY impact these 34 modules (near match):

nginx::params is a class

Breaking changes to this file MAY impact these 1 modules (near match):

This module is declared in 9 of 578 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

I am working on making updates to fix this PR. I need to check it works with what we have deployed.

I think the tests are failing because they are in the wrong location in the test file. I think the test lines might be better in a context for stream specifically.

Would it work adding a "dynamic module" test similar to geoip module, checking the stream content lines for the access_log and log_format values?

geoip test example: https://github.com/voxpupuli/puppet-nginx/blob/fffe7a3463e005944799f55f8782e9ba798375a8/spec/classes/nginx_spec.rb#L1162

ardrigh avatar Aug 02 '21 14:08 ardrigh

Updated with suggested changes

ardrigh avatar Dec 07 '22 18:12 ardrigh

From a quick look this looks good, but the tests fail. The CentOS 7 tests failing looks unrelated to me, but the unit tests do.

ekohl avatar Dec 07 '22 20:12 ekohl

I am working on making updates to fix this PR. I need to check it works with what we have deployed.

I think the tests are failing because they are in the wrong location in the test file. I think the test lines might be better in a context for stream specifically.

Still the same issue with the unit tests. Which isn't surprising since I did a quick copy & paste to get started.

I don't see anything that tests

<% if @stream -%>

And without that being set, it's not expected the lines get written to the config file, and the unit tests correctly fail.

These tests might not cleanly fit within the existing template iterator. I will have another look

ardrigh avatar Dec 07 '22 21:12 ardrigh

@ekohl I have added a basic set of tests to cover the main use case for the stream access log.

Appreciate if you could give another review

ardrigh avatar Dec 08 '22 16:12 ardrigh