-
Notifications
You must be signed in to change notification settings - Fork 57
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
Rework standalone API #703
Conversation
I tried this PR and was not able to run a plugin with vscode debugger. I have also set the variable There is no error in the plugin logs though: with this changes:
This is using main:
Is there something that I am missing? |
Should be okay now @andresmgot - thanks for checking. Had fudged the paths a bit, but should be okay now |
What kind of tests do you have in mind, manual or unit/integration tests? Trying to understand why this is needed, sorry if I'm stupid/tired 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW it works fine for me now
No longer relevant for now @marefr. This PR is just a refactoring. Let me know if it makes things clearer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work 🙏!! Love this. I took it for a spin and it works perfectly.
I only have left a couple of optional nits in case you want to address them.
We also have to update the docs for "other ide" section:
https://grafana.com/docs/grafana/latest/developers/plugins/development-with-local-grafana/#other-ides
because the -debug
flag is technically not required anymore.
🎉
What this PR does / why we need it:
This PR attempts to simplify how the standalone package works by refactor into a client/server pattern. I found it quite difficult to navigate as we historically have combined both standalone and locator functionality in the same code path, which makes it tricky to know what information is needed and where.
Compatibility changes:
Special notes for your reviewer:
-debug
flag as standalone/server mode will now always generate astandalone.txt
andpid.txt
.GF_PLUGIN_GRPC_ADDRESS_<PLUGIN_ID>
is an existing env var, but now both client and server will use this as the primary source of truth for creating or connecting to the standalone server. The pre-existing generation of the address and reading from file still exists, but are treated as fallbacks in their respective modes.