puppet_metadata 3.7.1 → 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: 3c020a10d892a679413785b7c67a81848994b173543df654cec75001ca03fc37
4
- data.tar.gz: aa7f4b513266264e07e09077f0d4de5118824673a4d5cd7d794ec0333573732b
3
+ metadata.gz: de32c4860778531eeabf95f42ff94cfd21efa518384b9870ec2c9e91e982b2ae
4
+ data.tar.gz: 525f0f24c55dc00e198f52ad3a7708543e646c4d37548b3c0f781d02d6cf499d
5
5
  SHA512:
6
- metadata.gz: f44421da7afad6edcbc16af1d52a6017ea08db5ec58dd92b72f40af9738189e3eddb63c18b6091202831234a99277c48ae86d0524e895df76b5eb22c34a22362
7
- data.tar.gz: 47f2a4061065f4474cd847f86d1092d3e4ed41ce2077eb2389b0526c983e7472acdbbebca643b8a1578d587f9edbeeb56c25449d494b5b2efd06f666e82255a2
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,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.1
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