beaker-pe 3.6.3 → 3.6.4

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: 03bf3c005114d8ea4bc9e8a2f10b1d25afcd1e3919d09a0a079e925ef35b51ff
4
- data.tar.gz: c5507077282d107fdab48081b9736fcfb9a9af8ca600faf316e76fc26ba16067
3
+ metadata.gz: 17f39948dbc58217035cd4e93469070ac5f35309dc2078fb3995e7edc6558d7f
4
+ data.tar.gz: 65d1131709c2e886a82dc29f74a7f5a9907f89b2da0fc799233f325954069193
5
5
  SHA512:
6
- metadata.gz: efb6f1688532acf22b13e6978d4b5cc65df15b2c1e781c886a701deb42206d0985d3bd1af74ddcda09377700777fb83c8278971ef567f682aee71478c278c918
7
- data.tar.gz: c9a0843cf5ee0dffa774db34b254214ffc0df72bc54bda36afb4ce89650e6060f481729721f43f67bd2396b0700f61f54d92595114b9314c51205a47a5693708
6
+ metadata.gz: bef219e4d18d83b1663764cb203cdeb1f857a889d602e4b22d91e1a47c9d96019a169bc8265cf67d485f3082bd67704e7454bc2caf5dff8548bf333be7fcda23
7
+ data.tar.gz: 420a8f53c44f65636413a31b292b8f510369a740fa619c9c163143e4af02f0de115c7fca9c9bae7cf29d4a63a94a103cf8fd8d26cc4048e6202a4292a1194248
data/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.6.4](https://github.com/puppetlabs/beaker-pe/tree/3.6.4) (2026-07-23)
4
+
5
+ [Full Changelog](https://github.com/puppetlabs/beaker-pe/compare/3.6.3...3.6.4)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - [PE-41009]: Fall back to agent-downloads when promoted agent is missing from the public mirror [#306](https://github.com/puppetlabs/beaker-pe/pull/306) ([Magisus](https://github.com/Magisus))
10
+
11
+ ## [3.6.3](https://github.com/puppetlabs/beaker-pe/tree/3.6.3) (2026-07-16)
12
+
13
+ [Full Changelog](https://github.com/puppetlabs/beaker-pe/compare/3.6.2...3.6.3)
14
+
15
+ **Fixed bugs:**
16
+
17
+ - [PE-45082]: Broaden is_expected_pe_postgres_failure? allowlist [#303](https://github.com/puppetlabs/beaker-pe/pull/303) ([steveax](https://github.com/steveax))
18
+
19
+ ## [3.6.2](https://github.com/puppetlabs/beaker-pe/tree/3.6.2) (2026-06-05)
20
+
21
+ [Full Changelog](https://github.com/puppetlabs/beaker-pe/compare/3.6.1...3.6.2)
22
+
23
+ **Fixed bugs:**
24
+
25
+ - Add waitforlock flag to second puppet runs to prevent lock collisions [#300](https://github.com/puppetlabs/beaker-pe/pull/300) ([jonathannewman](https://github.com/jonathannewman))
26
+
3
27
  ## [3.6.1](https://github.com/puppetlabs/beaker-pe/tree/3.6.1) (2025-11-21)
4
28
 
5
29
  [Full Changelog](https://github.com/puppetlabs/beaker-pe/compare/3.6.0...3.6.1)
@@ -43,6 +43,13 @@ module Beaker
43
43
  NODE_CONF_PATH = "#{MEEP_DATA_DIR}/conf.d/nodes"
44
44
  BEAKER_MEEP_TMP = "pe_conf"
45
45
 
46
+ # Base URL for promoted puppet-agent packages on the internal
47
+ # build-output host. Newer promoted agents (>= 8.11.0) are no longer
48
+ # published to the public pm.puppet.com / S3 mirror; el/windows installs
49
+ # fall back here. This is the same host the sles-11 and
50
+ # solaris-10-sparc install paths already use.
51
+ AGENT_DOWNLOADS_URL = 'http://agent-downloads.delivery.puppetlabs.net/puppet-agent'.freeze
52
+
46
53
  # @!macro [new] common_opts
47
54
  # @param [Hash{Symbol=>String}] opts Options to alter execution.
48
55
  # @option opts [Boolean] :silent (false) Do not produce log output
@@ -332,7 +339,7 @@ module Beaker
332
339
  # @api private
333
340
  def agent_package_common_vars(puppet_agent_ver, opts)
334
341
  {
335
- agent_downloads_url: "http://agent-downloads.delivery.puppetlabs.net/puppet-agent",
342
+ agent_downloads_url: AGENT_DOWNLOADS_URL,
336
343
  master_aio_version: puppet_fact(master, 'aio_agent_build'),
337
344
  stream: opts[:puppet_collection] || "puppet#{puppet_agent_ver[0]}"
338
345
  }
@@ -1113,6 +1120,36 @@ NOASK
1113
1120
  raise RuntimeError("#{host.class} not one of Beaker::(Windows|Mac|Unix)::Host")
1114
1121
  end
1115
1122
 
1123
+ # Fetch a promoted puppet-agent package into copy_dir_local. Tries the
1124
+ # primary (pm.puppet.com/S3) promoted mirror first; if that returns a
1125
+ # 404 — newer agents (>= 8.11.0) are no longer published there — fall
1126
+ # back to the internal agent-downloads host. Any non-404 failure is
1127
+ # re-raised unchanged.
1128
+ #
1129
+ # @param [String] release_path Primary base URL, already including the
1130
+ # /v2/agent/<pe_ver>/<agent_ver>/repos suffix and release_path_end
1131
+ # @param [String] release_path_end Platform suffix ('' unix, '/windows')
1132
+ # @param [String] download_file The package file name
1133
+ # @param [String] copy_dir_local Local destination directory
1134
+ # @param [String] agent_version The puppet-agent version being installed
1135
+ # @api private
1136
+ def fetch_promoted_agent_with_fallback(release_path, release_path_end, download_file, copy_dir_local, agent_version)
1137
+ download_uri = URI.parse("#{release_path}/#{download_file}")
1138
+ redirect = Net::HTTP.start(download_uri.host) { |http| http.head(download_uri.path).response['location'] }
1139
+ primary_base = redirect ? redirect.chomp("/#{download_file}") : release_path
1140
+
1141
+ begin
1142
+ fetch_http_file(primary_base, download_file, copy_dir_local)
1143
+ rescue => e
1144
+ raise unless e.message.include?('404')
1145
+
1146
+ fallback_base = "#{AGENT_DOWNLOADS_URL}/#{agent_version}/repos#{release_path_end}"
1147
+ logger.warn("Promoted puppet-agent not found at #{primary_base}/#{download_file} (#{e.message}); " \
1148
+ "falling back to #{fallback_base}/#{download_file}")
1149
+ fetch_http_file(fallback_base, download_file, copy_dir_local)
1150
+ end
1151
+ end
1152
+
1116
1153
  # Install shared repo of the puppet-agent on the given host(s). Downloaded from
1117
1154
  # location of the form PE_PROMOTED_BUILDS_URL/PE_VER/puppet-agent/AGENT_VERSION/repo
1118
1155
  #
@@ -1159,12 +1196,7 @@ NOASK
1159
1196
 
1160
1197
  onhost_copied_download = File.join(onhost_copy_base, download_file)
1161
1198
  onhost_copied_file = File.join(onhost_copy_base, release_file)
1162
- download_uri = URI.parse("#{release_path}/#{download_file}")
1163
- if (redirect = Net::HTTP.start(download_uri.host) { |http| http.head(download_uri.path).response['location'] })
1164
- fetch_http_file(redirect.chomp("/#{download_file}"), download_file, copy_dir_local)
1165
- else
1166
- fetch_http_file(release_path, download_file, copy_dir_local)
1167
- end
1199
+ fetch_promoted_agent_with_fallback(release_path, release_path_end, download_file, copy_dir_local, opts[:puppet_agent_version])
1168
1200
  scp_to host, File.join(copy_dir_local, download_file), onhost_copy_base
1169
1201
 
1170
1202
  if variant == 'windows'
@@ -3,7 +3,7 @@ module Beaker
3
3
  module PE
4
4
 
5
5
  module Version
6
- STRING = '3.6.3'
6
+ STRING = '3.6.4'
7
7
  end
8
8
 
9
9
  end
@@ -106,6 +106,73 @@ describe ClassMixedWithDSLInstallUtils do
106
106
  end
107
107
  end
108
108
 
109
+ context 'AGENT_DOWNLOADS_URL' do
110
+ it 'points at the internal agent-downloads host' do
111
+ expect(Beaker::DSL::InstallUtils::PEUtils::AGENT_DOWNLOADS_URL)
112
+ .to eq('http://agent-downloads.delivery.puppetlabs.net/puppet-agent')
113
+ end
114
+ end
115
+
116
+ context '#fetch_promoted_agent_with_fallback' do
117
+ let(:download_file) { 'puppet-agent-el-8-x86_64.tar.gz' }
118
+ let(:release_path) { 'https://pm.puppet.com/v2/agent/2023.8.3/8.11.0/repos' }
119
+ let(:s3_base) { 'https://s3.amazonaws.com/puppet-agents/puppet-agent/8.11.0/repos' }
120
+ let(:agent_dl_base) { 'http://agent-downloads.delivery.puppetlabs.net/puppet-agent/8.11.0/repos' }
121
+
122
+ before do
123
+ # HEAD on the pm.puppet.com URL resolves (via 302) to the S3 promoted mirror.
124
+ allow(Net::HTTP).to receive(:start).with('pm.puppet.com')
125
+ .and_return("#{s3_base}/#{download_file}")
126
+ end
127
+
128
+ it 'fetches from the primary mirror when the package is present' do
129
+ expect(subject).to receive(:fetch_http_file)
130
+ .with(s3_base, download_file, 'tmp/repo_configs/el')
131
+ expect(subject).not_to receive(:fetch_http_file)
132
+ .with(a_string_including('agent-downloads'), anything, anything)
133
+
134
+ subject.fetch_promoted_agent_with_fallback(release_path, '', download_file, 'tmp/repo_configs/el', '8.11.0')
135
+ end
136
+
137
+ it 'falls back to agent-downloads on a 404' do
138
+ allow(subject).to receive(:fetch_http_file)
139
+ .with(s3_base, download_file, 'tmp/repo_configs/el')
140
+ .and_raise("Failed to fetch_remote_file '#{s3_base}/#{download_file}' (404 Not Found)")
141
+ expect(subject).to receive(:fetch_http_file)
142
+ .with(agent_dl_base, download_file, 'tmp/repo_configs/el')
143
+
144
+ subject.fetch_promoted_agent_with_fallback(release_path, '', download_file, 'tmp/repo_configs/el', '8.11.0')
145
+ end
146
+
147
+ it 're-raises non-404 fetch errors without falling back' do
148
+ allow(subject).to receive(:fetch_http_file)
149
+ .with(s3_base, download_file, 'tmp/repo_configs/el')
150
+ .and_raise('Failed to fetch_remote_file (500 Server Error)')
151
+ expect(subject).not_to receive(:fetch_http_file)
152
+ .with(a_string_including('agent-downloads'), anything, anything)
153
+
154
+ expect {
155
+ subject.fetch_promoted_agent_with_fallback(release_path, '', download_file, 'tmp/repo_configs/el', '8.11.0')
156
+ }.to raise_error(/500/)
157
+ end
158
+
159
+ it 'preserves the /windows suffix in the fallback URL' do
160
+ win_file = 'puppet-agent-x64.msi'
161
+ win_release_path = 'https://pm.puppet.com/v2/agent/2023.8.3/8.11.0/repos/windows'
162
+ win_s3_base = "#{s3_base}/windows"
163
+ win_dl_base = "#{agent_dl_base}/windows"
164
+ allow(Net::HTTP).to receive(:start).with('pm.puppet.com')
165
+ .and_return("#{win_s3_base}/#{win_file}")
166
+ allow(subject).to receive(:fetch_http_file)
167
+ .with(win_s3_base, win_file, 'tmp/repo_configs/windows')
168
+ .and_raise("Failed to fetch_remote_file '#{win_s3_base}/#{win_file}' (404 Not Found)")
169
+ expect(subject).to receive(:fetch_http_file)
170
+ .with(win_dl_base, win_file, 'tmp/repo_configs/windows')
171
+
172
+ subject.fetch_promoted_agent_with_fallback(win_release_path, '/windows', win_file, 'tmp/repo_configs/windows', '8.11.0')
173
+ end
174
+ end
175
+
109
176
  context '#prep_host_for_upgrade' do
110
177
 
111
178
  it 'sets per host options before global options' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-pe
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.3
4
+ version: 3.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs