Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better data types on apache::vhost parameters #2252

Merged
merged 6 commits into from
Jun 22, 2022

Conversation

ekohl
Copy link
Collaborator

@ekohl ekohl commented Jun 21, 2022

This tightens data types where needed and does some additional minor cleanups around module inclusion. See individual commits for details.

Replaces #2251 which had some CI problems. No actual difference in code.

ekohl added 3 commits June 15, 2022 18:39
They now both only accept arrays of non-empty strings. The default is
set to an empty array, which behaves as if it's not set.
This was previously filtered out but it's best if the information simply
never is entered in the first place.

The include is also simplified and only applied if the vhost is present.
Ideally a Struct would be used instead of Hash for $rewrites, but this
is a closer description of the real data type.
@ekohl ekohl requested a review from a team as a code owner June 21, 2022 08:39
@puppet-community-rangefinder
Copy link

apache::vhost is a type

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

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

@david22swan
Copy link
Member

Look's like the spec tests are still having the issue.
Not sure what could be causing it, can you remember what the last thing that you changed before this started happening was?

@ekohl ekohl force-pushed the better-vhost-data-types branch from f73fdcc to 88d7b26 Compare June 21, 2022 13:31
@ekohl
Copy link
Collaborator Author

ekohl commented Jun 21, 2022

I now pushed now without the last commit, see if that helps. I'll just keep removing commits until I find the one that breaks. If I could run it locally I'd just use git bisect but still blocked on https://tickets.puppetlabs.com/browse/MODULES-11161.

@david22swan
Copy link
Member

Have found the error, it look's like my auto spec command doesn't run the define test's, gonna have to fix that, so i missed it the last time.

  1) apache::vhost os-independent items on oraclelinux-6-x86_64  set everything! is expected to compile into a catalogue without dependency cycles
     Failure/Error: it { is_expected.to compile }
       error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Unknown variable: '_access_logs'. (file: /Users/david.swan/Github/puppetlabs-apache/spec/fixtures/modules/apache/manifests/vhost.pp, line: 2467, column: 13) (line: 3) on node david.swan-c02l57z6fft1
     # ./spec/defines/vhost_spec.rb:548:in `block (6 levels) in <top (required)>'
     # ./.bundle/ruby/2.6.0/bin/rspec:23:in `load'
     # ./.bundle/ruby/2.6.0/bin/rspec:23:in `<top (required)>'
     # /Users/david.swan/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `load'
     # /Users/david.swan/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `kernel_load'
     # /Users/david.swan/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/cli/exec.rb:28:in `run'
     # /Users/david.swan/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/cli.rb:463:in `exec'
     # /Users/david.swan/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
     # /Users/david.swan/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
     # /Users/david.swan/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
     # /Users/david.swan/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/cli.rb:27:in `dispatch'
     # /Users/david.swan/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
     # /Users/david.swan/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/cli.rb:18:in `start'
     # /Users/david.swan/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/friendly_errors.rb:124:in `with_friendly_errors'
     # /Users/david.swan/.rbenv/versions/2.6.3/bin/bundle:23:in `load'
     # /Users/david.swan/.rbenv/versions/2.6.3/bin/bundle:23:in `<main>'

@ekohl
Copy link
Collaborator Author

ekohl commented Jun 21, 2022

Oh, that may explain it. I've seen that if a test fails it's slow to handle it and this would affect a lot of tests so there's a lot of errors. Thanks, will fix!

ekohl added 3 commits June 21, 2022 17:23
This always required an array of hashes and closer matches the actual
behavior.

It also fixes the check on the template use by checking the correct
variable. bb96180 broke this.

Fixes: bb96180
This also pulls in mod_jk if needed.
@ekohl ekohl force-pushed the better-vhost-data-types branch from 88d7b26 to 8c51550 Compare June 21, 2022 15:24
@ekohl
Copy link
Collaborator Author

ekohl commented Jun 21, 2022

I see EL acceptance tests fail across multiple repositories so there is some deeper problem. Are you aware of that?

Copy link
Member

@david22swan david22swan left a comment

Choose a reason for hiding this comment

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

LGTM
And yes we are aware, the failures on Puppet 6 are unrelated and come from further up the pipeline.
So gonna go ahead and merge :)
Thanks for the work :)

@david22swan david22swan merged commit 77d3e6c into puppetlabs:main Jun 22, 2022
@ekohl ekohl deleted the better-vhost-data-types branch June 22, 2022 09:20
@ekohl ekohl linked an issue Jun 22, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parameter type for vhost.pp $headers is incorrect
3 participants