Skip to content

fix(aws/recommendations): map Taipei, New Zealand and the remaining partition region names - #622

Merged
cristim merged 1 commit into
mainfrom
fix/53-region-aliases-rest
Oct 25, 2026
Merged

cristim merged 1 commit into
mainfrom
fix/53-region-aliases-rest

Conversation

@cristim

@cristim cristim commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Adds the missing Cost Explorer region display names and tightens the alias tests.

  • Added Asia Pacific (Taipei) (ap-east-2) and Asia Pacific (New Zealand) (ap-southeast-6), plus the China, GovCloud, ISO and European Sovereign Cloud descriptions, all taken from aws-sdk-go-v2 internal/endpoints/awsrulesfn/partitions.json (v1.41.5).
  • Removed the region-code prefix branch in normalizeRegionName; it returned its input, the same as the fallthrough. An equivalence test over every alias and several non-alias inputs (old vs new) matched.
  • The collision test is now table-driven over the full regionAliases map.
  • Mutation probes (drop Taipei; point New Zealand at ap-southeast-7) both fail the new tests.
  • go test -race -count=1 ./... passes in providers/aws with GOWORK=off and with the workspace; golangci-lint v2.10.1 reports 0 issues.

refs #53

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements
    • Expanded AWS region-name recognition to include additional China, GovCloud, ISO, European Sovereign Cloud, Taipei, and New Zealand regions.
    • Unrecognized region names continue to be returned unchanged.
  • Tests
    • Expanded coverage to verify all region mappings, including documented duplicate-code aliases.

…artition region names

Add Cost Explorer display names for ap-east-2 (Taipei) and ap-southeast-6
(New Zealand), plus the China, GovCloud, ISO and European Sovereign Cloud
descriptions found in aws-sdk-go-v2 internal/endpoints/awsrulesfn/partitions.json.
Hoist the alias table to a package-level regionAliases map, drop the prefix
branch that returned its input unchanged (same fallthrough result for every
input), and make the collision test table-driven over the full map.

Refs #53

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 535d81b and 6de5270.

Files selected for processing: 3
  • CHANGELOG.md
  • providers/aws/recommendations/converters.go
  • providers/aws/recommendations/converters_test.go

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 2 reviews per hour.

Walkthrough

The change moves AWS region display-name aliases into a package-level map, adds partition region mappings, and removes prefix checks from normalizeRegionName. Tests validate all aliases and selected new mappings.

Changes: Region Alias Normalization

Layer / File(s) Summary
Alias map and validation
providers/aws/recommendations/converters.go, providers/aws/recommendations/converters_test.go, CHANGELOG.md
normalizeRegionName uses a package-level map with additional China, sovereign-cloud, ISO, GovCloud, Taipei, and New Zealand aliases. The tests check every map entry and expected mappings for selected aliases. The changelog records these changes and the removal of the region-code prefix checks.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Merge Risk: Minimal · up to 6de52

The region-name mappings are ready to merge after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely identifies the main change: adding AWS Cost Explorer region-name mappings for Taipei, New Zealand, and remaining partition regions.
Docstring Coverage Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (1 skipped: 1 u…
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 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (1 skipped: 1 unsupported.)

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@cristim
cristim merged commit b03349f into main Oct 25, 2026
15 checks passed
@cristim
cristim deleted the fix/53-region-aliases-rest branch October 25, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant