fix(xtce_parser): crash on BaseContainer inside CommandContainer#3377
Merged
jmthomas merged 1 commit intoMay 14, 2026
Merged
Conversation
…nd packets When a CommandContainer uses BaseContainer to reference a TM SequenceContainer (e.g., CCSDS_Header), xtce_handle_base_container clones TM items into the command packet. These cloned items have range=nil and default=nil because set_min_max_default skips non-COMMAND items during TM processing. This causes a NoMethodError on range.first in calculate_range when to_config(:COMMAND) is called. Add set_item_range_and_default to populate range and default on cloned items based on their bit_size and data_type when the target packet is a command. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3377 +/- ##
==========================================
+ Coverage 78.76% 78.80% +0.04%
==========================================
Files 687 687
Lines 57263 57282 +19
Branches 728 728
==========================================
+ Hits 45103 45142 +39
+ Misses 12082 12062 -20
Partials 78 78
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
|
@jwalters2 thanks for the fix! |
jmthomas
approved these changes
May 14, 2026
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.



Summary
xtce_handle_base_containerclones TMSequenceContaineritems into a command packet without settingrangeordefault. These fields arenilbecauseset_min_max_defaultskips non-COMMAND items during TM processing. Later,to_config(:COMMAND)→calculate_range()callsrange.firstonnil, raisingNoMethodError.set_item_range_and_defaultto populaterangeanddefaulton cloned items based on theirbit_sizeanddata_typewhen the target packet is a command.BaseContainer containerRef="..."inside aCommandContainer(standard XTCE v1.3 pattern for CCSDS header inheritance in telecommands).Reproduction
Minimal XTCE with an abstract
SequenceContainer(CCSDS_Header) referenced viaBaseContainerfrom aCommandContainer:Test plan
xtce_parser_spec.rbcovering:range,default,bit_size,data_typein command packetRestrictionCriteriaComparisons correctly setid_valueon inherited itemsto_config(:COMMAND)does not crash🤖 Generated with Claude Code