Skip to content

Fix mixin arg merge order for lists and scalars (fixes #40)#59

Open
PiousCrossten wants to merge 1 commit intocolcon:masterfrom
PiousCrossten:fix/reverse-list-concatenation-issue-40
Open

Fix mixin arg merge order for lists and scalars (fixes #40)#59
PiousCrossten wants to merge 1 commit intocolcon:masterfrom
PiousCrossten:fix/reverse-list-concatenation-issue-40

Conversation

@PiousCrossten
Copy link
Copy Markdown

Fixes #40

When using --mixin a b, two bugs existed due to iterative mixin
application in _update_args:

  • Lists were concatenated in reverse order (b's values appeared before
    a's) because mixin values were prepended instead of appended
  • Scalars from later mixins were silently skipped because once the
    first mixin set the value, it was no longer a default and subsequent
    mixins couldn't override it

Fix: Pre-merge all mixin args in order first, then apply once —
rather than applying each mixin iteratively to the live args.

Added 6 regression tests covering both bugs and edge cases.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 15.06%. Comparing base (ebedd27) to head (7db10f8).

Files with missing lines Patch % Lines
colcon_mixin/mixin/mixin_argument.py 0.00% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #59      +/-   ##
==========================================
- Coverage   15.30%   15.06%   -0.25%     
==========================================
  Files          11       11              
  Lines         562      571       +9     
  Branches       94       99       +5     
==========================================
  Hits           86       86              
- Misses        474      483       +9     
  Partials        2        2              

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

Providing multiple mixins concatenates lists in reverse order

3 participants