Skip to content

refactor(actions): standardize action tools, add integration tests (step5)#321

Open
stex2005 wants to merge 2 commits intofeature/step4from
feature/step5
Open

refactor(actions): standardize action tools, add integration tests (step5)#321
stex2005 wants to merge 2 commits intofeature/step4from
feature/step5

Conversation

@stex2005
Copy link
Copy Markdown
Collaborator

@stex2005 stex2005 commented Apr 7, 2026

Summary

Step 5 of 7 — targets feature/step4 (#316)

  • Migrate 21 hardcoded /rosapi/ strings in actions.py to rosapi_service()/rosapi_type()
  • Refactor action tools to match nodes/topics/services pattern (_check_response/_safe_get_values)
  • Remove redundant service-availability pre-flights, hardcoded action_type_map, triplicated typedef parsing
  • Add turtle_actionlib to ROS 1 Docker images for action server testing
  • Integration tests for get_actions, get_action_details, get_action_status across all distros

Changes

  • ros_mcp/tools/actions.py — refactor + migrate (+188 -477):
    • Extract _parse_typedef() and _fetch_action_part() helpers
    • get_actions: use _check_response/_safe_get_values directly
    • get_action_details: require explicit action_type, return available types when missing
    • send_action_goal: remove asyncio.sleep that caused missed results
    • Remove unused asyncio import
  • tests/integration/test_actions.py — 7 tests:
    • get_actions: returns actions, includes expected action (distro-aware)
    • get_action_details: structure on ROS 2, empty/nonexistent errors
    • get_action_status: status on ROS 2, empty error
  • Dockerfile.ros1-melodic/noetic — add turtle-actionlib package
  • ros1_launch.launch — add /turtle_shape action server node

Testing

68 tests pass on humble/jazzy, 66 pass + 2 skipped on melodic/noetic. Skips: action detail inspection and status require ROS 2 rosbridge features (see #320).

Related issues

PR stack

Step PR Status
Step 0: detection + Docker infra #276 merged
Step 1: connection + robot config #278 merged
Step 2: nodes #280 open
Step 3: topics #281 open
Step 4: services #316 merged
Step 5: actions this PR open
Step 6: parameters (not created)
Step 7: resources (not created)

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