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

add Get command to Kanx #3313

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aaron-kasten
Copy link
Contributor

Change Overview

Add GetProcess to kanx client/server. GetProcess allows retrieval of a single process by PID, instead of only being able to retrieve process information in lists. Implementing this protocol allows for simplifying some code as well as decoupling process summary information provided by ListProcesses and process detail information provided by GetProcess.

This PR also includes some trivial changes for clarity.

Pull request type

Please check the type of change your PR introduces:

  • 🌻 Feature

Issues

This is not related to a Github issue.

Test Plan

Unit test included, plus existing unit tests have been converted from ListProcesses to GetProcess

  • ⚡ Unit test

@aaron-kasten aaron-kasten requested a review from tdmanv January 7, 2025 22:21
Signed-off-by: Aaron Alpar <[email protected]>
Copy link
Contributor

@tdmanv tdmanv left a comment

Choose a reason for hiding this comment

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

Overall looks good, thank you

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.12.4
// - protoc-gen-go-grpc v1.5.1
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for upgrading this.

rpc ListProcesses (ListProcessesRequest) returns (stream Process) {}
rpc Stdout (ProcessOutputRequest) returns (stream Output) {}
rpc Stderr (ProcessOutputRequest) returns (stream Output) {}
rpc Stdout (ProcessPidRequest) returns (stream Output) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please clarify this Change?

Copy link
Contributor Author

@aaron-kasten aaron-kasten Jan 7, 2025

Choose a reason for hiding this comment

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

@tdmanv Ah. There are RPC requests in the protocol that take only one argument, the PID. I've simplified these RPC requests by consolidating the Process*Request to ProcessPidRequest

It leads to a smaller kanx.proto file, and personally, I think its clearer.

Footnote: it doesn't look like GRPC uses the *Request structure to qualify the call.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I understand, thanks

rpc ListProcesses (ListProcessesRequest) returns (stream Process) {}
rpc Stdout (ProcessOutputRequest) returns (stream Output) {}
rpc Stderr (ProcessOutputRequest) returns (stream Output) {}
rpc Stdout (ProcessPidRequest) returns (stream Output) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I understand, thanks

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