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_rule_group method #108

Merged
merged 2 commits into from
Sep 7, 2023
Merged

Conversation

beeradb
Copy link
Collaborator

@beeradb beeradb commented Sep 7, 2023

Description

This PR adds a get_rule_group method to the AlertProvisioning API, which uses the /v1/provisioning/folder/%s/rule-groups/%s endpoint.

It also renames update_rule_group_interval to update_rule_group for consistency while maintaining the previous method for backward compatibility. I'm happy to revert this change if you'd rather avoid it.

I also attempted to add tests to this. However, I'm unfamiliar with your mocking library and am unsure where to register the API path, and thus got a requests_mock.exceptions.NoMockAddress exception. If this change requires test coverage, I'd be happy to try and add it, but I'd need to be pointed in the right direction.

@beeradb beeradb requested a review from amotl as a code owner September 7, 2023 20:41
@codecov
Copy link

codecov bot commented Sep 7, 2023

Codecov Report

Merging #108 (a8630e6) into main (ddb51f1) will decrease coverage by 0.27%.
The diff coverage is 42.85%.

@@            Coverage Diff             @@
##             main     #108      +/-   ##
==========================================
- Coverage   97.61%   97.34%   -0.27%     
==========================================
  Files          24       24              
  Lines        1465     1471       +6     
==========================================
+ Hits         1430     1432       +2     
- Misses         35       39       +4     
Files Changed Coverage Δ
grafana_client/elements/alertingprovisioning.py 56.97% <42.85%> (-1.78%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

📢 Have feedback on the report? Share it here.

@amotl
Copy link
Contributor

amotl commented Sep 7, 2023

Thank you very much.

@amotl amotl merged commit 5afaaa6 into grafana-toolbox:main Sep 7, 2023
6 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.

2 participants