Skip to content

Commit

Permalink
Merge pull request #102 from voxpupuli/add-debian-12
Browse files Browse the repository at this point in the history
Add Debian 12
  • Loading branch information
ekohl authored Oct 18, 2023
2 parents 4edb2a1 + 19e1010 commit ff57b5e
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 6 deletions.
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',
'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)
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

0 comments on commit ff57b5e

Please sign in to comment.