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 the plugin runner process #7

Merged
merged 3 commits into from
Feb 21, 2024
Merged

Add the plugin runner process #7

merged 3 commits into from
Feb 21, 2024

Conversation

aduane
Copy link
Collaborator

@aduane aduane commented Feb 20, 2024

Satisfies Jira tickets:

  1. https://canvasmedical.atlassian.net/browse/KOALA-1035
  2. https://canvasmedical.atlassian.net/browse/KOALA-1036

This PR adds a python program that implements the gRPC service PluginRunner and its handle_event method.

This also adds some initial protobufs that represent the Event, EventResponse, and Effect types.

This also adds an enum of events. I added a bunch to the enum up front based on the workflow_sdk CHANGE_TYPEs, and made them more descriptive about create vs update vs other special cases. Just because the event is listed in that enum doesn't mean home-app will ever emit it. This just claims the event name for potential future use.

@aduane aduane self-assigned this Feb 20, 2024
@@ -0,0 +1,4 @@
#! /bin/sh

# poetry run python -m grpc_tools.protoc -I=protobufs/ --python_out=plugin_runner/ --pyi_out=plugin_runner/ --grpc_python_out=plugin_runner/ protobufs/**/*.proto
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When I run the poetry run ... version, I get a complaint about python versions. I thought that was like the whole point of poetry?

To run this script, you'll have to poetry shell first.

Comment on lines 7 to 10
string payload = 2;
//Oneof effect_payload {
// ...
//}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Keeping it simple for now. We will gradually introduce more specific payload attributes based on the effect type.

Comment on lines 79 to 82
// Oneof target = 2 {
//
// }
string target = 2;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Keeping it simple for now, will gradually add more specific target types based on the event type.

@aduane
Copy link
Collaborator Author

aduane commented Feb 20, 2024

Postman continues to be cool as shit. Here's me sending the plugin runner a "TASK_CLOSED" event and getting a response!

Screenshot 2024-02-19 at 8 41 42 PM

@aduane aduane requested a review from jrwils February 20, 2024 05:18
enum EventType {
UNKNOWN = 0;

// Workflow kit-inspired events
Copy link
Collaborator

Choose a reason for hiding this comment

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

just a thought - do we want to look at all the events canvas-core too? i think it has more than the workflow kit

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah definitely. Is there a list somewhere?

@aduane aduane force-pushed the ad/add-plugin-runner-process branch from 1685a1e to c56f5fb Compare February 21, 2024 22:31
@aduane aduane merged commit 56ac4f5 into main Feb 21, 2024
2 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.

3 participants