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

Track known-good os and puppet combinations #21

Merged
merged 5 commits into from
Aug 11, 2021

Conversation

smortex
Copy link
Member

@smortex smortex commented Aug 5, 2021

This is used to avoid running acceptance tests on systems where versions
of Puppet are not supported (yet or anymore).

This is used to avoid running acceptance tests on systems where versions
of Puppet are not supported (yet or anymore).
@smortex
Copy link
Member Author

smortex commented Aug 5, 2021

An example of usage of this code in a configuration where the combination Ubuntu 20.04 and Puppet 5 is not valid and is excluded is available here:

Copy link
Member

@bastelfreak bastelfreak left a comment

Choose a reason for hiding this comment

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

I'm happy with this, but let's keep it open in case @ekohl want's to review it as well

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Overall I think this can be a good path forward.

class AIO
BUILDS = {
# RPM-based
'CentOS' => {
Copy link
Member

Choose a reason for hiding this comment

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

I know I suggested this code earlier, but perhaps this is closer to the truth?

Suggested change
'CentOS' => {
'RedHat' => {

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not a user of RPM based platforms so can't tell which way is better, but as CentOS is a RedHat derivative it makes sense for me to be closer to the "root" for this hash.

}

def self.has_aio_build?(os, release, puppet_version)
# TODO: group CentOS with RedHat/AlmaLinux/Rocky?
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps something like:

COMPATIBLE = {
  'CentOS' => 'RedHat',
  'AlmaLinux' => 'RedHat',
  # TODO: add all others? Rocky, Amazon, OracleLinux?
}

def self.find_base_os(os)
  COMPATIBLE.fetch(os, os)
end

Copy link
Member Author

Choose a reason for hiding this comment

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

Did that. I also tried to replace the TODO with actual code 😁

lib/puppet_metadata/github_actions.rb Show resolved Hide resolved
Comment on lines 72 to 73
puppet_major_versions.each do |puppet_version|
metadata.operatingsystems.each do |os, releases|
Copy link
Member

Choose a reason for hiding this comment

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

Just a small note: I wonder if we should iterate the other way around. That way the Github actions will be sorted by OS instead of Puppet version.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I was also confused by this… The versions of Puppet also seems to go backwards… I'll check!

Copy link
Member

Choose a reason for hiding this comment

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

I think my reasoning for that was that you first see the results of the newest Puppet versions. I don't know if anyone else cares about the order, but that's the thought behind it.

smortex added 4 commits August 9, 2021 09:50
When an operating system is based on another, it helps to be able to
group them all under a "family" and list compatible Puppet versions for
that whole family.
Group tasks per OS rather than per Puppet version.  The build matrix
used to be construcuted this way when GitHub was building them.
We are not expecting to have a nil result from ::os_release_to_setfile,
but better safe than sorry.
@smortex
Copy link
Member Author

smortex commented Aug 9, 2021

I added empty commits to voxpupuli/puppet-splunk#315 to show the result of the changes regarding ordering. Unfortunately dependencies have broken CI, but if we ignore the pass/fail and only consider the tests which are runs, this seems more readable.

@bastelfreak bastelfreak merged commit 7d387ec into voxpupuli:master Aug 11, 2021
@bastelfreak bastelfreak added the enhancement New feature or request label Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants