Repository navigation
feat(exchange)!: pass the source RI's availability zone to LookupOffering - #428
Conversation
|
Warning Review limit reached
This review includes 2 billable files and costs up to $0.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 17 minutes for your next included review. View limit details
Comment |
|
@coderabbitai review |
|
|
CI is green on head |
|
Independent adversarial review: CLEAN at
Mutation probe: dropping Local verification (macOS, unit/mock evidence) at the exact head: CI green on |
|
Automated review of
Posted by a read-only review sweep. It stays silent on this commit and re-reviews only after a new push. |
…ring resolveOffering could not tell the offering lookup which zone a zonal convertible RI lives in, so the provider had no way to keep the target in that zone. RIMetadataInfo gains AvailabilityZone, and LookupOfferingFunc now takes a LookupOfferingParams struct carrying it alongside the existing fields. BREAKING CHANGE: LookupOfferingFunc takes LookupOfferingParams instead of six positional arguments; callers must also fill RIMetadataInfo.AvailabilityZone for zonal RIs. Closes #310 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a2c5c0c to
d0495fb
Compare
|
Rebased onto main |
|
Merge evidence at |
Summary
pkg half of #310.
resolveOffering(pkg/exchange/auto.go) called the offering lookup with instance type, product, tenancy, scope and duration but no availability zone, so the provider could not keep an exchange target in the source RI's zone.RIMetadataInfogainsAvailabilityZone.LookupOfferingFuncnow takes aLookupOfferingParamsstruct (the five existing values plusAvailabilityZone) instead of positional strings, andresolveOfferingforwards the AZ.Breaking for the platform (the only consumer; nothing in this repo outside tests assigns
LookupOfferingor fillsRIMetadata): after bumping itspkgpin it must adapt itsLookupOfferingclosure to the struct, pass the AZ into the provider'sFindConvertibleOfferingParams.AvailabilityZone(#427), and setRIMetadataInfo.AvailabilityZonefrom the source RI. Until it does, a zonal RI reaches the provider with a blank AZ and the lookup fails loud (no silent cross-zone exchange). Platform follow-up: LeanerCloud/cloud-commitments-platform#921.Closes #310. Merge after #427 (the provider half, independent code) so the issue does not close before both halves land.
Verification (macOS, Go 1.26.9)
(cd pkg && GOWORK=off go test -race -short ./...): pass.make build,make vet: pass. golangci-lint v2.10.1 (CI pin) frompkg: 0 issues.GOWORK=off go build ./...in all five modules: pass (providers still use their pinnedpkg).TestResolveOffering_ForwardsAvailabilityZonethen fails (AvailabilityZone: "", want"us-east-1b"). It asserts full struct equality with distinct values per field.9dd3761a. Its mutation swapping Tenancy and Scope inresolveOfferingfails the test.Unit tests with stub lookups only; no AWS call, exchange or purchase.
🤖 Generated with Claude Code