puppet_metadata 3.7.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28aa43873472b811f5e9cc1fb83463e9cdaf413dc0ffc7b3e30674f7f82e19ba
4
- data.tar.gz: b8965851efccac5ffd2045f8cbbc944a7fc5db0df386806ec371af8fc86221ef
3
+ metadata.gz: de32c4860778531eeabf95f42ff94cfd21efa518384b9870ec2c9e91e982b2ae
4
+ data.tar.gz: 525f0f24c55dc00e198f52ad3a7708543e646c4d37548b3c0f781d02d6cf499d
5
5
  SHA512:
6
- metadata.gz: 06df9e652fd704478bc5c95fa86406ea587daf0b21af5bfe5a12a988801c6ee81965713d4e90a484b0e10e2c739147a6b06730ac0ce001be68943598cb5860ce
7
- data.tar.gz: 87fb2e005ccfb3ab28808d56113541e3a96d6e4ae05064e60818a6abe18249ff7fb94af34fb517ca296ab15136d503ed9ae57fd19ca68adcf7a3a0d54a2779e6
6
+ metadata.gz: e8b12b9a07f697156cf081cae45c5480f182468c0e25821472f91c4c684b6e444c31c4ded715f4574007b766099895fda5b066a245889a46a7708bb209e0358c
7
+ data.tar.gz: 18a41a5b1c2bf722dcbeca24224222013a0316ea454197b2554e81a6bb20d11d05b4cd655718cb7058372c796d6a807a5390e1bc173a9df533e3eaa6bfc2b893
data/bin/metadata2gha CHANGED
@@ -6,7 +6,6 @@ require 'puppet_metadata'
6
6
  PidfileWorkaround = Object.new
7
7
 
