-
Notifications
You must be signed in to change notification settings - Fork 164
feat(BA-3170): Add ScalingGroup layer service logic, and implement pagination support
#6985
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: main
Are you sure you want to change the base?
Conversation
ScalingGroup layer service logic, and implement pagination support
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 implements a new ScalingGroup service layer with repository pattern and pagination support, following the established architecture patterns in the codebase. The implementation adds search functionality for scaling groups with comprehensive test coverage at both the service and repository layers.
Key Changes
- Implements a three-layer architecture (service, repository, db_source) for scaling group operations
- Adds pagination support using the
Querierinfrastructure withOffsetPagination - Integrates the new repository into the main
Repositoriesclass with proper resilience policies
Reviewed changes
Copilot reviewed 18 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/ai/backend/manager/data/scaling_group/types.py | Adds ScalingGroupListResult type for paginated search results |
| src/ai/backend/manager/models/scaling_group.py | Adds to_dataclass() method to convert database rows to domain models |
| src/ai/backend/manager/repositories/scaling_group/db_source/db_source.py | Implements database operations for scaling group queries with pagination |
| src/ai/backend/manager/repositories/scaling_group/db_source/init.py | Exports ScalingGroupDBSource |
| src/ai/backend/manager/repositories/scaling_group/repository.py | Implements repository layer with resilience policies |
| src/ai/backend/manager/repositories/scaling_group/repositories.py | Factory class for creating scaling group repositories |
| src/ai/backend/manager/repositories/scaling_group/init.py | Exports ScalingGroupRepository |
| src/ai/backend/manager/repositories/repositories.py | Integrates scaling group repositories into main repository collection |
| src/ai/backend/manager/services/scaling_group/actions/base.py | Defines base action class for scaling group operations |
| src/ai/backend/manager/services/scaling_group/actions/list_scaling_groups.py | Implements search action and result types |
| src/ai/backend/manager/services/scaling_group/service.py | Implements service layer orchestrating repository operations |
| src/ai/backend/manager/services/scaling_group/processors.py | Implements action processors for scaling group operations |
| src/ai/backend/common/metrics/metric.py | Adds SCALING_GROUP_REPOSITORY layer type for metrics |
| tests/manager/repositories/scaling_group/test_scaling_group_repository.py | Comprehensive repository tests with various pagination scenarios |
| tests/manager/services/scaling_group/test_scaling_group_service.py | Service layer tests with mocked dependencies |
| tests/manager/repositories/scaling_group/BUILD | Build configuration for repository tests |
| tests/manager/services/scaling_group/BUILD | Build configuration for service tests |
| changes/6985.feature.md | Changelog entry describing the feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| wsproxy_addr=self.wsproxy_addr, | ||
| wsproxy_api_token=self.wsproxy_api_token, |
Copilot
AI
Nov 27, 2025
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.
Type mismatch: wsproxy_addr and wsproxy_api_token are nullable in the database model but ScalingGroupData expects non-nullable str types. This conversion will fail at runtime when these fields are None. Update ScalingGroupData to have Optional[str] for these fields or handle None values here.
resolves #6977 (BA-3170)
Checklist: (if applicable)