-
Notifications
You must be signed in to change notification settings - Fork 30
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 API wrapper for "Plugins" #110
Conversation
Dear Bhagwat, thank you for contributing this excellent patch, I love it, and I think it will be a good candidate to be leveraged by the downstream grafana-wtf package. May I humbly ask you to take care about code syle / formatting, and add a corresponding software test case 1? You can find relevant instructions within docs/development.md. When running Other than this, if you can afford the time, please also add an item to the list of supported features at README » Overview. Thank you in advance, and with kind regards, Footnotes
|
Absolutely thanks for calling out the
I think its a good callout, but as you have mentioned we may not have any benefit on the unit test. I have some example code which I believe we can use to add as Integ test. You can find my changes here :main...bhks:grafana-client:main#diff-dc47e20d0c4b3322afa473cbebd824e602265a21bc5b628bb4e2de5496d37a9a I wanted to first see how my first PR goes and get an opportunity to learn what is the process and how we are thinking about this. |
Codecov Report
@@ Coverage Diff @@
## main #110 +/- ##
==========================================
- Coverage 96.37% 95.88% -0.50%
==========================================
Files 24 25 +1
Lines 1490 1531 +41
==========================================
+ Hits 1436 1468 +32
- Misses 54 63 +9
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Updated the Readme, Thanks for pointing that out. |
Added to Development document to run |
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.
Thanks for bringing in those improvements. I've added two more nits.
README.md
Outdated
| API | Status | | ||
|---|---| | ||
| Admin | + | | ||
| Alerting | +- | | ||
| API | Status | | ||
|--------------------------------|---| | ||
| Admin | + | | ||
| Alerting | +- | | ||
| Alerting Notification Channels | + | | ||
| Alerting Provisioning | + | | ||
| Annotations | + | | ||
| Authentication | +- | | ||
| Dashboard | + | | ||
| Dashboard Versions | + | | ||
| Dashboard Permissions | + | | ||
| Data Source | + | | ||
| Data Source Permissions | + | | ||
| External Group Sync | + | | ||
| Folder | + | | ||
| Folder Permissions | + | | ||
| Folder/Dashboard Search | +- | | ||
| Health | + | | ||
| Organisation | + | | ||
| Other | + | | ||
| Preferences | + | | ||
| Rbac | +- | | ||
| Snapshot | + | | ||
| Teams | + | | ||
| User | + | | ||
| Alerting Provisioning | + | | ||
| Annotations | + | | ||
| Authentication | +- | | ||
| Dashboard | + | | ||
| Dashboard Versions | + | | ||
| Dashboard Permissions | + | | ||
| Data Source | + | | ||
| Data Source Permissions | + | | ||
| External Group Sync | + | | ||
| Folder | + | | ||
| Folder Permissions | + | | ||
| Folder/Dashboard Search | +- | | ||
| Health | + | | ||
| Organisation | + | | ||
| Other | + | | ||
| Plugin | + | | ||
| Preferences | + | | ||
| Rbac | +- | | ||
| Snapshot | + | | ||
| Teams | + | | ||
| User | + | |
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.
It looks like this whole block got reformatted. I know it's a pain, my editor is also playing tricks on me here. Can I ask you to edit only the spot at hand? Apologies for the nit.
Adding integration tests
At least it will run and cover the added code, that is still valuable.
Adding a trimmed variant of your example programs to the For bringing in the test framework itself, I was planning to reuse existing code from Kotori and grafana-wtf.
Thank you for your commitment, I appreciate it very much. |
Yeah let me find some time to add that test.
Based on my testing the download is pretty fast specially the Grafana Labs marketplace binaries, which are available here https://grafana.com/api/plugins with links like following:
So it might not cause issues, when we run the install tests in parallel to the other tests. |
Co-authored-by: Andreas Motl <[email protected]>
Thanks for calling out on Unit tests, it still have values and helps set the right URLs and give us an opportunity to review our code carefully. |
8b7cdc9
to
2cc6fd3
Compare
Perfect, thank you so much! |
Dear Bhagwat. Your improvements have been included into release 3.8.0. Thank you again! |
Description
While working with Grafana I found this amazing python client, I used it to explore the plugin Installation feature using python program. While Install/unInstall APIs are not explicitly called out in Grafana API document. I found it useful to have the base layer on top of which community can build examples and write their own version of how to manage plugins via APIs.
Plugin API link : https://github.com/grafana/grafana/blob/v9.4.x/pkg/api/api.go#L423
Please provide feedback for improvement needed and I should be able to incorporate.
Checklist