feat(inventory/ri-exchange): honor Main Header global filter (closes #871)#906
Conversation
…871) RI Exchange was the last Inventory sub-tab that ignored the Main Header Provider/Account chips; Active Commitments and Coverage already honor them (PR #866/#881). QA 2.9. Frontend (riexchange.ts): - loadRIExchange is now provider-aware. AWS shows convertible RIs + reshape recs + history; Azure shows exchangeable VM reservations + history with a provider-aware "reshape not available" note; GCP shows a "RI Exchange isn't available for GCP" empty state across all sections and calls no list endpoint. - The convertible-RI list is scoped to the single-selected account chip and renders scoped, provider-aware empty states (named account/subscription). - An in-progress exchange modal is closed synchronously on any filter change so the user can't act on a now-hidden RI (mutating workflow). - New Azure table built via DOM/textContent (no innerHTML). Backend (handler_ri_exchange.go): - listConvertibleRIs accepts ?account_id= and returns an empty list when the chip selects an account other than the running ambient AWS account; a real STS failure fails closed. Azure already scopes by subscription_id; GCP has no endpoint (frontend short-circuits to empty). Tests: frontend chip-scoping, GCP not-available state, Azure path, and selection-clear on filter change; backend account-scope mismatch returns empty and resolve-error fails closed.
|
Warning Review limit reached
More reviews will be available in 55 minutes and 15 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
Makes the Inventory & Coverage > RI Exchange sub-tab honor the Main Header global Provider/Account filter, resolving QA Main Header 2.9 (#871). RI Exchange was the last Inventory sub-tab that ignored the global chips; Active Commitments and Coverage already honor them via the
wireChipSubscriptions/isInventoryTabActive/queueMicrotask-coalescing +subscribeProvider/subscribeAccountpattern landed in #866 / #881. This PR mirrors that pattern for RI Exchange.Behavior
Backend
GET /api/ri-exchange/instancesnow accepts?account_id=. Convertible RIs come from the deployment's ambient AWS credentials (one account); when the chip selects a different account, the handler returns an empty list (not an error). A real STS resolution failure fails closed (propagates the error) rather than leaking the ambient account's RIs.subscription_id. GCP has no endpoint; the frontend short-circuits to the empty state.Tests
tsc, fulljest(2172 pass), andgo test ./internal/api/...(1359 pass) all green.Closes #871.