feat(config): add VM SKU groups for test fan-out - #357
Open
bhagyapathak wants to merge 1 commit into
Open
bhagyapathak wants to merge 1 commit into
bhagyapathak wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved moderate validation and loader-coverage issues must be addressed before approval.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds VM SKU groups and per-SKU metadata for external test fan-out orchestration.
Changes:
- Adds
sku-groups,vm-skus, andsku-groupconfiguration. - Adds loading, merging, validation, and tests.
- Updates generated schemas and snapshots.
File summaries
| File | Summary |
|---|---|
schemas/azldev.schema.json |
Updated generated schema. |
scenario/__snapshots__/TestSnapshotsContainer_config_generate-schema_stdout_1.snap |
Updated container schema snapshot. |
scenario/__snapshots__/TestSnapshots_config_generate-schema_stdout_1.snap |
Updated schema snapshot. |
internal/projectconfig/testsuite.go |
Adds SKU-related errors. |
internal/projectconfig/tests.go |
Adds SKU groups and test-reference fields. |
internal/projectconfig/project.go |
Adds SKU validation; moderate issues remain for empty groups, undefined references, and whitespace handling; documentation nit remains. |
internal/projectconfig/loader.go |
Adds SKU merging; moderate loader coverage and a duplicate VM SKU sentinel issue remain. |
internal/projectconfig/configfile.go |
Adds TOML fields; documentation nit remains. |
internal/projectconfig/configfile_test.go |
Adds SKU validation tests. |
Review details
Suppressed comments (3)
internal/projectconfig/loader.go:438
- Unlike the other duplicate top-level map merges, duplicate
vm-skusentries return an untyped formatted error even though callers can useerrors.IsforErrDuplicateSKUGroupsand the other duplicate sentinels. Add anErrDuplicateVMSKUssentinel and wrap it here so callers can reliably distinguish this configuration error.
func mergeVMSKUs(resolvedCfg *ProjectConfig, loadedCfg *ConfigFile) error {
for vmSize, metadata := range loadedCfg.VMSKUs {
if _, ok := resolvedCfg.VMSKUs[vmSize]; ok {
return fmt.Errorf("duplicate VM SKU %#q", vmSize)
internal/projectconfig/project.go:163
- The loop trims only a local copy, so a value such as
" Standard_D4s_v5 "is accepted but the padded string remains incfg.SKUGroups. That exact value is then exposed to external orchestration and will not match a canonicalvm-skuskey or Azure VM size; reject surrounding whitespace or persist the trimmed value before storing/using the group.
vmSize = strings.TrimSpace(vmSize)
if vmSize == "" {
return fmt.Errorf("%w %#q: vm-sizes must contain non-empty values", ErrInvalidSKUGroup, groupName)
internal/projectconfig/project.go:58
- These new user-facing TOML sections and reference fields are not documented in the checked-in config reference:
config-file.mdomitssku-groups/vm-skus, andtests.mdstill saysTestRefhas exactlynameorgroup. Please update the relevant reference pages with the syntax and fan-out semantics.
// Definitions of named Azure VM size groups for external test orchestration.
SKUGroups map[string]SKUGroup `toml:"sku-groups,omitempty" json:"skuGroups,omitempty" jsonschema:"title=SKU Groups,description=Mapping of SKU group names to Azure VM size lists"`
// Metadata keyed by Azure VM size for external test parameter resolution.
VMSKUs map[string]map[string]any `toml:"vm-skus,omitempty" json:"vmSkus,omitempty" jsonschema:"title=VM SKUs,description=Per-VM-size metadata used for test parameter resolution"`
- Files reviewed: 9/9 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+171
to
+187
| if err := mergeSKUConfig(resolvedCfg, loadedCfg); err != nil { | ||
| return err | ||
| } | ||
|
|
||
| if err := mergeResources(resolvedCfg, loadedCfg); err != nil { | ||
| return err | ||
| } | ||
|
|
||
| return nil | ||
| } | ||
|
|
||
| func mergeSKUConfig(resolvedCfg *ProjectConfig, loadedCfg *ConfigFile) error { | ||
| if err := mergeSKUGroups(resolvedCfg, loadedCfg); err != nil { | ||
| return err | ||
| } | ||
|
|
||
| return mergeVMSKUs(resolvedCfg, loadedCfg) |
Comment on lines
+158
to
+160
| for groupName, group := range groups { | ||
| seen := make(map[string]struct{}, len(group.VMSizes)) | ||
| for _, vmSize := range group.VMSizes { |
Comment on lines
+174
to
+179
| for imageName, image := range images { | ||
| if image.Tests == nil { | ||
| continue | ||
| } | ||
|
|
||
| for _, ref := range image.Tests.Tests { |
Comment on lines
+72
to
+76
| // Definitions of SKU groups used for test fan-out (new schema, [sku-groups.X]). | ||
| SKUGroups map[string]SKUGroup `toml:"sku-groups,omitempty" validate:"dive" jsonschema:"title=SKU Groups,description=Definitions of named Azure VM size lists for test fan-out"` | ||
|
|
||
| // Metadata keyed by Azure VM size. Values are consumed by external test orchestration. | ||
| VMSKUs map[string]map[string]any `toml:"vm-skus,omitempty" jsonschema:"title=VM SKUs,description=Per-VM-size metadata used for test parameter resolution"` |
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.
No description provided.