fix(ubuntu): pass AllowPackages from template to debutils.Repository#480
Merged
fix(ubuntu): pass AllowPackages from template to debutils.Repository#480
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Ubuntu provider behavior so packageRepositories[].allowPackages from image templates is respected when converting user repos into debutils.Repository, preventing unintended indexing of all packages from user-defined repositories.
Changes:
- Pass
AllowPackagesfromconfig.PackageRepositoryinto the Ubuntu provider’sdebutils.Repositorymapping.
You can also share your feedback on Copilot code review. Take the survey.
arodage
added a commit
that referenced
this pull request
Mar 11, 2026
Extract buildUserRepoList() helper from downloadImagePkgs() to make the user repo mapping testable in isolation. New tests: - TestBuildUserRepoListAllowPackages: table-driven test verifying AllowPackages is forwarded, nil is preserved, placeholders skipped, and multiple repos each keep their own filter - TestBuildUserRepoListFieldMapping: verifies all PackageRepository fields (Codename, URL, PKey, Component, Priority, AllowPackages, ID) are correctly mapped to debutils.Repository Addresses Copilot review comment on PR #480.
samueltaripin
approved these changes
Mar 12, 2026
The Ubuntu provider manually maps config.PackageRepository fields into debutils.Repository when building user repository configurations. The AllowPackages field was not included in this mapping, causing the allowPackages filter from image templates to be silently ignored Signed-off-by: Rodage, Alpesh Ramesh <alpesh.ramesh.rodage@intel.com>
Extract buildUserRepoList() helper from downloadImagePkgs() to make the user repo mapping testable in isolation. New tests: - TestBuildUserRepoListAllowPackages: table-driven test verifying AllowPackages is forwarded, nil is preserved, placeholders skipped, and multiple repos each keep their own filter - TestBuildUserRepoListFieldMapping: verifies all PackageRepository fields (Codename, URL, PKey, Component, Priority, AllowPackages, ID) are correctly mapped to debutils.Repository Addresses Copilot review comment on PR #480. Signed-off-by: Rodage, Alpesh Ramesh <alpesh.ramesh.rodage@intel.com>
3b56384 to
310d664
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge Checklist
Description
The Ubuntu provider manually maps
config.PackageRepositoryfields intodebutils.Repositorywhen building user repository configurations indownloadImagePkgs(). TheAllowPackagesfield was not included in this mapping, causing theallowPackagesfilter from image templates to be silently ignored.This meant all packages from user-defined repositories were indexed regardless of any
allowPackagesrestrictions.Root cause: Ubuntu's provider builds its own
debutils.Repositorylist instead of using the shareddebutils.UserPackages()path that ELXR uses. The manual field mapping simply omittedAllowPackages.Fix: Add
AllowPackages: userRepo.AllowPackagesto thedebutils.Repository{}struct literal.Other providers are not affected:
debutils.UserRepo→debutils.UserPackages()which already mapsAllowPackagesconfig.PackageRepositorydirectly torpmutils.UserRepowhich readsAllowPackagesfrom the structAny Newly Introduced Dependencies
None.
How Has This Been Tested?
ubuntu24-x86_64-robotics-jazzy-raw.ymltemplate usingallowPackageson ECI (priority 1000) and AMR (priority 1001) repositories — 2339 packages resolved, 2319 installed, image built successfully (6.97 GB compressed)allowPackageshas no effect and all ECI packages are indexed, causing duplicate versions in cache