Skip to content

feat(config): add VM SKU groups for test fan-out - #357

Open
bhagyapathak wants to merge 1 commit into
microsoft:mainfrom
bhagyapathak:bhagya/multi-sku
Open

bhagyapathak wants to merge 1 commit into
microsoft:mainfrom
bhagyapathak:bhagya/multi-sku

Conversation

@bhagyapathak

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI lite review requested due to automatic review settings September 18, 2026 17:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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, and sku-group configuration.
  • 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-skus entries return an untyped formatted error even though callers can use errors.Is for ErrDuplicateSKUGroups and the other duplicate sentinels. Add an ErrDuplicateVMSKUs sentinel 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 in cfg.SKUGroups. That exact value is then exposed to external orchestration and will not match a canonical vm-skus key 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.md omits sku-groups/vm-skus, and tests.md still says TestRef has exactly name or group. 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"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants