puppet_metadata 6.0.0 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ac5190193748a7ec1f0d61f9c7ef2bac509bb78e1e854b373362e421cf4a656
4
- data.tar.gz: dcafc939d26360e09cd7525b72ca2e4268802d2e4103d4c61b14570a4700a402
3
+ metadata.gz: 6214264b2f9a9a8848eb3a02fb25b376f597b7fe083b1a96b2cc2625cea88e16
4
+ data.tar.gz: 8475ef16fdeb252ac39f26135dcaba133ccfa85665cfaa326de1f00b542bf233
5
5
  SHA512:
6
- metadata.gz: 7e18f077b5298afce2a703c1c1c66d941f447a72740dc29105b57d9cd1cb929ed4c4a537a021950ca4ed2c1cda06eaf40d3f1e8c927f7b05212b1f241e0db331
7
- data.tar.gz: b16239f27e4a1c74174816fe1b59bd28f1503f4839fc52bfc952f3c6ce1fe3d70bdccacb138f136e1f75a1423ef1537d574c07b2625bc044a8a12094ade701a6
6
+ metadata.gz: 79311279ba3fb754c8c9bf2dd4435d90546ce73d3f3d4a051f8d3e931976f5558f0aae086aa580d756d8adc6338ac195e45b91abd781032aba049f1301e43b69
7
+ data.tar.gz: 9fb3ffeb08c835bcac25a891e7083fe2b4598011b3c8ac686ec52dd339eefc00a9cda9cc89848c7e9d51457069c9972859892db66984c8d44d155b980eb925b4
data/README.md CHANGED
@@ -8,7 +8,8 @@
8
8
  [![RubyGem Downloads](https://img.shields.io/gem/dt/puppet_metadata.svg)](https://rubygems.org/gems/puppet_metadata)
9
9
  [![Donated by Ewoud Kohl van Wijngaarden](https://img.shields.io/badge/donated%20by-Ewoud%20Kohl%20van%20Wijngaarden-fb7047.svg)](#transfer-notice)
10
10
 
11
- The gem intends to provide an abstraction over Puppet's metadata.json file. Its API allow easy iteration over its illogical data structures.
11
+ The gem intends to provide an abstraction over Puppet's metadata.json file.
12
+ Its API allow easy iteration over its illogical data structures.
12
13
 
13
14
  - [puppet\_metadata](#puppet_metadata)
14
15
  - [New CLI interface in 6.0.0](#new-cli-interface-in-600)
@@ -126,7 +127,8 @@ Debian => 13
126
127
 
127
128
  ## Generating Github Actions outputs
128
129
 
129
- To get outputs [usable in Github Actions](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions), there is the `metadata2gha` command available. This generates based on metadata.json, such as [Beaker](https://github.com/voxpupuli/beaker) setfiles, Puppet major versions and a Puppet unit test matrix.
130
+ To get outputs [usable in Github Actions](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions), there is the `metadata2gha` command available.
131
+ This generates based on metadata.json, such as [Beaker](https://github.com/voxpupuli/beaker) setfiles, Puppet major versions and a Puppet unit test matrix.
130
132
 
131
133
  ```console
132
134
  $ metadata2gha
@@ -258,6 +260,75 @@ This results in the following JSON data
258
260
  ]
259
261
  ```
260
262
 
263
+ We can also limit the matrix to a specific collection:
264
+
265
+ ```console
266
+ $ metadata2gha --collection openvox8
267
+ ```
268
+
269
+ ```
270
+ [
271
+ {
272
+ "name": "OpenVox 8 - AlmaLinux 8",
273
+ "env": {
274
+ "BEAKER_PUPPET_COLLECTION": "openvox8",
275
+ "BEAKER_SETFILE": "almalinux8-64{hostname=almalinux8-64-openvox8}"
276
+ }
277
+ },
278
+ {
279
+ "name": "OpenVox 8 - AlmaLinux 9",
280
+ "env": {
281
+ "BEAKER_PUPPET_COLLECTION": "openvox8",
282
+ "BEAKER_SETFILE": "almalinux9-64{hostname=almalinux9-64-openvox8}"
283
+ }
284
+ },
285
+ {
286
+ "name": "OpenVox 8 - CentOS 9",
287
+ "env": {
288
+ "BEAKER_PUPPET_COLLECTION": "openvox8",
289
+ "BEAKER_SETFILE": "centos9-64{hostname=centos9-64-openvox8}"
290
+ }
291
+ },
292
+ {
293
+ "name": "OpenVox 8 - Debian 11",
294
+ "env": {
295
+ "BEAKER_PUPPET_COLLECTION": "openvox8",
296
+ "BEAKER_SETFILE": "debian11-64{hostname=debian11-64-openvox8}"
297
+ }
298
+ }
299
+ ]
300
+ ```
301
+
302
+ There is also the special collection `staging`.
303
+ This will generate a matrix for all OS releases with AIO packages.
304
+ The idea is to test unreleased packages.
305
+
306
+ ```
307
+ [
308
+ {
309
+ "name": "OpenVox 8 - AlmaLinux 8",
310
+ "env": {
311
+ "BEAKER_PUPPET_COLLECTION": "staging",
312
+ "BEAKER_SETFILE": "almalinux8-64{hostname=almalinux8-64-staging}"
313
+ }
314
+ },
315
+ {
316
+ "name": "OpenVox 8 - AlmaLinux 9",
317
+ "env": {
318
+ "BEAKER_PUPPET_COLLECTION": "staging",
319
+ "BEAKER_SETFILE": "almalinux9-64{hostname=almalinux9-64-staging}"
320
+ }
321
+ },
322
+ {
323
+ "name": "OpenVox 8 - CentOS 9",
324
+ "env": {
325
+ "BEAKER_PUPPET_COLLECTION": "staging",
326
+ "BEAKER_SETFILE": "centos9-64{hostname=centos9-64-staging}"
327
+ }
328
+ }
329
+ ]
330
+ ```
331
+
261
332
  ## Work with the API
262
333
 
263
334
  The API can be initialised like this:
data/bin/metadata2gha CHANGED
@@ -13,6 +13,7 @@ options = {
13
13
  OptionParser.new do |opts|
14
14
  opts.banner = "Usage: #{$0} [options] metadata"
15
15
 
16
+ opts.on('-c', '--collection VALUE', 'Limit GitHub jobs to only test this specific collection') { |opt| options[:collection] = opt }
16
17
  opts.on('-d', '--domain VALUE', 'the domain for the box, only used when --use-fqdn is set to true') { |opt| options[:domain] = opt }
17
18
  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 }
18
19
  opts.on('--beaker-facter FACT:LABEL:VALUES', 'Expand the matrix based on a fact. Separate values using commas') do |opt|
data/bin/update_eol_dates CHANGED
@@ -206,6 +206,26 @@ def handle_ubuntu(current_data)
206
206
  updated_data
207
207
  end
208
208
 
209
+ def sort_versions(versions)
210
+ versions.sort do |a, b|
211
+ version_a, eol_a = a
212
+ version_b, eol_b = b
213
+
214
+ # Handle nil values (not yet EOL) - they go first
215
+ if eol_a.nil? && !eol_b.nil?
216
+ -1
217
+ elsif !eol_a.nil? && eol_b.nil?
218
+ 1
219
+ elsif eol_a == eol_b
220
+ # Same EOL date (or both nil) - sort by version number descending
221
+ Gem::Version.new(version_b) <=> Gem::Version.new(version_a)
222
+ else
223
+ # Different EOL dates - sort by date descending (later date first)
224
+ eol_b <=> eol_a
225
+ end
226
+ end.to_h
227
+ end
228
+
209
229
  def main
210
230
  data_file = File.expand_path('../data/eol_dates.json', __dir__)
211
231
 
@@ -231,26 +251,7 @@ def main
231
251
  end
232
252
 
233
253
  # Sort each OS's versions by EOL date (latest EOL first, then nulls)
234
- sorted_data = {}
235
- updated_data.each do |os_name, versions|
236
- sorted_versions = versions.sort do |a, b|
237
- version_a, eol_a = a
238
- version_b, eol_b = b
239
-
240
- # Handle nil values (not yet EOL) - they go first
241
- return -1 if eol_a.nil? && !eol_b.nil?
242
- return 1 if !eol_a.nil? && eol_b.nil?
243
-
244
- if eol_a == eol_b
245
- # Same EOL date (or both nil) - sort by version number descending
246
- Gem::Version.new(version_b) <=> Gem::Version.new(version_a)
247
- else
248
- # Different EOL dates - sort by date descending (later date first)
249
- (eol_b || '0000-00-00') <=> (eol_a || '0000-00-00')
250
- end
251
- end.to_h
252
- sorted_data[os_name] = sorted_versions
253
- end
254
+ sorted_data = updated_data.transform_values { |versions| sort_versions(versions) }
254
255
 
255
256
  File.write(data_file, "#{JSON.pretty_generate(sorted_data)}\n")
256
257
  puts "\nUpdated #{data_file}"
data/data/eol_dates.json CHANGED
@@ -7,27 +7,27 @@
7
7
  "Amazon": {
8
8
  "2023": "2029-06-30",
9
9
  "2.0": "2026-06-30",
10
- "2010.11": "2023-12-31",
11
- "2011.09": "2023-12-31",
12
- "2012.03": "2023-12-31",
13
- "2012.09": "2023-12-31",
14
- "2013.03": "2023-12-31",
15
- "2013.09": "2023-12-31",
16
- "2014.03": "2023-12-31",
17
- "2014.09": "2023-12-31",
18
- "2015.03": "2023-12-31",
19
- "2015.09": "2023-12-31",
20
- "2016.03": "2023-12-31",
21
- "2016.09": "2023-12-31",
22
- "2017.03": "2023-12-31",
10
+ "2018.03": "2023-12-31",
23
11
  "2017.09": "2023-12-31",
24
- "2018.03": "2023-12-31"
12
+ "2017.03": "2023-12-31",
13
+ "2016.09": "2023-12-31",
14
+ "2016.03": "2023-12-31",
15
+ "2015.09": "2023-12-31",
16
+ "2015.03": "2023-12-31",
17
+ "2014.09": "2023-12-31",
18
+ "2014.03": "2023-12-31",
19
+ "2013.09": "2023-12-31",
20
+ "2013.03": "2023-12-31",
21
+ "2012.09": "2023-12-31",
22
+ "2012.03": "2023-12-31",
23
+ "2011.09": "2023-12-31",
24
+ "2010.11": "2023-12-31"
25
25
  },
26
26
  "CentOS": {
27
27
  "10": "2030-01-01",
28
28
  "9": "2027-05-31",
29
29
  "7": "2024-06-30",
30
- "8": "2021-12-31",
30
+ "8": "2024-05-31",
31
31
  "6": "2020-11-30",
32
32
  "5": "2017-03-31",
33
33
  "4": "2012-02-29",
@@ -47,7 +47,7 @@
47
47
  "3.1": "2008-03-31",
48
48
  "3.0": "2006-06-30",
49
49
  "2.2": "2003-06-30",
50
- "2.1": "2000-09-30",
50
+ "2.1": "2000-10-30",
51
51
  "2.0": "1999-02-15",
52
52
  "1.3": "1998-12-08",
53
53
  "1.2": "1997-10-23",
@@ -63,7 +63,7 @@
63
63
  "Fedora": {
64
64
  "43": "2026-12-09",
65
65
  "42": "2026-05-13",
66
- "41": "2025-11-26",
66
+ "41": "2025-12-15",
67
67
  "40": "2025-05-13",
68
68
  "39": "2024-11-26",
69
69
  "38": "2024-05-21",
@@ -106,66 +106,69 @@
106
106
  "1": "2004-09-20"
107
107
  },
108
108
  "FreeBSD": {
109
+ "15": "2029-12-31",
109
110
  "14": "2028-11-30",
111
+ "14.4": "2026-12-31",
112
+ "15.0": "2026-09-30",
110
113
  "14.3": "2026-06-30",
111
- "13": "2026-04-30",
112
114
  "13.5": "2026-04-30",
115
+ "13": "2026-04-30",
113
116
  "14.2": "2025-09-30",
114
117
  "13.4": "2025-06-30",
115
118
  "14.1": "2025-03-31",
116
119
  "13.3": "2024-12-31",
117
120
  "14.0": "2024-09-30",
118
121
  "13.2": "2024-06-30",
119
- "12": "2023-12-31",
120
122
  "12.4": "2023-12-31",
123
+ "12": "2023-12-31",
121
124
  "13.1": "2023-07-31",
122
125
  "12.3": "2023-03-31",
123
126
  "13.0": "2022-08-31",
124
127
  "12.2": "2022-03-31",
125
- "11": "2021-09-30",
126
128
  "11.4": "2021-09-30",
129
+ "11": "2021-09-30",
127
130
  "12.1": "2021-01-31",
128
131
  "11.3": "2020-09-30",
129
132
  "12.0": "2020-02-29",
130
133
  "11.2": "2019-10-31",
131
- "10": "2018-10-31",
132
134
  "10.4": "2018-10-31",
135
+ "10": "2018-10-31",
133
136
  "11.1": "2018-09-30",
134
137
  "10.3": "2018-04-30",
135
138
  "11.0": "2017-11-30",
136
- "9": "2016-12-31",
137
- "9.3": "2016-12-31",
138
- "10.1": "2016-12-31",
139
139
  "10.2": "2016-12-31",
140
- "8": "2015-08-01",
140
+ "10.1": "2016-12-31",
141
+ "9.3": "2016-12-31",
142
+ "9": "2016-12-31",
141
143
  "8.4": "2015-08-01",
144
+ "8": "2015-08-01",
142
145
  "10.0": "2015-02-28",
143
- "9.1": "2014-12-31",
144
146
  "9.2": "2014-12-31",
147
+ "9.1": "2014-12-31",
145
148
  "8.3": "2014-04-30",
146
149
  "9.0": "2013-03-31",
147
- "7": "2013-02-28",
148
150
  "7.4": "2013-02-28",
149
- "8.1": "2012-07-31",
151
+ "7": "2013-02-28",
150
152
  "8.2": "2012-07-31",
153
+ "8.1": "2012-07-31",
151
154
  "7.3": "2012-03-31",
152
155
  "7.1": "2011-02-28",
153
- "6": "2010-11-30",
154
- "6.4": "2010-11-30",
155
156
  "8.0": "2010-11-30",
157
+ "6.4": "2010-11-30",
158
+ "6": "2010-11-30",
156
159
  "7.2": "2010-06-30",
157
160
  "6.3": "2010-01-31",
158
161
  "7.0": "2009-04-30",
159
- "5": "2008-05-31",
162
+ "6.2": "2008-05-31",
160
163
  "6.1": "2008-05-31",
161
164
  "5.5": "2008-05-31",
162
- "6.2": "2008-05-31",
163
- "4": "2007-01-31",
164
- "4.10": "2007-01-31",
165
- "4.11": "2007-01-31",
165
+ "5": "2008-05-31",
166
166
  "6.0": "2007-01-31",
167
- "5.3": "2006-10-31",
167
+ "4.11": "2007-01-31",
168
+ "4.10": "2007-01-31",
169
+ "4": "2007-01-31",
168
170
  "5.4": "2006-10-31",
171
+ "5.3": "2006-10-31",
169
172
  "5.2": "2005-02-28",
170
173
  "4.9": "2004-08-31",
171
174
  "5.1": "2004-04-30",
@@ -207,20 +210,21 @@
207
210
  "8": "2029-05-31"
208
211
  },
209
212
  "Scientific": {
210
- "7": "2024-06-30",
211
213
  "8": "2024-06-30",
214
+ "7": "2024-06-30",
212
215
  "6": "2020-11-30",
213
216
  "5": "2017-03-31",
214
217
  "4": "2012-02-29",
215
218
  "3": "2010-10-30"
216
219
  },
217
220
  "SLES": {
218
- "15": "2031-07-31",
219
221
  "15.7": "2031-07-31",
222
+ "15": "2031-07-31",
223
+ "16.0": "2027-11-30",
220
224
  "15.6": "2025-12-31",
221
225
  "15.5": "2024-12-31",
222
- "12": "2024-10-31",
223
226
  "12.5": "2024-10-31",
227
+ "12": "2024-10-31",
224
228
  "15.4": "2023-12-31",
225
229
  "15.3": "2022-12-31",
226
230
  "15.2": "2021-12-31",
@@ -228,15 +232,15 @@
228
232
  "12.4": "2020-06-30",
229
233
  "15.0": "2019-12-31",
230
234
  "12.3": "2019-06-30",
231
- "11": "2019-03-31",
232
235
  "11.4": "2019-03-31",
236
+ "11": "2019-03-31",
233
237
  "12.2": "2018-03-31",
234
238
  "12.1": "2017-05-31",
235
239
  "12.0": "2016-06-30",
236
240
  "11.3": "2016-01-31",
237
241
  "11.2": "2014-01-31",
238
- "10": "2013-07-31",
239
242
  "10.4": "2013-07-31",
243
+ "10": "2013-07-31",
240
244
  "11.1": "2012-08-31",
241
245
  "10.3": "2011-10-11",
242
246
  "11.0": "2010-12-31",
@@ -245,7 +249,8 @@
245
249
  "10.0": "2007-12-31"
246
250
  },
247
251
  "Ubuntu": {
248
- "24.04": "2029-04-25",
252
+ "26.04": "2031-05-31",
253
+ "24.04": "2029-05-31",
249
254
  "22.04": "2027-04-01",
250
255
  "25.10": "2026-07-01",
251
256
  "25.04": "2026-01-17",
@@ -273,9 +278,9 @@
273
278
  "13.10": "2014-07-17",
274
279
  "12.10": "2014-05-16",
275
280
  "13.04": "2014-01-27",
276
- "8.04": "2013-05-09",
277
- "10.04": "2013-05-09",
278
281
  "11.10": "2013-05-09",
282
+ "10.04": "2013-05-09",
283
+ "8.04": "2013-05-09",
279
284
  "11.04": "2012-10-28",
280
285
  "10.10": "2012-04-10",
281
286
  "6.06": "2011-06-01",
@@ -52,6 +52,12 @@ module PuppetMetadata
52
52
  '12' => 7..8,
53
53
  '13' => [8],
54
54
  },
55
+ 'Ubuntu' => {
56
+ '20.04' => 7..8,
57
+ '22.04' => 7..8,
58
+ '24.04' => 7..8,
59
+ '26.04' => [8],
60
+ },
55
61
  }).freeze
56
62
 
57
63
  PUPPET_RUBY_VERSIONS = {
@@ -56,37 +56,63 @@ module PuppetMetadata
56
56
 
57
57
  def beaker_os_releases(at = nil)
58
58
  majors = beaker_major_versions
59
- distro_puppet_version = {
60
- name: 'Distro Puppet',
61
- value: nil, # We don't know the version and since it's rolling, it can be anything
62
- collection: 'none',
63
- requirement: 'puppet',
64
- }
65
- metadata.operatingsystems.each do |os, releases|
66
- case os
67
- when 'Archlinux', 'Gentoo'
68
- # both currently only ship puppet, not openvox yet
69
- yield [os, 'rolling', distro_puppet_version]
70
- else
59
+ # for staging, we don't want to have one job per major openvox/puppet version
60
+ # we just want to pull a specific, unreleased, package from a webserver
61
+ # and we only do this for AIO builds, because we don't have other packages
62
+ collection = options[:collection]
63
+ collection = nil if collection&.empty?
64
+ if collection == 'staging'
65
+ latest = majors.first.dup
66
+ latest[:collection] = 'staging'
67
+ metadata.operatingsystems.each do |os, releases|
68
+ # iterates on all releases for one OS
69
+ # `&` in case the OS has no releases in metadata.json
71
70
  releases&.each do |release|
72
- if PuppetMetadata::OperatingSystem.eol?(os, release, at)
73
- message = "Skipping EOL operating system #{os} #{release}"
74
-
75
- if ENV.key?('GITHUB_ACTIONS')
76
- # TODO: determine file and position within the file
77
- puts "::warning file=metadata.json::#{message}"
78
- else
79
- warn message
71
+ next if PuppetMetadata::OperatingSystem.eol?(os, release, at)
72
+
73
+ yield [os, release, latest] if AIO.has_aio_build?(os, release, latest[:value], latest[:requirement])
74
+ end
75
+ end
76
+ else
77
+ distro_puppet_version = {
78
+ name: 'Distro Puppet',
79
+ value: nil, # We don't know the version and since it's rolling, it can be anything
80
+ collection: 'none',
81
+ requirement: 'puppet',
82
+ }
83
+ metadata.operatingsystems.each do |os, releases|
84
+ case os
85
+ when 'Archlinux', 'Gentoo'
86
+ # we filter out the rolling distributions because we don't know which openvox/puppet version we get and we want a specific collection
87
+ next if collection
88
+
89
+ # both currently only ship puppet, not openvox yet
90
+ yield [os, 'rolling', distro_puppet_version]
91
+ else
92
+ releases&.each do |release|
93
+ if PuppetMetadata::OperatingSystem.eol?(os, release, at)
94
+ message = "Skipping EOL operating system #{os} #{release}"
95
+
96
+ if ENV.key?('GITHUB_ACTIONS')
97
+ # TODO: determine file and position within the file
98
+ puts "::warning file=metadata.json::#{message}"
99
+ else
100
+ warn message
101
+ end
102
+
103
+ next
80
104
  end
81
105
 
82
- next
83
- end
106
+ majors.each do |puppet_version|
107
+ # if a collection is set, it's not 'staging'
108
+ # we then want to filter out all results that don't match our provided collection
109
+ next if collection && puppet_version[:collection] != collection
84
110
 
85
- majors.each do |puppet_version|
86
- if AIO.has_aio_build?(os, release, puppet_version[:value], puppet_version[:requirement])
87
- yield [os, release, puppet_version]
88
- elsif PuppetMetadata::OperatingSystem.os_release_puppet_version(os, release) == puppet_version[:value]
89
- yield [os, release, distro_puppet_version.merge(value: puppet_version[:value])]
111
+ if AIO.has_aio_build?(os, release, puppet_version[:value], puppet_version[:requirement])
112
+ yield [os, release, puppet_version]
113
+ elsif PuppetMetadata::OperatingSystem.os_release_puppet_version(os, release) == puppet_version[:value]
114
+ yield [os, release, distro_puppet_version.merge(value: puppet_version[:value])]
115
+ end
90
116
  end
91
117
  end
92
118
  end
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: 6.0.0
4
+ version: 6.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vox Pupuli
@@ -118,14 +118,14 @@ dependencies:
118
118
  requirements:
119
119
  - - "~>"
120
120
  - !ruby/object:Gem::Version
121
- version: 5.1.0
121
+ version: 5.2.0
122
122
  type: :development
123
123
  prerelease: false
124
124
  version_requirements: !ruby/object:Gem::Requirement
125
125
  requirements:
126
126
  - - "~>"
127
127
  - !ruby/object:Gem::Version
128
- version: 5.1.0
128
+ version: 5.2.0
129
129
  - !ruby/object:Gem::Dependency
130
130
  name: yard
131
131
  requirement: !ruby/object:Gem::Requirement
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  - !ruby/object:Gem::Version
192
192
  version: '0'
193
193
  requirements: []
194
- rubygems_version: 4.0.3
194
+ rubygems_version: 4.0.6
195
195
  specification_version: 4
196
196
  summary: Data structures for the Puppet Metadata
197
197
  test_files: []