← Back to issue list

repo: drop _AptCache and add migrate to install_stage_packages()

View original Github issue

Metadata

Project
snapcraft
Number
#3030
Type
pull request
State
merged
Author
cjp256
Labels
Created
Updated
Closed

Current evaluation

Merged refactoring removing _AptCache and consolidating repo logic into install_stage_packages(). Uses system apt cache for performance, updates tests, and migrates ROS plugins. Approved; +490/-1009 lines across 18 files.

Suggested action:

No scores available.

Issue body

This does remove the broken dependency handling... I need a working test case to make sure that's solid. - Move repo.get_pkg_name_parts to test_base, even though it's in __init__. - Remove all instance methods from repo and Ubuntu, consolidating to install_stage_packages() classmethod. - Move non-class methods in Repo into Repo class so they can be easily inherited. - Remove custom _AptCache implementation. - Use a single instance of the system's apt cache, which should improve performance due to the penalty of recreating caches in numerous points. It also simplifies usage without the requirement of copying/sharing instances for what is (now) a system-wide resource. - Remove old scheme for gathering stage packages, and simply do a scan ourselves for the packages and their dependencies. Then fetch them using python-apt's fetch_binary(). - Rework apt tests. - Rework of the ROS plugins to remove their current usage of Ubuntu and replace it with install_stage_packages(). Signed-off-by: Chris Patterson <chris.patterson@canonical.com> - [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you successfully run `./runtests.sh static`? - [ ] Have you successfully run `./runtests.sh tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged refactoring removing _AptCache and consolidating repo logic into install_stage_packages(). Uses system apt cache for performance, updates tests, and migrates ROS plugins. Approved; +490/-1009 lines across 18 files.
qwen3.6-35b-a3b-mtp-q6 Merged. Replaced _AptCache with a system apt cache to improve performance. Consolidated repository methods into install_stage_packages(), removed legacy package gathering logic, and updated tests and ROS plugins.
qwen3.6-35b-a3b-mtp-q6 Merged. Replaced custom _AptCache with system apt cache for performance. Consolidated repo methods into install_stage_packages() classmethod, updated tests and ROS plugins. Dependency handling temporarily removed pending test cases.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#3086 repo: restore marked-install strategy for apt-cache snapcraft merged Merged after approval and CI. Restores the marked-install strategy for apt-cache by refactoring AptCache for safe cache handling. Fixes a primed-stage-packages parsing bug and improves stage package dependency management.
74%
#3363 repo: apt sources management refactor snapcraft merged Merged refactor of apt sources management. Migrated to AptSourcesManager, removed PackageRepository install interfaces, and updated project loader. No behavioral changes. Approved, passed CI, +0.06% coverage.
71%
#3003 repo: always use host source lists and remove those found in plugins snapcraft merged Merged after approval and CI. Central apt source merging in the Ubuntu object, removed redundant cross-release sources from catkin and colcon plugins, updated tests, and removed unused plugin references. (+39/-109 lines, 7 files)
71%