Skip to content

Sort ports in the TreeNodesModel XML (#851) - #1260

Merged
facontidavide merged 1 commit into
masterfrom
fix/model-xml-port-order
Nov 7, 2026
Merged

facontidavide merged 1 commit into
masterfrom
fix/model-xml-port-order

Conversation

@facontidavide

Copy link
Copy Markdown
Collaborator

Fixes the visible part of #851.

PortsList is an unordered_map, so writeTreeNodesModelXML() emitted ports in hash order: it can change from build to build, and Groot2 shows it as is. This restores the sorting removed in d5ea17b: input, then output, then inout ports, alphabetical within each group.

Keeping the exact declaration order of providedPorts() needs PortsList to become an ordered container, which breaks API/ABI (#870). This PR is the subset that stays compatible: one .cpp file, no header changes.

Test: BehaviorTreeFactory.ModelPortsAreSorted fails on master and passes with the fix. 596/596 tests pass locally.

🤖 Generated with Claude Code

PortsList is an unordered_map, so writeTreeNodesModelXML() emitted the
ports in hash order, which differs across builds and shows up in Groot2.
Sort them by direction (input, output, inout), then by name, as was done
before d5ea17b.

Keeping the order of providedPorts() would need to change the PortsList
type (#870), which breaks API/ABI; this is the compatible subset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@facontidavide
facontidavide force-pushed the fix/model-xml-port-order branch from 6ed3dbe to c1a7ce9 Compare October 26, 2026 06:36
@sonarqubecloud

Copy link
Copy Markdown

@facontidavide
facontidavide merged commit d475020 into master Nov 7, 2026
20 of 21 checks passed
@facontidavide
facontidavide deleted the fix/model-xml-port-order branch November 7, 2026 16:31
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