Repository navigation
chore(deps): bump cloud-commitments-go pins to 9dae64b and adapt archera key - #805
Conversation
…era key Bumps pkg and providers/aws|azure|gcp to 9dae64b216d4. The Archera key is now an insurance.Secret and is trimmed, since the library rejects non-printable key bytes such as a trailing newline. Adds tests for the zonal EC2 AZ path (kept AZ reaches the service client; AZ-less stale row fails closed) and the key trim. Refs #791 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Gate review (Opus), head 59ee199, finding F1 (PR body accuracy, non-blocking for code): |
Gate verdict (independent adversarial review, Opus): PASS at 59ee199Pins. All four modules at Library delta reviewed (old pins 73d3366/bcc0dfc/e24345c/2c18f30, all ancestors of 9dae64b): EC2 zonal-without-AZ and regional-with-AZ refused before any lookup ("re-fetch"); CE parser sets scope zonal iff trimmed AZ non-empty and stores the trimmed AZ, so the contradiction branch is unreachable from collected recs. Platform persists the full blob (scheduler Archera trim. Library rejects every byte < 0x21 or > 0x7e, so inner whitespace can never be a valid key; the trimmed value is the only Secret built (single site), and the library error names a byte position, never the key. Fails-before / mutants (fresh
Local verification (macOS, go1.26.9, GOWORK=off, exact head via git archive): Findings. F1 (body said go#320 changes post-purchase EC2 cost; it does not): body corrected. No code findings. Owner note. #791's comment and #792 say the bump is blocked on #792. Independent check: the bump does not regress any #792 item vs the old pin (old code bought zonal RIs in an arbitrary AZ; now it buys in the rec's AZ or fails closed). #792 items 1 (detail guard ignores AZ) and 4 (per-account AZ names) remain open and are the immediate follow-up. |
…mpotency key and rec ID (#807) * fix(purchase): make zonal EC2 AZ part of the guard, identity key, idempotency key and rec ID Zonal EC2 recs now keep their availability zone (#805) but three purchase paths ignored it: - computeDetailMismatch refuses a re-matched rec whose AZ differs from, or is unknown against, a known origin AZ. - recIdentityKey adds the AZ so the stored-rec index and pricing resolve the requested zone instead of an arbitrary one. - the 2-minute submit idempotency key reads the AZ from the rec Details (also present on rows written before this change), so two submits that differ only by AZ no longer collapse into one execution. A candidate whose key cannot be derived is skipped with an error log. The scheduler stamps the new RecommendationRecord.AvailabilityZone and appends it to the rec ID only for zonal recs (regional IDs unchanged). AZ names are per account, so zonal EC2 recs that Cost Explorer computed for a member account other than the collecting one are dropped with a warning. Refs #792 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * test(scheduler): cover zonal EC2 foreign-account drop at the collection path Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * style(scheduler): name partitionForeignZonalEC2 results --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Bumps
pkgandproviders/aws|azure|gcpto cloud-commitments-go main 9dae64b216d4 (all four atv0.0.0-20261012130811-9dae64b216d4), plus the one adaptation the new API needs.Refs #791. Left open on purpose: #792 (AZ-scoped EC2 recs: purchase guard, idempotency key, recommendations natural key, cross-account AZ gaps) is the immediate follow-up. Going ahead first is safe because a zonal rec without an AZ now fails closed instead of buying in an arbitrary AZ.
What reaches the platform
scheduler.go:1528, read backexecution.go:1130,purchase_pricing.go:211), so new zonal recs keepavailability_zoneand buy in it. Only rows stored under the old pin with zonal scope and no AZ now fail with "re-fetch" (502,handler_purchases.go:319; plan and scheduler runs record it on the execution row; suppressions stay held because the failure is not provably before submission).IncompleteRecommendationsErroris already handled bytolerateIncompleteSweep(rows kept, eviction withheld).fixedPriceCents); the pricing changes are inGetOfferingDetails, which the platform never calls. (Corrected by the gate reviewer.)GetExistingCommitments).common.ErrOutcomeUnknownis available but unused; adopting it (and the stale comment atmanager.go:262-264) is the fix(purchase): refuse retry and re-drive of AWS EC2 and Redshift purchases #778 follow-up.Config.APIKeyis nowinsurance.Secret. The key is alsoTrimSpaced, because no resolver trims and the library now rejects non-printable key bytes, which would turn every comparison intoErrKeyUnavailable.Tests
TestClient_KeyWithTrailingNewlineIsTrimmed(fails without the trim).internal/purchase/zonal_az_test.go: AZ reaches the service client; realec2.Clientover a stub API refuses an AZ-less zonal row with "re-fetch" and makes no offering lookup or purchase call (does not compile on the old pin).availability_zonein the stored blob. API: 502 with the "re-fetch" message (fixture error).Verification (macOS, fixture/mock-based, not real-account)
GOWORK=off go build/vet,go test ./...,make tidy-check,make lintall pass. No live cloud calls, purchases or deploys.🤖 Generated with Claude Code
Summary by CodeRabbit