Skip to content

Move Mercurial version Hiera lookup into the profile#1214

Open
jwmossmoz wants to merge 3 commits into
masterfrom
fix/521-move-hg-lookup-to-profile
Open

Move Mercurial version Hiera lookup into the profile#1214
jwmossmoz wants to merge 3 commits into
masterfrom
fix/521-move-hg-lookup-to-profile

Conversation

@jwmossmoz
Copy link
Copy Markdown
Contributor

@jwmossmoz jwmossmoz commented May 15, 2026

Summary

  • Move the Hiera lookup for the Mercurial version out of win_packages::mercurial and into roles_profiles::profiles::mercurial, matching the repo's roles & profiles rule
  • Push windows.ext_pkg_src out of win_*_pkg defined types and every wrapper class that calls them; profiles now do the lookup and pass srcloc as a parameter
  • Move the windows.googlechrome.version lookup out of win_packages::chrome (still hits chocolatey on install)
  • Move the windows.mozilla_build.version lookup out of win_mozilla_build::install
  • Add win_packages::sevenzip::srcloc Hiera class-parameter key for the one case where require semantics prevent explicit param passing

Result: zero lookup() calls remain in any win_packages, win_nxlog, win_ultravnc, win_nsclient, win_openssh, win_mozilla_build::install, win_mozilla_maintenance_service::install, or win_os_settings::disable_monitor2 manifest.

Audit of package availability

Verified before the refactor that every package URL windows.ext_pkg_src would build is reachable on the Azure blob today (24 of 25 HEAD-probed; the one miss, Git-2.49.0-64-bit.exe from win_packages::git, is a dead class with no callers — not in scope here). Windows hardware pools share the same ext_pkg_src as Azure pools (no per-worker-type override exists in data/os/Windows/worker/).

Files touched

  • 3 defined types (win_msi_pkg, win_exe_pkg, win_zip_pkg)
  • 21 wrapper classes across win_packages, win_nxlog, win_ultravnc, win_nsclient, win_mozilla_build, win_mozilla_maintenance_service, win_openssh, win_os_settings
  • 14 profiles in roles_profiles::profiles
  • 1 Hiera key in data/os/Windows.yaml

Test plan

  • puppet-validate and puppet-lint pass on every changed file (via prek)
  • Each win_msi_pkg / win_exe_pkg / win_zip_pkg call site verified to pass srcloc =>
  • Kitchen converge on win116424h2azure (or equivalent) before merge

Fixes #521

jwmossmoz added 3 commits May 15, 2026 13:56
The lookup belongs in the profile per the repo's roles & profiles
architecture rule: profiles do Hiera lookups and pass values to module
classes as parameters. The win_packages::mercurial class now takes
$version as a parameter; the lookup moves to
roles_profiles::profiles::mercurial.

The previous $srcloc lookup inside win_packages::mercurial was unused
(win_msi_pkg constructs the URL from its own ext_pkg_src lookup), so
it's dropped rather than threaded through.

Fixes #521
The win_msi_pkg, win_exe_pkg, and win_zip_pkg defined types previously
called lookup('windows.ext_pkg_src') inline, violating the repo's roles
& profiles rule (lookups belong in profiles, then values pass into
modules as parameters). Same pattern existed for:

  - win_packages::chrome (windows.googlechrome.version lookup)
  - win_packages::drivers::intel_gfx (ext_pkg_src lookup)
  - win_mozilla_build::install (windows.mozilla_build.version lookup)

All three defined types and every wrapper class that calls them now
take String $srcloc as a parameter. Profiles do the lookup and pass
the value through.

win_packages::sevenzip is required transitively by win_zip_pkg via
Puppet's `require` keyword, which cannot pass parameters, so its
srcloc is supplied via Hiera class-parameter auto-lookup in
data/os/Windows.yaml. Every other class is invoked explicitly from a
profile and receives srcloc that way.

Also moves win_packages::chrome and win_mozilla_build::install version
lookups into their profiles.
Addresses two issues found in adversarial review of the prior commit:

1. The profile was declaring `win_mozilla_maintenance_service::install`
   before the parent class that initializes `$source_exe`. Compile-time
   evaluation order meant install would see source_exe as undef, locking
   in a broken `creates =>` path.

2. The profile was declaring `win_openssh::install` alongside but not
   replacing the implicit declaration triggered by sibling
   `win_openssh::service` / `::configuration`. The install class also
   reads `$win_openssh::ssh_program_data` and `::pwrshl_run_script` from
   a parent that is never declared anywhere (pre-existing gap, not
   created by this PR).

Fix: have each affected parent class take `$srcloc` and call
`class { '...::install': srcloc => $srcloc }` instead of bare `include`.
Profiles now pass `srcloc` to the parent only; no standalone install
declarations. For `win_openssh` — whose parent is never declared by any
profile — supply `win_openssh::install::srcloc` via Hiera class-parameter
auto-lookup, the same pattern used for `win_packages::sevenzip`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant