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

Allow vhosts to have a string priority again #2275

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

ekohl
Copy link
Collaborator

@ekohl ekohl commented Aug 1, 2022

In f41251e the type was narrowed to no longer allow strings, but this can cause problems.

Sorting is alphabetical and you need to format it for the correct sorting. So to make sure 2 loads before 10 you need to format it as 02. While the vhost can do some printf style magic to change 2 to 02, it must then also know what the highest number is. Otherwise 100 is sorted before 20. By allowing strings, you allow the caller to fix this.

A type alias is introduced to reduce duplication and make it easier to track.

Fixes: f41251e

@ekohl ekohl requested a review from a team as a code owner August 1, 2022 22:23
@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 36 modules (near match):

apache::vhost::custom is a type

Breaking changes to this file WILL impact these 1 modules (exact match):

apache::vhost::fragment is a type

Breaking changes to this file WILL impact these 3 modules (exact match):

apache::vhost::proxy is a type

that may have no external impact to Forge modules.

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.

bastelfreak
bastelfreak previously approved these changes Aug 2, 2022
In f41251e the type was narrowed to no
longer allow strings, but this can cause problems.

Sorting is alphabetical and you need to format it for the correct
sorting. So to make sure 2 loads before 10 you need to format it as 02.
While the vhost can do some printf style magic to change 2 to 02, it
must then also know what the highest number is. Otherwise 100 is sorted
before 20. By allowing strings, you allow the caller to fix this.

A type alias is introduced to reduce duplication and make it easier to
track.

Fixes: f41251e
@ekohl
Copy link
Collaborator Author

ekohl commented Aug 2, 2022

Looks like I was not paying attention yesterday and failed to write proper tests for the type. Updated now.

@ekohl
Copy link
Collaborator Author

ekohl commented Aug 2, 2022

@david22swan this is blocking our CI pipelines. I'd appreciate it if this could get a look.

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

@david22swan david22swan merged commit fcd8be2 into puppetlabs:main Aug 2, 2022
@ekohl ekohl deleted the allow-string-priority-again branch August 2, 2022 16:56
@david22swan
Copy link
Member

Quick and easy merge.

@ekohl
Copy link
Collaborator Author

ekohl commented Aug 2, 2022

It certainly was quick :)

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.

4 participants