Repository navigation
fix(cli): fail purchase flow when extended-support queries are unavailable (A10-013) #2147
Description
Summary
Preserve audit finding A10-013 from #1313, intentionally deferred by PR #2138. Complete RDS instance or lifecycle query failure can still disable extended-support exclusion while a purchase run proceeds.
Current behaviour
At PR head 64ccda8, queryRDSInstancesInRegions returns (instanceVersions, nil) after every regional worker fails (cmd/multi_service_engine_versions.go:103, :128, :140). queryMajorEngineVersionsWithClient logs each engine failure and also returns nil error (:213, :220, :226). queryInstanceVersions and queryMajorVersions convert any propagated error to empty maps and continue (cmd/multi_service_helpers.go:315, :329).
PR #2138 distinguishes individual lookup misses and adds warnings. It does not repair total query failure or abort purchase processing when the exclusion signal is unavailable.
Steps to verify the gap
- Use mocked or local SDK responses that fail every region's instance query, or all four engine lifecycle queries.
- Run the normal recommendation path with
IncludeExtendedSupport=falseand purchase mode enabled, using a fake purchase client that cannot spend money. - Observe query results are reported as empty data or a continuing warning instead of an error that prevents the fake purchase call.
Expected behaviour
Distinguish a successful empty inventory from unavailable inventory/lifecycle data. When exclusion was requested and required data is unavailable, fail visibly before attempting a purchase. Specify and test partial-success behaviour separately.
Proposed fix
Aggregate success/error state in the region and engine query helpers above. Propagate unavailable-data errors through fetchEngineVersionData (cmd/multi_service_helpers.go:299) to the caller (cmd/multi_service.go:153), preserving descriptive diagnostics. Add failing-before/passing-after fixture verification through the real filtering and fake-purchase path, including complete failure, genuine empty results, partial success and IncludeExtendedSupport opt-in.
References
- Parent issue isInExtendedSupport silently returns false on lifecycle lookup miss (money path) #1313, audit finding A10-013 in its body.
- PR fix(cli): signal unknown extended-support lifecycle instead of silent false #2138, which explicitly defers this query/purchase-flow change.
- Source baseline: 64ccda8.
- Project known-issues convention is GitHub issues, not local known-issues files.
Severity
Medium, inherited from A10-013: affects accounts whose AWS queries fail, and can defeat requested exclusions on a money-related path. No real purchase or cloud operation was used to verify or report this gap.
Activity
fix(cli): signal unknown extended-support lifecycle instead of silent…
test(cmd): cover extended-support exclusion wiring in the main pipeli…
fix(cmd): fail when extended-support exclusion data is unavailable (#…