Skip to content

feat(frontend/recs): render Azure Savings Plans rows + column visibility - #723

Merged
cristim merged 1 commit into
feat/multicloud-web-frontendfrom
feat/658-azure-sp-rows-frontend
May 27, 2026
Merged

cristim merged 1 commit into
feat/multicloud-web-frontendfrom
feat/658-azure-sp-rows-frontend

Conversation

@cristim

@cristim cristim commented May 25, 2026 •

Copy link
Copy Markdown
Member

Closes #658.

Root cause

isSavingsPlanService in frontend/src/lib/purchase-compatibility.ts matched startsWith('savings-plans') only. The Azure SP client (providers/azure/services/savingsplans/client.go) reports service = "savingsplans" (no hyphen), identical to Go's common.ServiceSavingsPlans umbrella constant. Go's IsSavingsPlan handles this with an explicit equality check (string(s) == "savingsplans"); the frontend did not mirror it, so:

  1. Azure SP rows were excluded from the 'All Savings Plans' tri-state toggle in the service filter popover.
  2. Azure SP recs were NOT collapsed into the canonical 'savings-plans' bulk-buy bucket — they got their own 'savingsplans' bucket key, breaking the one-bucket SP experience.

Fix

  • Extended isSavingsPlanService to match both 'savings-plans' and 'savingsplans'.
  • New UMBRELLA_SLUGS set to unify the 'skip in label' guard for both spellings.
  • savingsPlansBucketLabel falls back gracefully to 'Savings Plans' for Azure SP buckets.

Tests

  • 3 new tests in purchase-compatibility.test.ts (Azure SP slug recognition)
  • 5 new tests in recommendations.test.ts (Azure SP rows appear; SP group toggle includes savingsplans slugs; bulk-buy bucketing uses canonical SP bucket key)
  • 1939 tests pass total (+25 net)

Summary by CodeRabbit

  • New Features

    • Added support for Azure Savings Plans across service filtering, column filters, and recommendation bucketing.
    • Service column filter toggles now correctly display "All Savings Plans" when Azure Savings Plans are included.
  • Bug Fixes

    • Improved plan type label rendering to display "Savings Plans" without internal identifiers.

Review Change Stack

Azure SP recs use service="savingsplans" (no hyphen), matching the Go
common.ServiceSavingsPlans constant. The previous isSavingsPlanService
predicate only matched startsWith('savings-plans'), so Azure SP rows
were silently excluded from the service-column "All Savings Plans" group
toggle and the bulk-buy SP bucket collapse.

- Extend isSavingsPlanService to also match the exact slug "savingsplans",
  mirroring Go's IsSavingsPlan equality check for the umbrella constant.
- Introduce UMBRELLA_SLUGS to unify the "skip in bucket label" guard for
  both "savings-plans" (bucket key) and "savingsplans" (Azure SP / legacy
  AWS umbrella); label falls back to "Savings Plans" for both.
- Add tests: isSavingsPlanService recognises "savingsplans"; bucket label
  skips it gracefully; Azure SP rows appear in the rendered table; the
  All Savings Plans tri-state toggle includes "savingsplans" slugs; Azure
  SP bulk-buy bucketing uses the canonical SAVINGS_PLANS_BUCKET_KEY.

Closes #658
@cristim cristim added triaged Item has been triaged priority/p2 Backlog-worthy severity/medium Moderate harm urgency/this-quarter Within the quarter impact/few Limited audience effort/m Days type/feat New capability labels May 25, 2026
@coderabbitai

coderabbitai Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e4092102-58bb-4021-8557-59c82f3fb63a

📥 Commits

Reviewing files that changed from the base of the PR and between 5abf40b and 038ed97.

📒 Files selected for processing (3)
  • frontend/src/__tests__/purchase-compatibility.test.ts
  • frontend/src/__tests__/recommendations.test.ts
  • frontend/src/lib/purchase-compatibility.ts

📝 Walkthrough

Walkthrough

This PR extends the frontend recommendations table to surface Azure Savings Plans rows alongside AWS Savings Plans. Core logic in purchase-compatibility.ts now recognizes the Azure umbrella slug "savingsplans" and excludes it from bucket labels. Integration tests verify rendering, service column visibility, and bulk-buy bucketing.

Changes

Azure Savings Plans Frontend Integration

Layer / File(s) Summary
Core Savings Plans service detection and labeling
frontend/src/lib/purchase-compatibility.ts, frontend/src/__tests__/purchase-compatibility.test.ts
isSavingsPlanService() now recognizes the Azure umbrella slug "savingsplans" in addition to savings-plans* prefix matching. savingsPlansBucketLabel() filters out umbrella Savings Plans slugs from the parenthetical plan-type list. Unit tests validate both behaviors with the Azure slug and fallback label rendering.
Recommendations table Azure Savings Plans integration tests
frontend/src/__tests__/recommendations.test.ts
Integration tests validate that Azure Savings Plans recommendations render in the table with service badges appearing in the table and service column-filter popover. Tests also verify bulk-buy fan-out correctly buckets Azure SP recs under the canonical service="savings-plans" bucket key alongside AWS Savings Plans types, covering both single-bucket and multi-provider scenarios.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • LeanerCloud/CUDly#180: Modifies frontend/src/lib/purchase-compatibility.ts and its tests around Savings Plans detection and labeling for service slug grouping and rendering.
  • LeanerCloud/CUDly#181: Extends isSavingsPlanService() to recognize the Azure umbrella slug "savingsplans" for the "All Savings Plans" tri-state service filter, overlapping with this PR's core logic updates.

Suggested labels

impact/many

Poem

🐰 Azure Savings Plans hop into the view,
No hyphen needed, just "savingsplans" too,
Buckets collapse with labels so clean,
The finest Savings Plans we've ever seen! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: adding frontend support for Azure Savings Plans rows and column visibility in the recommendations table.
Linked Issues check ✅ Passed The pull request fully implements the scope of issue #658: Azure Savings Plans rows are rendered with column visibility handling mirroring AWS Savings Plans behavior.
Out of Scope Changes check ✅ Passed All changes are directly scoped to issue #658 requirements: extending service slug recognition and bucket label handling to support Azure Savings Plans in frontend rendering.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/658-azure-sp-rows-frontend

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

@cristim

cristim commented May 25, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 27, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim
cristim merged commit 9321a59 into feat/multicloud-web-frontend May 27, 2026
6 checks passed
@cristim
cristim deleted the feat/658-azure-sp-rows-frontend branch May 27, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/m Days impact/few Limited audience priority/p2 Backlog-worthy severity/medium Moderate harm triaged Item has been triaged type/feat New capability urgency/this-quarter Within the quarter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant