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

Add Debian 12 #102

Merged
merged 3 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/puppet_metadata/github_actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ def beaker_os_releases
else
releases&.each do |release|
majors.each do |puppet_version|
if AIO.has_aio_build?(os, release, puppet_version[:value]) # rubocop:disable Style/IfUnlessModifier
if AIO.has_aio_build?(os, release, puppet_version[:value])
yield [os, release, puppet_version]
elsif PuppetMetadata::OperatingSystem.os_release_puppet_version(os, release) == puppet_version[:value]
yield [os, release, distro_puppet_version.merge(value: puppet_version[:value])]
end
end
end
Expand Down
28 changes: 28 additions & 0 deletions lib/puppet_metadata/operatingsystem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class OperatingSystem
# https://wiki.debian.org/DebianReleases
'Debian' => {
# TODO: EOL is standard support, not the extended life cycle
'12' => nil, # '~2026',
'11' => nil, # '~2024',
'10' => nil, # '~2022',
Copy link
Member Author

Choose a reason for hiding this comment

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

technically, 10 is EOL by now. should we add the date now?

Copy link
Member

Choose a reason for hiding this comment

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

yes, we should do that in another PR (actually it was 2022-09-10 and we missed it) :D
https://endoflife.date/debian

'9' => '2020-07-06',
Expand Down Expand Up @@ -206,6 +207,33 @@ def supported_releases(operatingsystem)
releases.select { |_release, eol_date| !eol_date || Date.parse(eol_date) > today }.keys
.sort_by { |release| Gem::Version.new(release) }
end

# Return the Puppet major version in an OS release, if any
#
# Only tracks releases without an AIO build, since that's preferred.
#
# @param [String] operatingsystem
# The operating system name
# @param [String] release
# The operating system release version
#
# @return [Optional[Integer]] The Puppet major version, if any
def os_release_puppet_version(operatingsystem, release)
Copy link
Member

Choose a reason for hiding this comment

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

todo for me: add arch linux here.

Copy link
Member

Choose a reason for hiding this comment

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

Since it's rolling I'm not sure if that's desirable.

case operatingsystem
when 'Debian'
case release
when '12'
7
end
when 'Fedora'
case release
when '39', '40'
8
when '37', '38'
7
end
end
end
end
end
end
39 changes: 36 additions & 3 deletions spec/github_actions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,21 @@
},
{
operatingsystem: 'Debian',
operatingsystemrelease: %w[9 10],
operatingsystemrelease: %w[9 10 12],
},
{
operatingsystem: 'Fedora',
operatingsystemrelease: %w[36 38 40],
},
{
operatingsystem: 'Fedora',
operatingsystemrelease: %w[36 38 40],
},
],
}
end

# rubocop:disable Layout/LineLength
# rubocop:disable Layout/LineLength,RSpec/ExampleLength
describe 'outputs' do
subject { super().outputs }

Expand Down Expand Up @@ -137,6 +145,11 @@
{ name: 'Puppet 6 - Debian 10', env: { 'BEAKER_PUPPET_COLLECTION' => 'puppet6', 'BEAKER_SETFILE' => 'debian10-64' } },
{ name: 'Puppet 7 - Debian 10', env: { 'BEAKER_PUPPET_COLLECTION' => 'puppet7', 'BEAKER_SETFILE' => 'debian10-64' } },
{ name: 'Puppet 8 - Debian 10', env: { 'BEAKER_PUPPET_COLLECTION' => 'puppet8', 'BEAKER_SETFILE' => 'debian10-64' } },
{ name: 'Distro Puppet - Debian 12', env: { 'BEAKER_PUPPET_COLLECTION' => 'none', 'BEAKER_SETFILE' => 'debian12-64' } },
{ name: 'Puppet 7 - Fedora 36', env: { 'BEAKER_PUPPET_COLLECTION' => 'puppet7', 'BEAKER_SETFILE' => 'fedora36-64' } },
{ name: 'Puppet 8 - Fedora 36', env: { 'BEAKER_PUPPET_COLLECTION' => 'puppet8', 'BEAKER_SETFILE' => 'fedora36-64' } },
{ name: 'Distro Puppet - Fedora 38', env: { 'BEAKER_PUPPET_COLLECTION' => 'none', 'BEAKER_SETFILE' => 'fedora38-64' } },
{ name: 'Distro Puppet - Fedora 40', env: { 'BEAKER_PUPPET_COLLECTION' => 'none', 'BEAKER_SETFILE' => 'fedora40-64' } },
)
end

Expand Down Expand Up @@ -178,6 +191,11 @@
{ name: 'Puppet 6 - Debian 10', setfile: { name: 'Debian 10', value: 'debian10-64' }, puppet: { collection: 'puppet6', name: 'Puppet 6', value: 6 } },
{ name: 'Puppet 7 - Debian 10', setfile: { name: 'Debian 10', value: 'debian10-64' }, puppet: { collection: 'puppet7', name: 'Puppet 7', value: 7 } },
{ name: 'Puppet 8 - Debian 10', setfile: { name: 'Debian 10', value: 'debian10-64' }, puppet: { collection: 'puppet8', name: 'Puppet 8', value: 8 } },
{ name: 'Distro Puppet - Debian 12', setfile: { name: 'Debian 12', value: 'debian12-64' }, puppet: { collection: 'none', name: 'Distro Puppet', value: 7 } },
{ name: 'Puppet 7 - Fedora 36', setfile: { name: 'Fedora 36', value: 'fedora36-64' }, puppet: { collection: 'puppet7', name: 'Puppet 7', value: 7 } },
{ name: 'Puppet 8 - Fedora 36', setfile: { name: 'Fedora 36', value: 'fedora36-64' }, puppet: { collection: 'puppet8', name: 'Puppet 8', value: 8 } },
{ name: 'Distro Puppet - Fedora 38', setfile: { name: 'Fedora 38', value: 'fedora38-64' }, puppet: { collection: 'none', name: 'Distro Puppet', value: 7 } },
{ name: 'Distro Puppet - Fedora 40', setfile: { name: 'Fedora 40', value: 'fedora40-64' }, puppet: { collection: 'none', name: 'Distro Puppet', value: 8 } },
)
end

