Skip to content

Compare with major release version #2110

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

Merged
merged 1 commit into from
Mar 15, 2021

Conversation

ekohl
Copy link
Collaborator

@ekohl ekohl commented Dec 22, 2020

CentOS 8 stream doesn't have a minor version so this check likely fails. However, it's irrelevant here and we can use the major release version fact instead.

There are a lot more odd cases with facts, but I don't want to touch too much code.

@ekohl ekohl requested a review from a team as a code owner December 22, 2020 18:16
@puppet-community-rangefinder
Copy link

apache::default_mods is a class

that may have no external impact to Forge modules.

apache::mod::fastcgi is a class

that may have no external impact to Forge modules.

apache::params is a class

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

This module is declared in 175 of 576 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.

@sanfrancrisko sanfrancrisko self-assigned this Jan 4, 2021
Copy link
Contributor

@sanfrancrisko sanfrancrisko left a comment

Choose a reason for hiding this comment

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

Thanks for the tweak @ekohl - it appears as though we have test failures on Travis due to the versioncmp being passed an undefined variable: https://travis-ci.com/github/puppetlabs/puppetlabs-apache/jobs/464049567

@ekohl
Copy link
Collaborator Author

ekohl commented Jan 4, 2021

That's probably because the module doesn't use rspec-puppet-facts but rather specifies them manually. I had a look at the module, but its test infra is in serious need of an update.

@sanfrancrisko
Copy link
Contributor

That's probably because the module doesn't use rspec-puppet-facts but rather specifies them manually. I had a look at the module, but its test infra is in serious need of an update.

Agreed - it would make things a lot nicer to use rspec-puppet-facts consistently across the module. I took a look at spec/classes/apache_spec.rb and frankly, it's going to be quite a while to fix that one test class up - it's not going to be as simple as encapsulating the tests within a on_supported_os.each block (not that I ever thought it would!). There's a heck of a lot of duplication and specific tests coupled to specific OSs. I haven't even looked in to the other test classes failing either - I suspect a similar scenario awaits in them.

I'm not saying that it isn't the right thing to do, but, it would be quite an undertaking and a bit more surgical than a bulk edit. I'll discuss with some of the team on how we want to proceed. If you have any suggestions, we'd be keen to hear, of course 👍

@ekohl ekohl force-pushed the major-version-fact branch from 28a2a70 to 0fc5e38 Compare January 18, 2021 11:31
@ekohl ekohl marked this pull request as draft January 18, 2021 11:31
@ekohl
Copy link
Collaborator Author

ekohl commented Jan 18, 2021

I added another commit I wrote while looking into this. I think the main pain point comes from remaining compatible with Facter 1.6 for too long. puppetlabs/puppetlabs-stdlib#1154 is another thing that should have died long ago with Facter 1.6.

About the conversion to rspec-puppet-facts. I think you're right that this won't be a trivial conversion. Another thing to note is that the test runtime will go up a lot since it'll test a lot more combinations. Perhaps a decent compromise is to define a default test OS in some shared file and use that instead of defining the same facts over and over again.

@ekohl
Copy link
Collaborator Author

ekohl commented Feb 6, 2021

In #2120 I took a stab at a the preparation. Not a full conversion to rspec-puppet-facts, but by using shared examples a big step forward is taken to make it easier.

@ekohl ekohl force-pushed the major-version-fact branch from 0fc5e38 to 49572f4 Compare February 8, 2021 10:22
@ekohl
Copy link
Collaborator Author

ekohl commented Feb 8, 2021

This now includes #2120 since hopefully that's sufficient to make the tests pass. Once that's merged, I'll rebase for easier review.

@codecov-io
Copy link

Codecov Report

Merging #2110 (49572f4) into main (13f55bd) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2110   +/-   ##
=======================================
  Coverage   56.36%   56.36%           
=======================================
  Files          12       12           
  Lines         220      220           
=======================================
  Hits          124      124           
  Misses         96       96           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c1a830b...49572f4. Read the comment docs.

@ekohl ekohl force-pushed the major-version-fact branch from 49572f4 to d6f65bb Compare February 8, 2021 18:37
This fact was introduced in Facter 1.7 which by now can be assumed. By
now it's already deprecated in favor of $facts['os']['release']['major']
but the rest of the module isn't converted so this keeps it consistent.

CentOS 8 stream doesn't have a minor version and the previous comparison
code failed.

There are a lot more odd cases with facts, but I don't want to touch too
much code.
@ekohl ekohl force-pushed the major-version-fact branch from d6f65bb to 5b2a524 Compare February 15, 2021 12:46
@ekohl
Copy link
Collaborator Author

ekohl commented Feb 15, 2021

Rebased and squashed into a single commit. Also updated some fact sets to provide a major version.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ekohl ekohl marked this pull request as ready for review March 1, 2021 23:58
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
Copy link
Member

@ekohl Thanks for the excellent work as always
Looking forward to more in the future.

@david22swan david22swan merged commit b60fc34 into puppetlabs:main Mar 15, 2021
@ekohl ekohl deleted the major-version-fact branch March 15, 2021 14:02
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.

5 participants