Skip to content

apt_dpkg: refactorings for contents cache#594

Open
bdrung wants to merge 3 commits into
canonical:mainfrom
bdrung:contents-mapping-refactor
Open

apt_dpkg: refactorings for contents cache#594
bdrung wants to merge 3 commits into
canonical:mainfrom
bdrung:contents-mapping-refactor

Conversation

@bdrung

@bdrung bdrung commented Apr 22, 2026

Copy link
Copy Markdown
Member

These refactorings are preparation for following commits:

  • apt_dpkg: use pathlib.Path for mapping_file
  • apt_dpkg: call _contents_mapping() outside of pocket loop
  • apt_dpkg: move saving contents cache to _get_file2pkg_mapping

@codecov

codecov Bot commented Apr 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.46%. Comparing base (d9d3c9f) to head (3b96cff).

Files with missing lines Patch % Lines
apport/packaging_impl/apt_dpkg.py 87.50% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #594      +/-   ##
==========================================
- Coverage   84.47%   84.46%   -0.01%     
==========================================
  Files         106      106              
  Lines       21053    21052       -1     
  Branches     3223     3221       -2     
==========================================
- Hits        17784    17782       -2     
- Misses       2792     2793       +1     
  Partials      477      477              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bdrung
bdrung force-pushed the contents-mapping-refactor branch 2 times, most recently from 5aa2db4 to 9afa6b2 Compare July 2, 2026 19:46
bdrung added 3 commits July 2, 2026 21:46
Modernize the code by using `pathlib.Path` for `mapping_file`.
`_contents_mapping()` loads the cached content mapping. Calling it
multiple times in `_get_file2pkg_mapping` is not needed.

Call `_contents_mapping()` before looping over the different pockets of
the release.
Move saving the changed contents cache into `_get_file2pkg_mapping`
where this contents cache is updated. This improves code locality.
@bdrung
bdrung force-pushed the contents-mapping-refactor branch from 9afa6b2 to 3b96cff Compare July 2, 2026 19:47
@bdrung
bdrung requested a review from Hyask July 3, 2026 15:10
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.

1 participant