Skip to content

Conversation

@sanfrancrisko
Copy link
Contributor

@sanfrancrisko sanfrancrisko commented Nov 9, 2020

Prior to this commit, the $filename variable, which is used to
construct the filename of Apache's various config and log files,
obtained it's default value from the $name parameter.

As #2064 highlights, it is possible for $name to contain spaces
in it and this can cause cumbersome log file names, albeit POSIX
compliant.

Also related is #2068, which changes the $filename variable source
from $name to $servername. This arguably seems more appropriate,
especially given that $servername defaults to $name if undefined.

This commit attempts to create a satisfactory solution to both #2064
and #2068 by introducing the $use_servername_for_filenames param.
When set to true, a sanitized $servername parameter value will be
used to construct $filename.

When undefined or set to $false, it will retain the existing
behaviour and use the $name parameter value.

This will default to false until the next major release (v6.0.0),
after which it will default to true. Then, in the subsequent major
release (v7.0.0) it will be deprecated altogether and the default
behaviour will be to use the sanitized value of $servername for the
$filename var.

Warning messages are output to the console to alert users of this
change in behaviour.

Closes: #2064 , #2068

@sanfrancrisko sanfrancrisko requested a review from a team as a code owner November 9, 2020 13:04
@puppet-community-rangefinder
Copy link

apache::vhost is a type

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

This module is declared in 174 of 575 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.

@sanfrancrisko sanfrancrisko marked this pull request as draft November 9, 2020 13:04
@sanfrancrisko sanfrancrisko force-pushed the IAC-1186/main/sanitize_log_filename branch from f3e0f18 to 8d26539 Compare November 9, 2020 13:05
@codecov-io
Copy link

codecov-io commented Nov 9, 2020

Codecov Report

❗ No coverage uploaded for pull request base (main@935acd4). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2086   +/-   ##
=======================================
  Coverage        ?   57.40%           
=======================================
  Files           ?       12           
  Lines           ?      216           
  Branches        ?        0           
=======================================
  Hits            ?      124           
  Misses          ?       92           
  Partials        ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 935acd4...ed85578. Read the comment docs.

@sanfrancrisko sanfrancrisko force-pushed the IAC-1186/main/sanitize_log_filename branch from 8d26539 to 4aaf37f Compare November 9, 2020 23:12
@sanfrancrisko sanfrancrisko marked this pull request as ready for review November 9, 2020 23:19
@sanfrancrisko sanfrancrisko force-pushed the IAC-1186/main/sanitize_log_filename branch from 4aaf37f to ed85578 Compare November 9, 2020 23:22
@sheenaajay
Copy link
Contributor

@sanfrancrisko The changes looks good. Thank you.

Prior to this commit, the `$filename` variable, which is used to
construct the filename of Apache's various config and log files,
obtained it's default value from the `$name` parameter.

As puppetlabs#2064 highlights, it is possible for `$name` to contain spaces
in it and this can cause cumbersome log file names, albeit POSIX
compliant.

Also related is puppetlabs#2068, which changes the `$filename` variable source
from `$name` to `$servername`. This arguably seems more appropriate,
especially given that `$servername` defaults to `$name` if undefined.

This commit attempts to create a satisfactory solution to both puppetlabs#2064
and puppetlabs#2068 by introducing the `$use_servername_for_filenames` param.
When set to `true`, a sanitized `$servername` parameter value will be
used to construct `$filename`.

When undefined or set to `$false`, it will retain the existing
behaviour and use the `$name` parameter value.

This will default to `false` until the next major release (v6.0.0),
after which it will default to `true`. Then, in the subsequent major
release (v7.0.0) it will be deprecated altogether and the default
behaviour will be to use the sanitized value of `$servername` for the
`$filename` var.

Warning messages are output to the console to alert users of this
change in behaviour.
@sanfrancrisko sanfrancrisko force-pushed the IAC-1186/main/sanitize_log_filename branch from ed85578 to 7e233fe Compare November 10, 2020 16:44
@sheenaajay sheenaajay merged commit c3fc5a7 into puppetlabs:main Nov 12, 2020
@sanfrancrisko sanfrancrisko deleted the IAC-1186/main/sanitize_log_filename branch November 12, 2020 16:28
# value of the $servername parameter.
# When set to false (default), the existing behaviour of using the $name parameter
# will remain.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This broke puppet-strings: #2165.

Yet another reason why I hate this change and would still be strongly in favor of reverting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants