Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#98] add iox2 nodes cli #380

Merged
merged 4 commits into from
Sep 20, 2024

Conversation

orecham
Copy link
Contributor

@orecham orecham commented Sep 15, 2024

Notes for Reviewer

  1. enables commands iox2 nodes list and iox2 nodes details
    1. node ids are represented as hex rather than separate elements (pid, timestamps, counter)
    2. to retrieve node details, node id (as hex), node name, or pid can be provided
      1. if there are multiple nodes matching, all nodes should be provided
    3. output can be filtered by node state (Alive, Dead, etc.)
    4. functionality for outputting in multiple formats has been inherited (RON, JSON, YAML)
  2. cleanliness tweaks across all cli
    1. made implementations consistent
    2. reused output structs across clis

Usage:

iox2-nodes
$ iox2-nodes --help
Query information about iceoryx2 nodes

Usage: iox2-nodes [OPTIONS] [COMMAND]

Options:
  -f, --format <FORMAT>  [default: RON] [possible values: RON, JSON, YAML]
  -h, --help             Print help
  -V, --version          Print version

Commands:
  list     List all existing nodes
  details  Show details of an existing node
iox2-nodes list
$ iox2-nodes list --help
List all existing nodes

Usage: iox2-nodes list [OPTIONS]

Options:
  -s, --state <STATE>    [default: All] [possible values: Alive, Dead, Inaccessible, Undefined, All]
  -f, --format <FORMAT>  [default: RON] [possible values: RON, JSON, YAML]
  -h, --help             Print help
$ iox2-nodes list 
(
    num: 1,
    details: [
        (
            state: Alive,
            id: ("00000000059fd39166e761ac0003d3e7"),
            pid: 250855,
            executable: Some("publish_subscribe_subscriber"),
            name: Some(""),
        ),
    ],
)
iox2-nodes details
$ iox2-nodes details --help
Show details of an existing node

Usage: iox2-nodes details [OPTIONS] <NODE>

Arguments:
  <NODE>  Name, ID or PID

Options:
  -s, --state <STATE>    [default: All] [possible values: Alive, Dead, Inaccessible, Undefined, All]
  -f, --format <FORMAT>  [default: RON] [possible values: RON, JSON, YAML]
  -h, --help             Print help
$ iox2-nodes details 250855
{
    "state": Alive,
    "id": ("00000000059fd39166e761ac0003d3e7"),
    "pid": 250855,
    "executable": "publish_subscribe_subscriber",
    "name": "",
    "config": (
        global: (
            r#root-path-unix: "/tmp/iceoryx2/",
            r#root-path-windows: "c:\\Temp\\iceoryx2\\",
            prefix: "iox2_",
            service: (
                directory: "services",
                r#publisher-data-segment-suffix: ".publisher_data",
                r#static-config-storage-suffix: ".service",
                r#dynamic-config-storage-suffix: ".dynamic",
                r#creation-timeout: (
                    secs: 0,
                    nanos: 500000000,
                ),
                r#connection-suffix: ".connection",
                r#event-connection-suffix: ".event",
            ),
            node: (
                directory: "nodes",
                r#monitor-suffix: ".node_monitor",
                r#static-config-suffix: ".details",
                r#service-tag-suffix: ".service_tag",
                r#cleanup-dead-nodes-on-creation: true,
                r#cleanup-dead-nodes-on-destruction: true,
            ),
        ),
        defaults: (
            r#publish-subscribe: (
                r#max-subscribers: 8,
                r#max-publishers: 2,
                r#max-nodes: 20,
                r#subscriber-max-buffer-size: 2,
                r#subscriber-max-borrowed-samples: 2,
                r#publisher-max-loaned-samples: 2,
                r#publisher-history-size: 1,
                r#enable-safe-overflow: true,
                r#unable-to-deliver-strategy: "Block",
                r#subscriber-expired-connection-buffer: 128,
            ),
            event: (
                r#max-listeners: 2,
                r#max-notifiers: 16,
                r#max-nodes: 36,
                r#event-id-max-value: 32,
            ),
        ),
    ),
}

Pre-Review Checklist for the PR Author

  1. Add sensible notes for the reviewer
  2. PR title is short, expressive and meaningful
  3. Relevant issues are linked in the References section
  4. Every source code file has a copyright header with SPDX-License-Identifier: Apache-2.0 OR MIT
  5. Branch follows the naming format (iox2-123-introduce-posix-ipc-example)
  6. Commits messages are according to this guideline
  7. Tests follow the best practice for testing
  8. Changelog updated in the unreleased section including API breaking changes
  9. Assign PR to reviewer
  10. All checks have passed (except task-list-completed)

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Unit tests have been written for new behavior
  • Public API is documented
  • PR title describes the changes

Post-review Checklist for the PR Author

  1. All open points are addressed and tracked via issues

References

Relates #98

Copy link

codecov bot commented Sep 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.45%. Comparing base (a9df608) to head (37ee56c).
Report is 18 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #380      +/-   ##
==========================================
- Coverage   79.49%   79.45%   -0.04%     
==========================================
  Files         193      193              
  Lines       22716    22716              
==========================================
- Hits        18058    18050       -8     
- Misses       4658     4666       +8     

see 4 files with indirect coverage changes

@orecham
Copy link
Contributor Author

orecham commented Sep 15, 2024

Release notes added here: 1512f6f

@elfenpiff elfenpiff self-requested a review September 19, 2024 07:53
@orecham orecham changed the title [BASED ON #371] [#98] add nodes command add nodes command Sep 19, 2024
@orecham orecham changed the title add nodes command add iox2 nodes cli Sep 19, 2024
@orecham orecham changed the title add iox2 nodes cli [#98] add iox2 nodes cli Sep 19, 2024
@orecham orecham merged commit 0d14d50 into eclipse-iceoryx:main Sep 20, 2024
56 of 57 checks 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