Skip to content

chore(common): rename ServiceSavingsPlans -> ServiceSavingsPlansAll (closes #786)#787

Open
cristim wants to merge 3 commits into
mainfrom
chore/sp-slug-clarity
Open

chore(common): rename ServiceSavingsPlans -> ServiceSavingsPlansAll (closes #786)#787
cristim wants to merge 3 commits into
mainfrom
chore/sp-slug-clarity

Conversation

@cristim

@cristim cristim commented May 28, 2026

Copy link
Copy Markdown
Member

Summary

ServiceSavingsPlans was an umbrella sentinel whose name looked identical to the
four per-plan-type slugs (ServiceSavingsPlansCompute, etc.), making it unclear
at call sites whether a variable held the umbrella or a specific plan type.

Changes

  1. pkg/common/types.go -- rename constant ServiceSavingsPlans to
    ServiceSavingsPlansAll; string value "savingsplans" is unchanged (DB column
    locked by issue Normalize 'savings-plans' vs 'savingsplans' identifier across frontend + backend #85). Updated docstring makes the sentinel/umbrella intent
    explicit and references SavingsPlansPlanTypes().

  2. pkg/common/types.go -- add SavingsPlansPlanTypes() []ServiceType
    returning the 4 per-plan-type slugs in canonical order
    (Compute -> EC2Instance -> SageMaker -> Database). Unit test in
    pkg/common/types_test.go asserts length 4, canonical order, and that every
    returned slug passes IsSavingsPlan.

  3. pkg/common/types.go -- update IsSavingsPlan switch arm to
    ServiceSavingsPlansAll; no behaviour change. Updated 23 other call-site files
    (providers, cmd, internal/purchase) with the same mechanical swap.

Verification

  • go build ./... clean
  • go test .../pkg/common/... .../providers/aws/recommendations/... .../internal/api/... -count=1 -short: 1802 tests pass
  • git grep -E '\bServiceSavingsPlans\b' -- '*.go': 0 hits (no stale bare references)
  • git grep ServiceSavingsPlansAll -- '*.go': 82 occurrences (matches the pre-rename count of the bare identifier)

Notes

PR #785 (closes #784, currently open and mid-CR) references ServiceSavingsPlans in
its diff. It will need a trivial rebase after this merges -- a mechanical
ServiceSavingsPlans -> ServiceSavingsPlansAll identifier swap on its branch, no
logic change. No other in-flight branch references the bare identifier.

Closes #786
Refs #85 #785

@cristim cristim added triaged Item has been triaged priority/p3 Polish / idea / may never ship severity/low Minor harm urgency/eventually No deadline impact/internal Team-internal only effort/s Hours type/chore Maintenance / non-user-visible labels May 28, 2026
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@cristim, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 7 minutes and 33 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9d8e3890-fd9a-426a-ac87-f813782163a5

📥 Commits

Reviewing files that changed from the base of the PR and between 451a70f and 7ffd4c0.

📒 Files selected for processing (27)
  • cmd/helpers_test.go
  • cmd/main_test.go
  • cmd/multi_service_helpers.go
  • cmd/multi_service_stats.go
  • cmd/multi_service_stats_test.go
  • cmd/multi_service_test.go
  • internal/purchase/coverage_extra_test.go
  • internal/purchase/execution.go
  • pkg/common/service_details_codec.go
  • pkg/common/service_details_codec_test.go
  • pkg/common/types.go
  • pkg/common/types_test.go
  • providers/aws/provider.go
  • providers/aws/provider_test.go
  • providers/aws/recommendations/client.go
  • providers/aws/recommendations/client_test.go
  • providers/aws/recommendations/family_nu_test.go
  • providers/aws/recommendations/parser_sp.go
  • providers/aws/recommendations/parser_sp_additional_test.go
  • providers/aws/services/savingsplans/client.go
  • providers/aws/services/savingsplans/client_test.go
  • providers/azure/provider.go
  • providers/azure/provider_test.go
  • providers/azure/recommendations.go
  • providers/azure/recommendations_test.go
  • providers/azure/services/savingsplans/client.go
  • providers/azure/services/savingsplans/client_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/sp-slug-clarity

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

@cristim

cristim commented May 28, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 28, 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 30, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Rate Limit Exceeded

@cristim have exceeded the limit for the number of chat messages per hour. Please wait 54 minutes and 14 seconds before sending another message.

@cristim

cristim commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 1, 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 Jun 4, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

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 Jun 8, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@cristim cristim changed the base branch from feat/multicloud-web-frontend to main June 9, 2026 15:46
cristim added 3 commits June 19, 2026 17:35
…loses #786)

Add SavingsPlansPlanTypes() helper returning the 4 per-plan-type slugs
in canonical order. Update IsSavingsPlan switch to use the new name.
String value "savingsplans" unchanged (DB column locked by issue #85).
…ll rename

Rebase onto feat/multicloud-web-frontend brought in three files that still
referenced the old common.ServiceSavingsPlans sentinel (renamed to
ServiceSavingsPlansAll in the prior commit). Update the two production call
sites and one test file so go vet and go build pass on the merged PR view.
@cristim cristim force-pushed the chore/sp-slug-clarity branch from e326233 to 7ffd4c0 Compare June 19, 2026 15:46
@cristim

cristim commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

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.

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

Labels

effort/s Hours impact/internal Team-internal only priority/p3 Polish / idea / may never ship severity/low Minor harm triaged Item has been triaged type/chore Maintenance / non-user-visible urgency/eventually No deadline

Projects

None yet

1 participant