8
8
  options = {
9
- beaker_use_fqdn: false,
10
9
  beaker_pidfile_workaround: false,
11
10
  domain: nil,
12
11
  minimum_major_puppet_version: nil,
@@ -28,7 +27,6 @@ OptionParser.new do |opts|
28
27
 
29
28
  opts.banner = "Usage: #{$0} [options] metadata"
30
29
 
31
- opts.on('--[no-]use-fqdn', 'Generate beaker setfiles with a FQDN') { |opt| options[:beaker_use_fqdn] = opt }
32
30
  opts.on('--pidfile-workaround VALUE', 'Generate the systemd PIDFile workaround to work around a docker bug', PidfileWorkaround) { |opt| options[:beaker_pidfile_workaround] = opt }
33
31
  opts.on('-d', '--domain VALUE', 'the domain for the box, only used when --use-fqdn is set to true') { |opt| options[:domain] = opt }
34
32
  opts.on('--minimum-major-puppet-version VERSION', "Don't create actions for Puppet versions less than this major version") { |opt| options[:minimum_major_puppet_version] = opt }
@@ -42,12 +40,13 @@ OptionParser.new do |opts|
42
40
  end
43
41
  end
44
42
  opts.on('--beaker-hosts HOSTNAME:ROLES;HOSTNAME:ROLES;...', 'Expand the setfile string to create multiple hosts with custom roles. Roles string; see beaker-hostgenerator') do |opt|
45
- options[:beaker_hosts] = {}
46
43
  if opt != 'false'
44
+ beaker_hosts = {}
47
45
  opt.split(';').each do |host|
48
46
  hostname, roles = host.split(':', 2)
49
- options[:beaker_hosts][hostname] = roles
47
+ beaker_hosts[hostname] = roles
50
48
  end
49
+ options[:beaker_hosts] = beaker_hosts unless beaker_hosts.empty?
51
50
  end
52
51
  end
53
52
  end.parse!
@@ -42,8 +42,6 @@ module PuppetMetadata
42
42
  # The Operating System string as metadata.json knows it, which in turn is
43
43
  # based on Facter's operatingsystem fact.
44
44
  # @param [String] release The OS release
45
- # @param [Boolean] use_fqdn
46
- # Whether or not to use a FQDN, ensuring a domain (deprecated, use domain)
47
45
  # @param [Boolean, Array[String]] pidfile_workaround
48
46
  # Whether or not to apply the systemd PIDFile workaround. This is only
49
47
  # needed when the daemon uses PIDFile in its service file and using
@@ -63,13 +61,12 @@ module PuppetMetadata
63
61
  #
64
62
  # @return [nil] If no setfile is available
65
63
  # @return [Array<(String, String)>] The beaker setfile description with a readable name
66
- def os_release_to_setfile(os, release, use_fqdn: false, pidfile_workaround: false, domain: nil, puppet_version: nil, hosts: nil)
64
+ def os_release_to_setfile(os, release, pidfile_workaround: false, domain: nil, puppet_version: nil, hosts: nil)
67
65
  return unless os_supported?(os)
68
66
 
69
67
  aos = adjusted_os(os)
70
68
  name = "#{aos}#{release.tr('.', '')}-64"
71
69
  human_name = "#{os} #{release}"
72
- domain ||= 'example.com' if use_fqdn
73
70
 
74
71
  hosts_settings = []
75
72
  if hosts
@@ -9,14 +9,16 @@ module PuppetMetadata
9
9
  @options = options
10
10
  end
11
11
 
12
+ # @param [Date] at
13
+ # The date when to generate the outputs. This affects the acceptance test
14
+ # matrix, which excludes EOL operating systems. Its primary purpose is
15
+ # reliable (unit) tests which don't break over time.
12
16
  # @return [Hash[Symbol, Any]] The outputs for Github Actions
13
- def outputs
17
+ def outputs(at = nil)
14
18
  {
15
19
  puppet_major_versions: puppet_major_versions,
16
20
  puppet_unit_test_matrix: puppet_unit_test_matrix,
17
- puppet_beaker_test_matrix: puppet_beaker_test_matrix,
18
- # Deprecated
19
- github_action_test_matrix: github_action_test_matrix,
21
+ puppet_beaker_test_matrix: puppet_beaker_test_matrix(at),
20
22
  }
21
23
  end
22
24
 
@@ -47,7 +49,7 @@ module PuppetMetadata
47
49
  end.compact
48
50
  end
49
51
 
50
- def beaker_os_releases
52
+ def beaker_os_releases(at = nil)
51
53
  majors = puppet_major_versions
52
54
 
53
55
  distro_puppet_version = {
@@ -62,6 +64,19 @@ module PuppetMetadata
62
64
  yield [os, 'rolling', distro_puppet_version]
63
65
  else
64
66
  releases&.each do |release|
67
+ if PuppetMetadata::OperatingSystem.eol?(os, release, at)
68
+ message = "Skipping EOL operating system #{os} #{release}"
69
+
70
+ if ENV.key?('GITHUB_ACTIONS')
71
+ # TODO: determine file and position within the file
72
+ puts "::warning file=metadata.json::#{message}"
73
+ else
74
+ warn message
75
+ end
76
+
77
+ next
78
+ end
79
+
65
80
  majors.each do |puppet_version|
66
81
  if AIO.has_aio_build?(os, release, puppet_version[:value])
67
82
  yield [os, release, puppet_version]
@@ -74,10 +89,10 @@ module PuppetMetadata
74
89
  end
75
90
  end
76
91
 
77
- def puppet_beaker_test_matrix
92
+ def puppet_beaker_test_matrix(at)
78
93
  matrix_include = []
79
94
 
80
- beaker_os_releases do |os, release, puppet_version|
95
+ beaker_os_releases(at) do |os, release, puppet_version|
81
96
  next if puppet_version_below_minimum?(puppet_version[:value])
82
97
 
83
98
  setfile = os_release_to_beaker_setfile(os, release, puppet_version[:collection])
@@ -108,28 +123,6 @@ module PuppetMetadata
108
123
  matrix_include
109
124
  end
110
125
 
111
- def github_action_test_matrix
112
- matrix_include = []
113
-
114
- beaker_os_releases do |os, release, puppet_version|
115
- next if puppet_version_below_minimum?(puppet_version[:value])
116
-
117
- setfile = os_release_to_beaker_setfile(os, release, puppet_version[:collection])
118
- next unless setfile
119
-
120
- matrix_include << {
121
- name: "#{puppet_version[:name]} - #{setfile[1]}",
122
- setfile: {
123
- name: setfile[1],
124
- value: setfile[0],
125
- },
126
- puppet: puppet_version,
127
- }
128
- end
129
-
130
- matrix_include
131
- end
132
-
133
126
  def puppet_version_below_minimum?(version)
134
127
  return false unless version && options[:minimum_major_puppet_version]
135
128
 
@@ -140,7 +133,6 @@ module PuppetMetadata
140
133
  PuppetMetadata::Beaker.os_release_to_setfile(
141
134
  os,
142
135
  release,
143
- use_fqdn: options[:beaker_use_fqdn],
144
136
  pidfile_workaround: options[:beaker_pidfile_workaround],
145
137
  domain: options[:domain],
146
138
  puppet_version: puppet_collection,
@@ -50,7 +50,7 @@ module PuppetMetadata
50
50
  'OracleLinux' => {
51
51
  '9' => '2032-06-30',
52
52
  '8' => '2029-07-01',
53
- '7' => '2024-07-01',
53
+ '7' => '2024-12-31',
54
54
  },
55
55
  # https://endoflife.software/operating-systems/linux/fedora
56
56
  'Fedora' => {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet_metadata
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vox Pupuli
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-04-25 00:00:00.000000000 Z
12
+ date: 2024-05-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: metadata-json-lint
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  - !ruby/object:Gem::Version
171
171
  version: '0'
172
172
  requirements: []
173
- rubygems_version: 3.2.33
173
+ rubygems_version: 3.5.9
174
174
  signing_key:
175
175
  specification_version: 4
176
176
  summary: Data structures for the Puppet Metadata