Skip to content

Add service client support in generated README - #65

Merged
sdamaschke merged 2 commits into
openads-project:mainfrom
Mahran1998:feature/service-client-readme
Sep 28, 2026
Merged

sdamaschke merged 2 commits into
openads-project:mainfrom
Mahran1998:feature/service-client-readme

Conversation

@Mahran1998

@Mahran1998 Mahran1998 commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Implements the create_client handling discussed in #47.

Following the maintainer's clarification in that issue, this PR covers
direct ROS service clients only. The library-mediated case, which would
require tracing through shared libraries, is left out as agreed there.

What changed

  • extract_service_clients() for C++ nodes, alongside the existing
    extract_service_servers()
  • A create_client branch in the Python AST extraction
  • service_clients added to NodeInterfaces and NodeTemplateContext,
    and wired through build_node_context() and main()
  • A Service Clients table and a Mermaid edge in
    package_readme.md.j2
  • The diagram guard now includes service_clients, so a node exposing
    only clients still renders a diagram

Service clients are rendered on the right side of the node, while service servers remain on the left, making the two interface kinds visually distinct.

Scope

The current C++ pattern matches direct create_client<Srv>("name")
calls; rclcpp_action::create_client(...) is not matched by this
pattern, and there is a test covering that boundary.

Testing

  • Five new tests in tests/test_generate_readme.py covering C++
    extraction, the action-client boundary, Python extraction,
    propagation into the template context, and diagram rendering for a
    client-only node
  • Verified end to end against simple_planner, which has three direct
    service clients: the generated README gains the three diagram edges
    and the table, with no other changes, and re-running the generator
    produces no further diff

Extract direct rclcpp and rclpy service clients and render them in the
package README tables and node Mermaid diagrams, alongside the existing
service server handling.

The diagram guard now includes service clients so that a node exposing
only service clients still renders a diagram.

Refs openads-project#47
@lreiher
lreiher requested a review from sdamaschke September 14, 2026 09:32
@lreiher
lreiher requested review from sdamaschke and removed request for sdamaschke September 23, 2026 22:19

@sdamaschke sdamaschke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In general, looks good and ready to merge once clients and servers can be differentiated.

Comment thread scripts/templates/package_readme.md.j2 Resolved
Comment thread tests/test_generate_readme.py Resolved
@Mahran1998
Mahran1998 marked this pull request as ready for review September 24, 2026 22:13
@sdamaschke
sdamaschke merged commit 01b3ef9 into openads-project:main Sep 28, 2026
1 check passed
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.

2 participants