-
Notifications
You must be signed in to change notification settings - Fork 79
adding monitors in region endpoint #587
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
base: dev
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds monitoring capabilities to the regions endpoint and enhances dashboard widgets with filtering and grouping functionality. It introduces monitor services information for regions and extends dashboard widget properties to support more advanced query capabilities.
- Adds
monitors
field to regions showing which monitoring services are available (alerts and metrics) - Adds
group_by
andfilters
fields to dashboard widgets for more granular data querying - Includes alert configuration properties for monitor services
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
linode_api4/objects/region.py | Adds RegionMonitors class and monitors property to Region class |
linode_api4/objects/monitor.py | Adds Filter and ServiceAlert classes, updates DashboardWidget with group_by and filters |
test/fixtures/*.json | Updates test fixtures with new monitor and widget properties |
test/unit/objects/*_test.py | Adds test coverage for new monitor and region functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
"service_type": Property(ServiceType), | ||
"type": Property(DashboardType), | ||
"widgets": Property(List[DashboardWidget]), | ||
"widgets": Property(json_object=DashboardWidget), |
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.
The widgets property should be a list of DashboardWidget objects, but the current implementation will only handle a single widget. This should be Property(List[DashboardWidget])
to maintain the original list functionality.
Copilot uses AI. Check for mistakes.
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.
Since the codebase handles all lists in this way, its specified like this and client can handle widget as list.
Overall looks good, can you fix the build issue please? |
a47705b
to
487bce6
Compare
I'm already using the default_factory for filters field in dashboard, I still see this in build logs. Can you suggest how can this be resolved? |
📝 Description
✔️ How to Test
How do I run the relevant unit/integration tests?
unit-test: make test-unit TEST_SUITE=monitor
integration tests: make testint TEST_SUITE=monitor