Skip to content

Add DynamicGroup support to goby_clang_tool viz#360

Draft
Copilot wants to merge 2 commits into3.0from
copilot/add-dynamic-groups-visualization
Draft

Add DynamicGroup support to goby_clang_tool viz#360
Copilot wants to merge 2 commits into3.0from
copilot/add-dynamic-groups-visualization

Conversation

Copy link
Contributor

Copilot AI commented Mar 16, 2026

goby_clang_tool -gen only matched static publish/subscribe calls (compile-time constexpr Group template args), silently ignoring publish_dynamic/subscribe_dynamic calls that use DynamicGroup. This meant any application using runtime groups was invisible in the generated diagrams.

Changes

generate.cpp — new pubsub_dynamic_matcher()

  • Adds a Clang AST matcher for publish_dynamic<Data, scheme>(data, DynamicGroup("str")) and subscribe_dynamic<Data, scheme>(cb, DynamicGroup("str"))
  • Extracts group name when statically determinable: inline DynamicGroup("literal") and variables initialized from one; silently skips truly runtime-computed groups
  • Note: template arg layout differs from static variants — [0]=Data, [1]=scheme vs [0]=group, [1]=Data, [2]=scheme
  • Registers matchers alongside existing static ones; is_dynamic set via exact method name check
// Previously invisible to the tool; now captured:
interprocess().publish_dynamic<NavMsg>(data, goby::middleware::DynamicGroup("navigation"));

DynamicGroup stored_group("status");
interthread().subscribe_dynamic<StatusMsg>(cb, stored_group);

pubsub_entry.his_dynamic field

  • Adds bool is_dynamic{false} to PubSubEntry
  • Round-trips through YAML (is_dynamic: true emitted/parsed only when set)
  • Constructor extended with bool dynamic = false default arg (ABI-safe for existing callers)

visualize.cpp — visual distinction

  • dynamic_style = "dashed" for dynamic group edges (complements existing solid/bold/tapered/dotted)
  • connection_with_label_final() applies dashed style and appends [dynamic] to the hover tooltip when is_dynamic is set
  • is_dynamic propagated through connection_with_label(), disconnected_publication(), and disconnected_subscription() via the PubSubEntry objects — no signature changes to call sites
Original prompt

This section details on the original issue you should resolve

<issue_title>Add dynamic groups to goby_clang_tool viz</issue_title>
<issue_description>As much as possible, it would be great to support DynamicGroups in the visualization tool.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: tsaubergine <732276+tsaubergine@users.noreply.github.com>
Copilot AI changed the title [WIP] Add dynamic groups to goby_clang_tool viz Add DynamicGroup support to goby_clang_tool viz Mar 16, 2026
Copilot AI requested a review from tsaubergine March 16, 2026 05:56
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.

Add dynamic groups to goby_clang_tool viz

2 participants