Skip to content

perf(azure): wire ComputeDetails VCPU/MemoryGB enrichment via cachedSKULookup helper #98

@cristim

Description

@cristim

Summary

PR #81 added the cachedSKULookup helper for the Azure SKU catalogue. PR #97 extended common.ComputeDetails with VCPU + MemoryGB fields. The Azure compute converter at providers/azure/services/compute/client.go still doesn't populate them — it needs to call the helper (armcompute.ResourceSKUsClient.ListByLocation, cached per region) and pull vCPUs + MemoryGB from armcompute.ResourceSKU.Capabilities.

Current behaviour

convertAzureVMRecommendation populates only InstanceType in ComputeDetails. The new VCPU / MemoryGB fields ship as zero (omitted from JSON via omitempty).

Steps to verify the gap

Query a deployed environment with Azure compute recommendations, hit GET /api/recommendations, and observe that responses have details.vcpu and details.memory_gb absent (or zero) for compute recommendations.

Expected behaviour

Those fields populated from the SKU catalogue.

Proposed fix

In providers/azure/services/compute/client.go, mirror the cachedSKULookup pattern used by Cache/Cosmos/Database in PR #81. Look up vCPU / MemoryGB capabilities once per region, populate during convertAzureVMRecommendation. Graceful fallback to empty fields with a one-time WARN log on catalogue-fetch failure.

References

Severity

Low — UI degrades to "unknown" for vCPU/Memory on Azure compute recs; functional but loses resolution.

Effort

Small — one converter site, helper already exists post-#81.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions