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-cat-9) Update module to match current syntax standard #2235

Merged
merged 6 commits into from
Jun 7, 2022

Conversation

david22swan
Copy link
Member

@david22swan david22swan commented May 17, 2022

Code now compliant with the following rules:

  • manifest_whitespace_closing_bracket_after
  • relative_classname_inclusion
  • relative_classname_reference
  • version_conparison
  • legacy_facts
  • top_scope_facts
  • parameter_documentation
  • parameter_types

@puppet-community-rangefinder
Copy link

apache is a class

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

apache::mod::alias is a class

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

apache::mod::auth_cas is a class

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

apache::mod::auth_mellon is a class

that may have no external impact to Forge modules.

apache::mod::auth_openidc is a class

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

apache::mod::authn_dbd is a class

that may have no external impact to Forge modules.

apache::mod::autoindex is a class

that may have no external impact to Forge modules.

apache::mod::cgi is a class

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

apache::mod::cgid is a class

that may have no external impact to Forge modules.

apache::mod::dav_fs is a class

that may have no external impact to Forge modules.

apache::mod::dav_svn is a class

that may have no external impact to Forge modules.

apache::mod::disk_cache is a class

that may have no external impact to Forge modules.

apache::mod::fcgid is a class

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

apache::mod::info is a class

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

apache::mod::mime is a class

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

apache::mod::passenger is a class

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

apache::mod::php is a class

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

apache::mod::proxy_ajp is a class

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

apache::mod::proxy_balancer is a class

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

apache::mod::proxy_fcgi is a class

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

apache::mod::proxy_html is a class

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

apache::mod::proxy_http is a class

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

apache::mod::proxy_wstunnel is a class

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

apache::mod::security is a class

that may have no external impact to Forge modules.

apache::mod::ssl is a class

Breaking changes to this file WILL impact these 28 modules (exact match):
Breaking changes to this file MAY impact these 2 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 david22swan force-pushed the GH-cat-9/syntax_standards branch 3 times, most recently from 14da50b to cab1b0d Compare May 18, 2022 16:49
spec/spec_helper_local.rb Outdated Show resolved Hide resolved
spec/spec_helper_local.rb Outdated Show resolved Hide resolved
@@ -67,7 +67,7 @@
include_examples 'Debian 11'

context 'with only required facts and default parameters' do
let(:facts) { super().merge('ipaddress' => default_ip) }
let(:facts) { super().merge(networking: { ip: default_ip }) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

This breaks things and you need to do a deep merge. In VP we have a helper for this: override_facts(). https://github.com/voxpupuli/voxpupuli-test#fact-handling describes the reasoning. Ideally this would be easier (maybe something in rspec-puppet?), but your current approach remotes all other networking facts (like FQDN).

Copy link
Member Author

Choose a reason for hiding this comment

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

See reply to below comment

@@ -20,7 +20,7 @@

context 'on i386' do
let(:facts) do
super().merge(hardwaremodel: 'i686',
super().merge(os: { family: 'Debian', name: 'Debian', release: { full: '11', major: '11' }, hardware: 'i686', },
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is it needed to override the Debian facts here? It should inherit that from super().

Copy link
Member Author

Choose a reason for hiding this comment

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

Since hardware is contained within os I can't merge it without it overwriting everything.
Since I don't like the look of this I'm considering implementing the test handling feature you linked above, though will have to talk with the others regarding bringing in a new gem first.

Currently, leaving it to the end to do as I want to finish with the rest of the rules first, and see whether or not any other issues come up.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be good to fix voxpupuli/rspec-puppet-facts#112 and solve it at that level. It's already pulled in and it's probably the right place to fix it (or rspec-puppet itself). IMHO that would be best for the ecosystem. Fixing it in voxpupuli-test was just my way of making quick progress.

I can't promise to have time for it, but if someone contributes the PR I'd be happy.

Copy link
Member Author

Choose a reason for hiding this comment

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

Was unable to include the voxpupuli-test gem added due to conflicts with existing gems so have simply added the override_facts code to the spec_helper_local.rb for now if you don't mind me copying your code.

@david22swan david22swan force-pushed the GH-cat-9/syntax_standards branch 21 times, most recently from 70abe82 to 4b2373a Compare May 27, 2022 14:45
@david22swan david22swan force-pushed the GH-cat-9/syntax_standards branch 6 times, most recently from 38fc4eb to ad8b7fe Compare May 28, 2022 19:07
@david22swan
Copy link
Member Author

@chelnak @ekohl @smortex Hoping to get a bunch of eyes on this as while none of the changes in it are very big, there are a lot of them.

Code now compliant with the following rules:
- manifest_whitespace_closing_bracket_after
- relative_classname_inclusion
- relative_classname_reference
- version_conparison
- legacy_facts
- top_scope_facts
Code now compliant with the following rules:
- parameter_documentation
- parameter_types
@david22swan david22swan marked this pull request as ready for review June 6, 2022 09:19
@david22swan david22swan requested a review from a team as a code owner June 6, 2022 09:19
Copy link
Contributor

@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.

Looks great! Just a few questions on typing.. but they might have reasonable answers!

manifests/mod/auth_openidc.pp Show resolved Hide resolved
manifests/custom_config.pp Show resolved Hide resolved
manifests/mod/event.pp Outdated Show resolved Hide resolved
manifests/mod/event.pp Outdated Show resolved Hide resolved
manifests/mod/event.pp Outdated Show resolved Hide resolved
manifests/mod/event.pp Outdated Show resolved Hide resolved
manifests/service.pp Show resolved Hide resolved
@chelnak chelnak self-requested a review June 7, 2022 09:41
chelnak
chelnak previously approved these changes Jun 7, 2022
@chelnak chelnak merged commit ad646c9 into puppetlabs:main Jun 7, 2022
@david22swan david22swan deleted the GH-cat-9/syntax_standards branch June 7, 2022 13:35
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