One function
_generate_launch_file in dbwls99706/ros2-engineering-skills
The author described this change as “fix(scaffolder): use matches_action(node) instead of truthy-on-anything matcher in generated lifecycle launch”. It counts as a record because the check below fails on the code as it stood at 636e8e42f and passes on 424b567b0, with nothing else changed between the two runs.
Fix saved2026-05-21
Sharing licenceApache-2.0 · LICENSE
Change size+7 −4
What the code was meant to do, written into the code itself as a docstring
Generate a basic bringup.launch.py file for the package.
The change
| 9 | 9 | from launch.substitutions import PathJoinSubstitution | |
| 10 | 10 | from launch_ros.actions import LifecycleNode | |
| 11 | 11 | from launch_ros.event_handlers import OnStateTransition | |
| 12 | - | from launch_ros.events.lifecycle import ChangeState | |
| 12 | + | from launch_ros.events.lifecycle import ChangeState, matches_action | |
| 13 | 13 | from launch_ros.substitutions import FindPackageShare | |
| 14 | 14 | import lifecycle_msgs.msg | |
| 15 | 15 | ||
| ⋯ | |||
| 26 | 26 | parameters=[config], | |
| 27 | 27 | output='screen', | |
| 28 | 28 | ) | |
| 29 | - | # Auto-configure on launch | |
| 29 | + | # Auto-configure on launch. The matcher MUST target this specific node; | |
| 30 | + | # a truthy-on-anything matcher would fire ChangeState against every | |
| 31 | + | # lifecycle node in the graph (broken in multi-node launches). | |
| 32 | + | # matches_action(node) compares by identity to this node only. | |
| 30 | 33 | configure_event = EmitEvent( | |
| 31 | 34 | event=ChangeState( | |
| 32 | - | lifecycle_node_matcher=lambda info: info, | |
| 35 | + | lifecycle_node_matcher=matches_action(node), | |
| 33 | 36 | transition_id=lifecycle_msgs.msg.Transition.TRANSITION_CONFIGURE, | |
| 34 | 37 | ) | |
| 35 | 38 | ) | |
| ⋯ | |||
| 41 | 44 | goal_state='inactive', | |
| 42 | 45 | entities=[ | |
| 43 | 46 | EmitEvent(event=ChangeState( | |
| 44 | - | lifecycle_node_matcher=lambda info: info, | |
| 47 | + | lifecycle_node_matcher=matches_action(node), | |
| 45 | 48 | transition_id=lifecycle_msgs.msg.Transition.TRANSITION_ACTIVATE, | |
| 46 | 49 | )), | |
| 47 | 50 | ], | |
The check that tells the two apart
fail→pass·tests/test_create_package.py::TestCppPackage::test_lifecycle_launch_uses_matches_action
Check file tests/test_create_package.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it636e8e42f0e398c57d5732e3deb3892086d45ae8
Broken version dated2026-04-29
Modulescripts.create_package
Units changed_generate_launch_file
Fingerprint3d03129a60b69dae
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in dbwls99706/ros2-engineering-skills
- 2026-05-21_generate_launch_file
- 2026-05-21_generate_launch_file