rock-core / tools-roby

The roby plan manager
Other
3 stars 11 forks source link

fix: add example to task arguments and inject these examples in syskit_deploy_in_bulk #295

Closed jhonasiv closed 3 weeks ago

jhonasiv commented 4 weeks ago

This fixes a bug in the test harness where syskit would be unable to deploy multiple actions together when:

The issue appeared as a failed merge attempt complaining that a Variable doesnt have the strong? method image

By looking further into it, we realized that this happened because when the toplevel task shares used definitions with the sub task, they would have delayed variable references instead of the example arguments (since we dont resolve the example arguments ourselves). That way, syskit was basically trying to merge "some defined value" and "var:variable_name", which should not be possible.

The fix to that comes in two parts:

  1. Adding the strong? and can_merge? methods to variables in a way that cannot be merged
  2. Adding example for task arguments and propagating it in syskit_deploy_in_bulk. This way if the task arguments have an example they would take precedence over the variable.
jhonasiv commented 4 weeks ago

Reading actions.rb in order to review this, I don't understand why #missing_required_arguments treat any delayed argument as a required one, even (it seems) when the arg is a optional one

I added a comment in action.rb that explains exactly when this happens