Repository navigation
Add class-level source_format default for apt::source - relates to issue #1268 - #1340
Phil-Friderici wants to merge 1 commit into
Conversation
Relates to puppetlabs#1268. Add an `apt::source_format` class parameter (default: `list`) that supplies the format for `apt::source` resources which do not set `source_format` themselves. A format set on an individual resource still takes precedence, so deb822 (`sources`) can be enabled for all sources with a single setting: class { 'apt': source_format => 'sources', } `apt::source::source_format` now defaults to `undef` and inherits the class value. Sources that use `key`, `pin` or a non-empty `include` (all unsupported by the deb822 format) keep the `list` format when inheriting the default, so existing declarations and `apt::backports` behave as before. The default stays `list`, so there is no behavior change unless the parameter is set. Tests: - unit: inheritance, per-resource override in both directions, legacy options falling back to `list`, `apt::backports` staying on `list` - acceptance: the class default yields a `.sources` file and a per-source override keeps `.list` Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Thanks for the PR @Phil-Friderici , I'll kick off some acceptance testing to get you some platform testing feedback on this one. |
|
Tests are being executed for this PR in #1342 |
|
Hey @Phil-Friderici, while the tests are running, I did a little digging into some potentially overlapping work in some other PRs. This class-level default is a good way to handle #1268, especially because it also reaches apt::source resources declared in other modules. We might want to wait on a few other PRs and pull those down into this:
I'll queue this up for review to be after those other PRs so that we'll be able to pull those down before this goes in. Once they are merged up, this PR can be rebased/merged/updated. |
|
🛑 Acceptance Test Results: https://github.com/puppetlabs/puppetlabs-apt/actions/runs/44435400752?pr=1342 Most platforms are fine, but Debian 12 is failing for both Puppet Core 8 and Puppet Core 9 with the same issue in the new acceptance test. I pointed Claude Code at the errors and PR changes to get a first analysis of the failure and root cause: From 🤖 Claude Code:
|
Summary
Adds an
apt::source_formatclass parameter (default:list) that supplies the format forapt::sourceresources that do not setsource_formatthemselves. A format set on an individual resource still takes precedence. deb822 (.sources) can now be enabled for all sources with one setting:apt::source::source_formatnow defaults toundefand inherits the class value. Sources that usekey,pinor a non-emptyinclude(not supported by the deb822 format) keep thelistformat when inheriting the default, so existing declarations andapt::backportsbehave as before.The default stays
list, so nothing changes unless the parameter is set. README and REFERENCE are updated.Additional Context
Since Ubuntu 25.10 only the deb822 format is supported, but
apt::sourcealways defaults tolist, sosource_formathas to be set on every resource.Apt::Source { source_format => 'sources' }only works in the current scope and does not reach other modules.A class-level opt-in is explicit and has no impact on existing catalogs. Automatic selection by OS release was not chosen because it would change the generated files (and leave the old
.listfiles behind) on upgrade without the user asking for it. Making the default OS-dependent can be done later by changing the default of the new parameter.Related Issues (if any)
Relates to #1268.
Checklist
puppet apply)Validation
bundle exec rake parallel_specbundle exec rubocopon the changed spec filesdocker_ub_6(Ubuntu 18.04, 20.04, 22.04, 24.04)apt_key_missing_spec,apt-keyis available) eachdocker_ub_6(Ubuntu 26.04)puppet8-release-resolute.deb(HTTP 404), the agent cannot be installedNot tested: Debian 11/12/13 and a manual
puppet apply.