Repository navigation
feat: support compute quota categories - #1921
Merged
Merged
Conversation
* If category is enabled, use it. * If not, don't.
Contributor
There was a problem hiding this comment.
π‘ Changes recommended
Resolve the Compute Limit permission and production-path coverage concerns, and ensure mappings are recorded when category usage is absent.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds Azure Compute Limit quota-category support, including VM-family mapping, client wiring, test fakes, and dependency updates.
Changes:
- Adds category-aware quota resolution.
- Integrates the Compute Limit API and test environment.
- Expands unit, controller, and pagination coverage.
- Adds the Compute Limit SDK dependency.
File summaries
| File | Summary |
|---|---|
pkg/test/environment.go |
Updates test environment wiring. |
pkg/providers/quota/quota.go |
Implements category-aware quota logic. |
pkg/providers/quota/quota_test.go |
Tests mappings and failure handling. |
pkg/providers/instancetype/suite_test.go |
Tests category-based offering filtering. |
pkg/providers/azclient/azclient.go |
Adds the Compute Limit client integration. |
pkg/operator/operator.go |
Wires the new quota client. |
pkg/fake/vmfamiliesapi.go |
Adds the paginated API fake. |
pkg/fake/vmfamiliesapi_test.go |
Tests fake pagination. |
pkg/controllers/quota/suite_test.go |
Tests category refresh and staleness behavior. |
go.sum |
Records dependency checksums. |
go.mod |
Adds the Compute Limit SDK dependency. |
Review details
Suppressed comments (2)
pkg/providers/azclient/azclient.go:236
- [High][Test Coverage] The new production path constructs and uses the Compute Limit VM-families endpoint, but all added tests substitute the service with a fake pager; the linked E2E run is a regression run, and the PR notes there is no category-enabled subscription behind it. A wrong API version or route, missing RBAC, or different response shape could therefore pass CI while quota filtering remains ineffective or reconciliation fails. Add a live E2E/integration check with a category-enabled subscription, or an equivalent recorded contract test, before relying on this path.
quotaCategoryVMFamilyMappingAPI, err := armcomputelimit.NewVMFamiliesClient(cfg.SubscriptionID, cred, opts)
if err != nil {
return nil, err
}
pkg/providers/quota/quota.go:119
- [Medium][Correctness] Once
generalPurposeCategoryis present, quota categories are enabled, but this condition records a family mapping only when the category usage entry is also present. If Azure returns the mapping while that usage entry is temporarily absent,GetUsagefalls back to the family-specific quota and can mark on-demand offerings available from a quota that no longer governs the family. Record the mapping for every succeeded VM-family response so a missing category usage causes the existing fail-open path instead.
for familyName, categoryName := range familyToCategory {
if _, ok := freshUsages[categoryName]; ok {
freshFamilyToQuotaName[familyName] = categoryName
}
- Files reviewed: 10/11 changed files
- Comments generated: 1
- Review effort level: Lite
π‘ Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Alex Leites (tallaxes)
approved these changes
Sep 18, 2026
Matthew Christopher (matthchr)
deleted the
matthchr/quota-categories
branch
September 18, 2026 18:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
How was this change tested?
Does this change impact docs?
Release Note