feat(rbgsa): support scalingAdapter for instanceSet, add resource age#140
Conversation
Summary of ChangesHello @Syspretor, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the RoleBasedGroupScalingAdapter by extending its capabilities to manage InstanceSet workloads, thereby broadening the types of applications that can leverage role-based scaling. It also improves the user experience by adding a crucial AGE field to the RoleBasedGroupScalingAdapter CRD, making resource monitoring more intuitive. The addition of comprehensive E2E tests for InstanceSet ensures the reliability and correctness of these new features. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for scalingAdapter with InstanceSet workloads, adds an 'AGE' column to the scalingAdapter CRD for better observability, and expands the E2E tests to cover these new scenarios. The refactoring of extractLabelSelectorDefault is a significant improvement, simplifying the logic and removing unnecessary API calls. The changes are well-implemented and enhance the functionality and test coverage of the project. I have one suggestion in a test utility file to improve its robustness and consistency.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
c43017e to
eca4cf0
Compare
There was a problem hiding this comment.
Pull request overview
This pull request adds support for scaling adapter functionality to InstanceSet workloads in the RoleBasedGroup (RBG) system. The PR enhances the scalingAdapter controller to handle InstanceSet workloads in addition to StatefulSet and LeaderWorkerSet workloads, and adds an AGE column to the RoleBasedGroupScalingAdapter CRD for better observability.
Changes:
- Extended scalingAdapter support to InstanceSet workload type with proper label selector logic
- Added AGE field to scalingAdapter CRD for displaying resource creation time
- Enhanced E2E tests to cover InstanceSet and InstanceSet with LeaderWorkerSet pattern scenarios
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/wrappers/role_wrapper.go | Added WithLabels method to RoleWrapper for setting role labels in tests |
| test/e2e/testcase/scaling_adapter.go | Expanded E2E tests to include InstanceSet and InstanceSet-LeaderWorkerSet pattern scaling scenarios |
| test/e2e/framework/workloads/workload_expect.go | Added InstanceSet case to workload type switch for test expectations |
| test/e2e/framework/workloads/instanceset_expect.go | New file implementing InstanceSetChecker for validating InstanceSet workload behavior |
| internal/controller/workloads/rolebasedgroupscalingadapter_controller.go | Refactored label selector extraction to support InstanceSet workloads using common labels instead of unstructured queries |
| deploy/helm/rbgs/crds/workloads.x-k8s.io_rolebasedgroupscalingadapters.yaml | Added AGE column with descriptions, changed REPLICAS type from string to integer |
| config/crd/bases/workloads.x-k8s.io_rolebasedgroupscalingadapters.yaml | Added AGE column with descriptions, changed REPLICAS type from string to integer |
| api/workloads/v1alpha1/rolebasedgoupscalingadapter_types.go | Updated kubebuilder annotations for AGE column and changed REPLICAS type to integer |
| api/workloads/v1alpha1/constant.go | Added LeaderWorkerSet label constants including LwsWorkerIndexLabelKey |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
eca4cf0 to
a99d716
Compare
Ⅰ. Motivation
Ⅱ. Modifications
Ⅲ. Does this pull request fix one issue?
fixes #XXXX
Ⅳ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅴ. Describe how to verify it
VI. Special notes for reviews
Checklist
make fmt.