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

(GH-1057) Regex fix to allow dotted resources #1058

Merged
merged 2 commits into from
Aug 31, 2022
Merged

(GH-1057) Regex fix to allow dotted resources #1058

merged 2 commits into from
Aug 31, 2022

Conversation

LukasAud
Copy link

Prior to this commit, one of our recent module updates introduced a
regex validation step for the resource names in our ppa.pp manifest
which would raise an issue if a valid resource name contained a dot (.).

This commit aims to slightly adjust the regex validation so that it
allows for dotted resource names. This PR should fix issue #1057.

@LukasAud LukasAud requested a review from a team as a code owner August 30, 2022 12:05
@puppet-community-rangefinder
Copy link

apt::ppa is a type

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

This module is declared in 234 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

@chelnak chelnak left a comment

Choose a reason for hiding this comment

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

Please can you update the unit tests to reflect this change?

Prior to this commit, one of our recent module updates introduced a
regex validation step for the resource names in our ppa.pp manifest
which would raise an issue if a valid resource name contained a dot (.).

This commit aims to slightly adjust the regex validation so that it
allows for dotted resource names. This PR should fix issue #1057.
@chelnak chelnak changed the title (GH-1057)Regex fix to allow dotted resources (GH-1057) Regex fix to allow dotted resources Aug 31, 2022
@chelnak chelnak assigned chelnak and unassigned chelnak Aug 31, 2022
@chelnak chelnak added the bugfix label Aug 31, 2022
Copy link

@chelnak chelnak left a comment

Choose a reason for hiding this comment

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

Almost there! It's looking great, just a couple more observations.

spec/defines/ppa_spec.rb Outdated Show resolved Hide resolved
spec/defines/ppa_spec.rb Outdated Show resolved Hide resolved
spec/defines/ppa_spec.rb Outdated Show resolved Hide resolved
spec/defines/ppa_spec.rb Show resolved Hide resolved
Prior to this commit, ppa_spec.rb did not test the recently implemented
validation for resource names.

This commit aims to implement some test cases to make sure that valid
resource names are allowed while invalid or malicious resource names do
not work.
Copy link

@chelnak chelnak left a comment

Choose a reason for hiding this comment

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

Fantastic thanks for putting in the effort!

@chelnak chelnak merged commit 9f27ea9 into main Aug 31, 2022
@chelnak chelnak deleted the issue-1057 branch August 31, 2022 17:22
@pmcmaw pmcmaw linked an issue Aug 31, 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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regex for ppa name issues with dotted versions
2 participants