Skip to content

Resolve real puppet9 package version instead of trusting convenience file - #846

Merged
span786 merged 2 commits into
mainfrom
PA-9082-macos-puppet9-package-version
Aug 12, 2026
Merged

span786 merged 2 commits into
mainfrom
PA-9082-macos-puppet9-package-version

Conversation

@span786

@span786 span786 commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fixes the puppet8→9 PA acceptance test failing on macOS 26 and other macOSes: puppet agent -t returned exit 6 because the agent couldn't download puppet-agent-9.0.0.204.g5c75eb0ed-1.osx26.dmg (404).
  • Root cause: test_upgrade_puppet8_to_puppet9.rb used the puppet-agent-9.x-version convenience file from passing-agent-SHAs/ as the literal package_version for mac/windows/solaris/aix. That file reports the eventual release version (derived from the build's :version: field, e.g. 9.0.0.204.g<sha>), but pre-9.0.0 nightlies are still packaged under Puppet's next-major pre-release convention (8.99.99.<build>, the build's :origversion:). mac/windows/solaris/aix install from a hand-built, exact filename, so the mismatch 404s; apt/yum are unaffected since they resolve latest via repo metadata.
  • This started happening after puppet-agent-private's VERSION file was bumped 8.99.99 → 9.0.0 (PA-9002), which changed the marketing/informational version reported by the convenience file without changing how packages are actually named — the two values silently diverged.
  • Fix: resolve the real package version from the build's own YAML (:origversion:) instead of trusting the convenience file. This is correct both now (during the pre-9.0.0 gap) and after the eventual 9.0.0 cut, since it always reads the authoritative field for what actually got packaged.

Verified live: derived latest_version = 8.99.99.204.g5c75eb0ed, matching the artifact actually published on artifactory; curl -I against the resulting mac_source URL returns 200 OK (previously 404).

Test plan

  • Reproduced the original 404 against a live macOS 26 acceptance host
  • Verified the fixed version-derivation logic produces the exact on-disk artifact filename (8.99.99.204.g5c75eb0ed-1.osx26.dmg) and resolves with 200 OK
  • ruby -c syntax check
  • Full test_upgrade_puppet8_to_puppet9.rb acceptance run against a macOS 26 agent

…file

The `puppet-agent-9.x-version` file at passing-agent-SHAs/ reports the
eventual release version (e.g. "9.0.0.204.g<sha>", derived from the
build's `:version:` field), but pre-9.0.0 nightlies are still packaged
under Puppet's next-major pre-release convention (8.99.99.<build>, the
build's `:origversion:`). mac/windows/solaris/aix install from a
hand-built, exact filename, so passing the "friendly" version as
package_version 404s downloading the dmg -- apt/yum are unaffected
since they resolve `latest` via repo metadata rather than a literal
filename.

Reproduced live against an osx-26 agent: the manifest built a URL for
puppet-agent-9.0.0.204.g5c75eb0ed-1.osx26.dmg (404), while artifactory
only ever published puppet-agent-8.99.99.204.g5c75eb0ed-1.osx26.dmg
for that SHA.

Resolve the real package version from the build's own YAML
(`:origversion:`) instead, so this stays correct across the eventual
9.0.0 cut too.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@span786

span786 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

@span786
span786 marked this pull request as ready for review August 6, 2026 14:17
@span786
span786 requested review from a team and bastelfreak as code owners August 6, 2026 14:17
@span786

span786 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

build_yaml_url = "https://builds.delivery.puppetlabs.net/puppet-agent/#{latest_version_sha}/artifacts/#{latest_version_sha}.yaml"
build_data = YAML.safe_load(fetch_with_retry.call(build_yaml_url), permitted_classes: [Symbol])
origversion = build_data[:origversion] || fail_test("No :origversion found in #{build_yaml_url}")
latest_version = "#{origversion}.g#{latest_version_sha[0, 9]}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't going to work for tagged releases. Suggest using this instead

$ curl -s https://artifactory.delivery.puppetlabs.net/artifactory/generic/api/v1/json/report-9.x | jq -r '."suite-version"'
9.0.0.1.gb19013e48

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks. Switched to the generic suite report (.../artifactory/generic/api/v1/json/report-9.x, suite-version) as suggested -- verified it returns 9.0.0.1.gb19013e48 and that the corresponding dmg exists on artifactory. Pushed in c1a438e.

Per review feedback on #846 (#846 (comment)),
resolving the version from a single build's own per-SHA YAML doesn't
work once that build is promoted to a tagged release. Use the
artifactory generic suite report instead
(.../artifactory/generic/api/v1/json/report-9.x), which reports the
real, currently-packaged version (`suite-version`) regardless of
whether the 9.x suite is on a pre-release or a tagged version.

Verified live: report-9.x currently returns suite-version
"9.0.0.1.gb19013e48", and the corresponding
puppet-agent-9.0.0.1.gb19013e48-1.osx26.dmg exists on artifactory
(200 OK).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@span786
span786 merged commit ca358e8 into main Aug 12, 2026
9 checks passed
@span786
span786 deleted the PA-9082-macos-puppet9-package-version branch August 12, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants