Skip to content

cdt: fix adding host: section, improve deduplication and handling empty lines#5835

Merged
beckermr merged 3 commits intoregro:mainfrom
mgorny:cdt-improvements
Mar 19, 2026
Merged

cdt: fix adding host: section, improve deduplication and handling empty lines#5835
beckermr merged 3 commits intoregro:mainfrom
mgorny:cdt-improvements

Conversation

@mgorny
Copy link
Copy Markdown
Contributor

@mgorny mgorny commented Mar 19, 2026

Description:

Three fixes for the CDT migrator:

  • Fix "dictionary size changed" error when adding host: section to a recipe without one. Add a minimal test case (there is no real recipe like that).
  • Improve deduplication to account for packages already in requirements (previously it only deduplicated against the same CDT replacements).
  • Append new packages to host: section prior to any trailing empty lines.

Checklist:

  • Pydantic model updated or no update needed

Cross-refs, links to issues, etc:

mgorny added 3 commits March 19, 2026 15:38
Fix adding duplicate dependencies for replaced CDTs when the relevant
package is already present in requirements.  It's not a big deal, but
can be avoided reasonably easily.

Signed-off-by: Michał Górny <mgorny@quansight.com>
Detect empty lines at the end of `host:` subsection (which can be used
to separate it from the following subsection), and insert new
dependencies before them.  This also permits us to remove
special-handling empty lines at the end of requirement sections.

Signed-off-by: Michał Górny <mgorny@quansight.com>
Signed-off-by: Michał Górny <mgorny@quansight.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.57%. Comparing base (6a7b9f0) to head (14780d0).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5835      +/-   ##
==========================================
+ Coverage   80.54%   80.57%   +0.02%     
==========================================
  Files         146      146              
  Lines       17348    17358      +10     
==========================================
+ Hits        13973    13986      +13     
+ Misses       3375     3372       -3     

☔ View full report in Codecov by Sentry.
📢 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.

@beckermr beckermr merged commit d542202 into regro:main Mar 19, 2026
12 checks passed
@mgorny mgorny deleted the cdt-improvements branch March 19, 2026 15:43
@mgorny
Copy link
Copy Markdown
Contributor Author

mgorny commented Mar 19, 2026

Thanks!

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.

2 participants