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

chore: local development improvements #102

Merged
merged 16 commits into from
Oct 31, 2024
Merged

Conversation

aduane
Copy link
Collaborator

@aduane aduane commented Sep 26, 2024

This PR makes several changes with the goal of improving the plugin development workflow. (Development of plugins, not development of the SDK or the plugin runner)

Changes:

  1. Starting the plugin runner without PLUGIN_RUNNER_SIGNING_KEY being set emits a warning with instructions on how to eliminate the message instead of raising an exception. (7ef6fb7)
  2. Event fixtures are now shipped with the CLI, and can be referenced by the event name. We still offer the ability for users to provide their own event fixture file. We first look for a matching path, if we can't find one we assume the CLI parameter is the name of an event and attempt to look for a Canvas-provided event fixture instead. If nothing can be found, an error message is shown instead of an exception.
  3. If the emit CLI command can't connect to a running plugin runner process, an error message is shown instead of an exception.
  4. Running the plugin runner from the CLI. (Start the plugin runner in one terminal, emit to it from another)

Still working on:

1. Making data accessible without access to a Canvas EMR database. (Substitute a sqlite database seeded with data and provide a way to add/modify the data) Out of scope, will work on this in a separate PR.

@aduane aduane self-assigned this Sep 26, 2024
@aduane aduane marked this pull request as ready for review September 28, 2024 00:33
@aduane aduane requested a review from a team as a code owner September 28, 2024 00:33
@aduane aduane requested a review from jamagalhaes October 16, 2024 17:01
@csande
Copy link
Contributor

csande commented Oct 16, 2024

Idea for consideration:

Rather than making developers start the plugin runner and then emit to it, what if you combine those into a single subcommand called "test_plugin"? This command would start the plugin runner in a subprocess, emit the event, and then stop the plugin runner.

I could see the iteration cycle where you have to start, emit, stop, edit, and repeat being mildly annoying (and maybe requiring multiple terminal windows), whereas if you combined start, emit, and stop into a single subcommand, your iteration cycle would just be test, change, and repeat.

@jamagalhaes jamagalhaes force-pushed the ad/local-development-tools branch from 9653cd0 to bf26792 Compare October 21, 2024 15:06
@jamagalhaes jamagalhaes changed the title Local development improvements chore: local development improvements Oct 21, 2024
pyproject.toml Show resolved Hide resolved
@aduane
Copy link
Collaborator Author

aduane commented Oct 23, 2024

Idea for consideration:

Rather than making developers start the plugin runner and then emit to it, what if you combine those into a single subcommand called "test_plugin"? This command would start the plugin runner in a subprocess, emit the event, and then stop the plugin runner.

I could see the iteration cycle where you have to start, emit, stop, edit, and repeat being mildly annoying (and maybe requiring multiple terminal windows), whereas if you combined start, emit, and stop into a single subcommand, your iteration cycle would just be test, change, and repeat.

I would like to improve the constant start, emit, stop, edit, and repeat by (at some future date) using something like https://github.com/gorakhargosh/watchdog to watch the directories of the plugins for changes and reloading them as a result.

I also would like to keep in mind iteration workflows that depend on multiple events firing in a sequence.

@aduane aduane force-pushed the ad/local-development-tools branch from 80a0aa4 to 4e3f59a Compare October 31, 2024 06:06
@aduane aduane requested review from nmpsilva and csande October 31, 2024 17:00
plugin_runner/plugin_runner.py Show resolved Hide resolved
@aduane aduane merged commit ca4458e into main Oct 31, 2024
4 checks passed
@aduane aduane deleted the ad/local-development-tools branch October 31, 2024 17:24
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.

4 participants