Expand All @@ -201,6 +219,11 @@
{ name: 'Puppet 6 - Debian 10', setfile: { name: 'Debian 10', value: 'debian10-64' }, puppet: { collection: 'puppet6', name: 'Puppet 6', value: 6 } },
{ name: 'Puppet 7 - Debian 10', setfile: { name: 'Debian 10', value: 'debian10-64' }, puppet: { collection: 'puppet7', name: 'Puppet 7', value: 7 } },
{ name: 'Puppet 8 - Debian 10', setfile: { name: 'Debian 10', value: 'debian10-64' }, puppet: { collection: 'puppet8', name: 'Puppet 8', value: 8 } },
{ name: 'Distro Puppet - Debian 12', setfile: { name: 'Debian 12', value: 'debian12-64' }, puppet: { collection: 'none', name: 'Distro Puppet', value: 7 } },
{ name: 'Puppet 7 - Fedora 36', setfile: { name: 'Fedora 36', value: 'fedora36-64' }, puppet: { collection: 'puppet7', name: 'Puppet 7', value: 7 } },
{ name: 'Puppet 8 - Fedora 36', setfile: { name: 'Fedora 36', value: 'fedora36-64' }, puppet: { collection: 'puppet8', name: 'Puppet 8', value: 8 } },
{ name: 'Distro Puppet - Fedora 38', setfile: { name: 'Fedora 38', value: 'fedora38-64' }, puppet: { collection: 'none', name: 'Distro Puppet', value: 7 } },
{ name: 'Distro Puppet - Fedora 40', setfile: { name: 'Fedora 40', value: 'fedora40-64' }, puppet: { collection: 'none', name: 'Distro Puppet', value: 8 } },
)
end
end
Expand All @@ -225,6 +248,11 @@
{ name: 'Puppet 7 - Debian 10', setfile: { name: 'Debian 10', value: 'debian10-64' }, puppet: { name: 'Puppet 7', value: 7, collection: 'puppet7' } },
{ name: 'Puppet 6 - Debian 10', setfile: { name: 'Debian 10', value: 'debian10-64' }, puppet: { name: 'Puppet 6', value: 6, collection: 'puppet6' } },
{ name: 'Puppet 5 - Debian 10', setfile: { name: 'Debian 10', value: 'debian10-64' }, puppet: { name: 'Puppet 5', value: 5, collection: 'puppet5' } },
{ name: 'Distro Puppet - Debian 12', setfile: { name: 'Debian 12', value: 'debian12-64' }, puppet: { collection: 'none', name: 'Distro Puppet', value: 7 } },
{ name: 'Puppet 7 - Fedora 36', setfile: { name: 'Fedora 36', value: 'fedora36-64' }, puppet: { collection: 'puppet7', name: 'Puppet 7', value: 7 } },
{ name: 'Puppet 8 - Fedora 36', setfile: { name: 'Fedora 36', value: 'fedora36-64' }, puppet: { collection: 'puppet8', name: 'Puppet 8', value: 8 } },
{ name: 'Distro Puppet - Fedora 38', setfile: { name: 'Fedora 38', value: 'fedora38-64' }, puppet: { collection: 'none', name: 'Distro Puppet', value: 7 } },
{ name: 'Distro Puppet - Fedora 40', setfile: { name: 'Fedora 40', value: 'fedora40-64' }, puppet: { collection: 'none', name: 'Distro Puppet', value: 8 } },
)
end
end
Expand Down Expand Up @@ -253,10 +281,15 @@
{ name: 'Puppet 7 - Debian 10', setfile: { name: 'Debian 10', value: 'debian10-64{hostname=debian10-64-puppet7.example.com}' }, puppet: { name: 'Puppet 7', value: 7, collection: 'puppet7' } },
{ name: 'Puppet 6 - Debian 10', setfile: { name: 'Debian 10', value: 'debian10-64{hostname=debian10-64-puppet6.example.com}' }, puppet: { name: 'Puppet 6', value: 6, collection: 'puppet6' } },
{ name: 'Puppet 5 - Debian 10', setfile: { name: 'Debian 10', value: 'debian10-64{hostname=debian10-64-puppet5.example.com}' }, puppet: { name: 'Puppet 5', value: 5, collection: 'puppet5' } },
{ name: 'Distro Puppet - Debian 12', setfile: { name: 'Debian 12', value: 'debian12-64{hostname=debian12-64-none.example.com}' }, puppet: { collection: 'none', name: 'Distro Puppet', value: 7 } },
{ name: 'Puppet 7 - Fedora 36', setfile: { name: 'Fedora 36', value: 'fedora36-64{hostname=fedora36-64-puppet7.example.com}' }, puppet: { collection: 'puppet7', name: 'Puppet 7', value: 7 } },
{ name: 'Puppet 8 - Fedora 36', setfile: { name: 'Fedora 36', value: 'fedora36-64{hostname=fedora36-64-puppet8.example.com}' }, puppet: { collection: 'puppet8', name: 'Puppet 8', value: 8 } },
{ name: 'Distro Puppet - Fedora 38', setfile: { name: 'Fedora 38', value: 'fedora38-64{hostname=fedora38-64-none.example.com}' }, puppet: { collection: 'none', name: 'Distro Puppet', value: 7 } },
{ name: 'Distro Puppet - Fedora 40', setfile: { name: 'Fedora 40', value: 'fedora40-64{hostname=fedora40-64-none.example.com}' }, puppet: { collection: 'none', name: 'Distro Puppet', value: 8 } },
)
end
end
end
end
# rubocop:enable Layout/LineLength
# rubocop:enable Layout/LineLength,RSpec/ExampleLength
end
4 changes: 2 additions & 2 deletions spec/operatingsystem_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
context 'with Debian' do
let(:os) { 'Debian' }

it 'returns 10 and 11' do
expect(described_class.supported_releases(os)).to match_array(%w[10 11])
it 'returns 10, 11, 12' do
expect(described_class.supported_releases(os)).to match_array(%w[10 11 12])
end

it 'the last entry matches latest_release' do
Expand Down