Skip to content

Conversation

@jopemachine
Copy link
Member

@jopemachine jopemachine commented Nov 27, 2025

resolves #6977 (BA-3170)

Checklist: (if applicable)

  • Mention to the original issue

@jopemachine jopemachine changed the title feat: Add ScalingGroup service logic (WIP) feat(BA-3170): Add ScalingGroup service logic (WIP) Nov 27, 2025
@github-actions github-actions bot added size:M 30~100 LoC comp:manager Related to Manager component labels Nov 27, 2025
@jopemachine jopemachine added this to the 25.18 milestone Nov 27, 2025
@github-actions github-actions bot added size:L 100~500 LoC comp:common Related to Common component and removed size:M 30~100 LoC labels Nov 27, 2025
@github-actions github-actions bot added size:XL 500~ LoC and removed size:L 100~500 LoC labels Nov 27, 2025
@jopemachine jopemachine changed the title feat(BA-3170): Add ScalingGroup service logic (WIP) feat(BA-3170): Add ScalingGroup layer service logic, and implement pagination support Nov 27, 2025
@jopemachine jopemachine marked this pull request as ready for review November 27, 2025 22:53
Copilot AI review requested due to automatic review settings November 27, 2025 22:53
Copilot finished reviewing on behalf of jopemachine November 27, 2025 22:55
Copy link
Contributor

Copilot AI left a 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 Querier infrastructure with OffsetPagination
  • Integrates the new repository into the main Repositories class 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.

Comment on lines +291 to +292
wsproxy_addr=self.wsproxy_addr,
wsproxy_api_token=self.wsproxy_api_token,
Copy link

Copilot AI Nov 27, 2025

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:common Related to Common component comp:manager Related to Manager component size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ScalingGroup layer service logic, and implement pagination support

3 participants