Skip to content

chore(sp): tidy cli#2184 follow-ups - #2188

Merged
cristim merged 1 commit into
mainfrom
fix/2187-sp-followups
Oct 13, 2026
Merged

cristim merged 1 commit into
mainfrom
fix/2187-sp-followups

Conversation

@cristim

@cristim cristim commented Oct 13, 2026

Copy link
Copy Markdown
Member

Closes #2187. Follow-ups from the cli#2184 review.

  • cmd/savings_plan_region_test.go: removes the split account literal ("1234" + "56789012") and the Account field it fed; nothing in those tests needs it.
  • cmd/multi_service_csv_test.go: TestExtractRDSFamily -> TestExtractFamily; adds SP cases (EC2 Instance SP family m5, Compute SP empty, typed-nil details empty).
  • cmd/multi_service_csv.go: extractFamily comment no longer says "family-NU" for every row.
  • cmd/multi_service_helpers.go: drops && recs[i].Region == "" in stampSavingsPlanRegions. Deletion probe: EffectiveRegion returns a non-empty rec.Region unchanged, so the guard was redundant; full go test ./... passes without it.

Verified locally: go vet ./... && go test ./... (1364 passed) and bash scripts/test-git-secrets-allowlist.sh (44 PASS, 0 FAIL). Independent of cli#2185 and cli#2186.

🤖 Generated with Claude Code

Drop the split account-id literal and unused Account field from the SP region
test, rename TestExtractRDSFamily to TestExtractFamily with SP cases, reword
the extractFamily comment, and drop the Region guard in
stampSavingsPlanRegions (EffectiveRegion already returns a non-empty
Region unchanged; deletion probe: full suite passes without it).

Closes #2187

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cristim cristim added triaged Item has been triaged priority/p3 Polish / idea / may never ship severity/low Minor harm urgency/eventually No deadline impact/few Limited audience effort/xs Trivial / one-liner type/chore Maintenance / non-user-visible labels Oct 13, 2026
@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 4 billable files and costs up to $1.00.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 27 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 61 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: LeanerCloud/cloud-commitments-cli/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 0e99b172-036e-45d7-bf4f-a7c89abdaa80
📥 Commits

Reviewing files that changed from the base of the PR and between 68f6b77 and 16c1593.

📒 Files selected for processing (4)
  • cmd/multi_service_csv.go
  • cmd/multi_service_csv_test.go
  • cmd/multi_service_helpers.go
  • cmd/savings_plan_region_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@cristim

cristim commented Oct 13, 2026

Copy link
Copy Markdown
Member Author

Independent review (claude-opus-5-5) of 16c1593: APPROVE

I checked each claim against the diff against base 68f6b77. The diff is 4 files, +8/-10, and contains nothing beyond the claims below.

  • The split account literal, the testAccountID constant and the fixture's Account field are removed from cmd/savings_plan_region_test.go. grep finds no remaining testAccountID, TestExtractRDSFamily or extractRDSFamily anywhere in the tree.
  • TestExtractRDSFamily is renamed to TestExtractFamily (cmd/multi_service_csv_test.go:444), with three SP cases: EC2 Instance SP -> "m5", Compute SP -> "", and typed-nil *SavingsPlanDetails -> "". The nil case falls through to the non-RDS branch, so there is no panic.
  • The family-NU wording is now scoped to RDS (cmd/multi_service_csv.go:356).
  • && recs[i].Region == "" is dropped from stampSavingsPlanRegions (cmd/multi_service_helpers.go:656). The behaviour is identical, because awsprovider.EffectiveRegion returns rec.Region when it is set (providers/aws/service_client.go:157-158 at the pinned version).

Local verification at the head:

  • gofmt -l cmd/ and go vet ./... are clean, and go test -count=1 ./... passes (cmd ok, 75s).
  • bash scripts/test-git-secrets-allowlist.sh: 44 PASS, 0 FAIL.
  • Mutation: with extractFamily returning "" for SP, TestExtractFamily/EC2_Instance_SP fails.

Non-blocking findings: none.

CI on 16c1593 is green: all required checks pass, and gosec and Trivy are skipped.

@cristim
cristim merged commit 28d6b36 into main Oct 13, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/xs Trivial / one-liner impact/few Limited audience 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

Development

Successfully merging this pull request may close these issues.

chore(sp): tidy cli#2184 follow-ups (split account literal, extractFamily test name, comment, redundant guard)

1 participant