Skip to content

Better data types on apache::vhost parameters #2251

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

Closed
wants to merge 6 commits into from

Conversation

ekohl
Copy link
Collaborator

@ekohl ekohl commented Jun 15, 2022

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.

@ekohl ekohl requested a review from a team as a code owner June 15, 2022 11:46
@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.

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.

Aside from the comment below these changes look fine to me.
You do have some syntax errors however and will need to make some updates to the unit tests to account for the changing types.
I would also prefer it if you where to update the example on line 1412 to show $headers as an array

ekohl added 2 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.
@ekohl ekohl force-pushed the consistent-header branch from cf0c4c4 to d4727d9 Compare June 15, 2022 16:44
@ekohl
Copy link
Collaborator Author

ekohl commented Jun 15, 2022

You do have some syntax errors however and will need to make some updates to the unit tests to account for the changing types.

My bad. I rely on CI to run that for me.

I would also prefer it if you where to update the example on line 1412 to show $headers as an array

That's an interesting point because the example really has nothing to do with the parameter it's used with. It passes in the directories parameter which itself takes a headers key. What should we do with this? Write a new example?

@david22swan
Copy link
Member

Looking at the examples closer, that seems to be a common trait, that it shows the variable being passed as part of directories.
For now I think we can go ahead and merge the changes, once the test's have passed, but it may be something that needs looked at in the future.

@david22swan
Copy link
Member

@ekohl Took a quick look at the spec test failures and they all seem to be from rewrite_cond being set as a string

ekohl added 4 commits June 16, 2022 11:57
Ideally a Struct would be used instead of Hash for $rewrites, but this
is a closer description of the real data type.
This always required an array of hashes. This 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 consistent-header branch from d4727d9 to f73fdcc Compare June 16, 2022 09:57
@ekohl
Copy link
Collaborator Author

ekohl commented Jun 16, 2022

Made it an array, hopefully the tests now pass.

@david22swan
Copy link
Member

Still getting some failures it seems, and strange ones

@ekohl
Copy link
Collaborator Author

ekohl commented Jun 17, 2022

I'm not sure what's up with the tests now. They appear to be stuck?

@david22swan
Copy link
Member

Not sure what is going on, have tried to rerun the tests and it keeps happening, think there may be a corrupted file in the action(?).
Gonna open and close the PR, that can help with stuff likes this.

@david22swan david22swan reopened this Jun 20, 2022
@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.

@ekohl ekohl changed the title Make headers and request_headers arrays Better data types on apache::vhost parameters Jun 20, 2022
@ekohl ekohl linked an issue Jun 20, 2022 that may be closed by this pull request
@david22swan
Copy link
Member

@ekohl Have tried rekicking a few times and closing and opening the pr but the failures are still there.
Not sure what's going on but my only thought on what might help would be opening a fresh pr from a new branch.
That may avoid whatever is causing this issue.

@ekohl ekohl deleted the consistent-header branch June 21, 2022 08:39
@ekohl
Copy link
Collaborator Author

ekohl commented Jun 21, 2022

Let's see if #2252 does work. If not, I wonder if there's something that's running into a loop or something. Worst case I'll split up the PR since they're multiple commits anyway.

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