Skip to content

fix(recommendations): retain incomplete AWS survivors - #2129

Merged
cristim merged 2 commits into
mainfrom
fix/aws-recommendation-completeness
Oct 3, 2026
Merged

cristim merged 2 commits into
mainfrom
fix/aws-recommendation-completeness

Conversation

@cristim

@cristim cristim commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Preserve valid AWS recommendation rows when the provider reports typed incomplete collections. Discovery and regional collection now report those diagnostics while retaining survivors; ordinary error handling is unchanged.

Refs LeanerCloud/cloud-commitments-go#54. The parent issue remains open until all consumer work is complete.

Verification: 15 connected CLI command scenarios exercise explicit, default and fallback selection with valid, mixed, all-invalid, empty and API-error SDK responses through CSV output. Five helper cases cover partial and all-invalid collections, ordinary errors, cancellation and deadlines. All 20 pass with race detection against committed SHA443c10cfd1ad191d54ab0dcf02c388d7f9dd5547. Parent and warning-removal probes fail at the intended assertions. Normal commit hooks pass. Independent gpt-6-astra review approved that exact SHA. These tests use synthetic AWS responses through the published adapter; no live cloud calls or purchases.

OpenTelemetry SDK security repair is being handled separately. Required CI and security gates must pass before merge.

Summary by CodeRabbit

  • Bug Fixes
    • The CLI now keeps and processes recommendations that were successfully retrieved when recommendation fetching or region discovery is incomplete, instead of discarding available results. It also reports incomplete results so you can distinguish partial recommendations from complete results.
  • Tests
    • Added coverage for complete, partial, empty, and unavailable recommendation results across region discovery and recommendation fetching, including checks for diagnostics and generated CSV output.

Report typed AWS completeness diagnostics while preserving valid rows
during discovery and regional collection. Verify the real command and
CSV path against synthetic SDK responses.

Refs LeanerCloud/cloud-commitments-go#54
@cristim cristim added triaged Item has been triaged priority/p1 Next up; this sprint severity/high Significant harm urgency/this-sprint Within the current sprint impact/many Affects most users effort/m Days type/bug Defect labels Oct 3, 2026
@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: LeanerCloud/cloud-commitments-cli/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 9c95761f-5ff9-408d-a5d2-176a65e831da
📥 Commits

Reviewing files that changed from the base of the PR and between 443c10c and 6abdb14.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • go.mod

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.


📝 Walkthrough

Walkthrough

The command now logs incomplete recommendation errors and processes recommendations returned with those errors. Tests cover helper behavior and command output across region-selection modes and recommendation-detail outcomes.

Changes

Recommendation completeness

Layer / File(s) Summary
Preserve partial recommendation results
cmd/multi_service_helpers.go, go.mod
The region-discovery and recommendation-fetching helpers recognize IncompleteRecommendationsError, log it, and retain returned recommendations. Dependency versions are updated.
Validate completeness handling
cmd/recommendation_completeness_proxy_test.go, cmd/recommendation_completeness_test.go
A TLS proxy fixture supplies synthetic AWS responses. Integration and helper tests check request counts, diagnostics, partial results, and CSV output.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 6abdb

Valid recommendations are retained and reported when AWS returns incomplete results. No concrete merge-blocking defect is established; the required CI and security checks should still pass before merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: retaining valid AWS recommendations when a collection is incomplete.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Preserve the published provider pins while selecting the fixed SDK.
The unchanged parent reproduces the advisory against the same frozen
database used for passing source and command-binary scans.
@cristim

cristim commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

Added the OTEL dependency repair at 6abdb1469c04b0876bb983d22eb6af9ca92b4b20 to this existing completeness PR. Only the repair's go.mod and go.sum changed; all published provider pins are preserved.

Independent exact-SHA macOS Go 1.26.6 verification passed the full race suite, 15 actual root-command/config-loader/SDK/CSV scenarios plus five helper cases using synthetic boundary fixtures, and the actual ./cmd executable build. Source and executable govulncheck v1.1.4 scans passed against the same frozen advisory database that independently reproduced GO-2026-6505 on the unchanged parent (exit 3, SDK 1.44.0). The repaired executable selects SDK 1.45.0. Normal installed commit hooks passed.

The new two-manifest repair received two independent staged reviews and an exact-commit review. The earlier functional change remains at 443c10cfd1ad191d54ab0dcf02c388d7f9dd5547 with its prior review; these repair results alone are not a fresh full-PR review claim. A separate independent supplement approved the full five-file PR range from f2a3fe24f07c9dfb37b41c1dcf6a510270ac84d5 through this exact head, confirming functional/test blob identity and freshly repeating the final treatment. Its historical negative controls were inspected, not freshly repeated. Exact-head CI remains pending. No CodeRabbit review was requested, per the user's instruction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/m Days impact/many Affects most users priority/p1 Next up; this sprint severity/high Significant harm triaged Item has been triaged type/bug Defect urgency/this-sprint Within the current sprint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant