Skip to content

Fix #931:add 'actions' key support for YAML,keeping the existing 'children' key as a fallback#971

Open
SanjayS66 wants to merge 1 commit into
ros2:rollingfrom
SanjayS66:fix931-yaml-actions-support
Open

Fix #931:add 'actions' key support for YAML,keeping the existing 'children' key as a fallback#971
SanjayS66 wants to merge 1 commit into
ros2:rollingfrom
SanjayS66:fix931-yaml-actions-support

Conversation

@SanjayS66
Copy link
Copy Markdown

Description

This PR adds support for YAML to accept 'actions' key to match the Python API, while continuing to have 'children' as a fallback to not break the existing usage.The ValueError message in the parser has also been updated to reflect both 'actions' and 'children' as valid keys

Fixes #931

Is this user-facing behavior change?

yes. User can now use 'actions' to define nested entities.Existing files using 'children' will continue to work as that children is added as fallback.Error message also has been updated to reflect support for both actions and children keys.

Did you use Generative AI?

No

Additional Information

…'children' key as a fallback

Signed-off-by: SanjayS66 <sanjay702594@gmail.com>
@SanjayS66 SanjayS66 force-pushed the fix931-yaml-actions-support branch from 1ab5606 to 4853baa Compare April 28, 2026 21:24
@christophebedard christophebedard self-assigned this May 14, 2026
Copy link
Copy Markdown
Contributor

@emersonknapp emersonknapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concerned that this is global, but children may not always == actions. It is equivalent for <group> but are there other cases where XML frontend uses children but the Python API doesn't call them actions?

Copy link
Copy Markdown
Contributor

@emersonknapp emersonknapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I did an investigation on this and found that children is used in

  • GroupAction: kwargs['actions'] = children
  • (launch_ros) TimerAction: kwargs['actions'] = children
  • ForEach: Python API is function=, children parsed into a closure
  • ForLoop: same

In all these contexts, the relevant children are indeed Actions. I believe that it would be semantically nonsensical for an action to provide an interface that exposes actions as a YAML input and also calls entity.children. In any case, the assert_entity_completely_parsed would catch that one of the two was never read.

This seems good to me, thanks for the contribution.

@emersonknapp
Copy link
Copy Markdown
Contributor

emersonknapp commented May 22, 2026

Pulls: #971
Gist: https://gist.githubusercontent.com/emersonknapp/666309cbd8f330c8c42d41f80688f0c4/raw/82dfd66aafdaa47c3af6dbbb76aa6e7b5f85bbbd/ros2.repos
BUILD args: --packages-above-and-dependencies launch_yaml
TEST args: --packages-above launch_yaml
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/19356

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

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.

YAML: group should also accept a key actions: like the Python API

3 participants