Skip to content

fix(aws/recommendations): map the remaining new-region display names - #621

Merged
cristim merged 2 commits into
mainfrom
fix/53-region-aliases
Oct 25, 2026
Merged

cristim merged 2 commits into
mainfrom
fix/53-region-aliases

Conversation

@cristim

@cristim cristim commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Refs #53.

Adds the non-Europe Cost Explorer display names that #53 lists and normalizeRegionName did not map: Asia Pacific (Malaysia) to ap-southeast-5, Asia Pacific (Thailand) to ap-southeast-7, Canada West (Calgary) to ca-west-1, Mexico (Central) to mx-central-1. Each is verified against aws-sdk-go-v2@v1.41.5/internal/endpoints/awsrulesfn/partitions.json lines 51, 57, 66 and 102.

The trailing HasPrefix branch is left in place: it is reachable (any region-code input such as us-east-1 takes it) but returns the input unchanged, so it is redundant rather than unreachable and removing it does not change behaviour.

Tests: four table cases fail without the fix, plus a collision test asserting distinct names map to distinct codes. go test -race -count=1 ./... passes in providers/aws with GOWORK=off and with the workspace; golangci-lint v2.10.1 reports 0 issues.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Cost Explorer region names for Malaysia, Thailand, Calgary, and Central Mexico are now recognized and mapped to their corresponding AWS regions.
    • These additions help distinguish the new region names from existing Asia-Pacific and Canadian region names when displaying or processing region information.

normalizeRegionName now maps the Cost Explorer display names for
ap-southeast-5 (Asia Pacific (Malaysia)), ap-southeast-7 (Asia Pacific
(Thailand)), ca-west-1 (Canada West (Calgary)) and mx-central-1 (Mexico
(Central)), as listed in #53. Each name is taken from
aws-sdk-go-v2@v1.41.5 internal/endpoints/awsrulesfn/partitions.json
lines 51, 57, 66 and 102.

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 →

Warning

Review limit reached

  • Run on-demand review

This review includes 3 billable files and costs up to $0.75.

  • 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 36 minutes for your next included review.

Check out review usage here.

View limit details

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

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 858974c and b815594.

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

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 75f4d27 and 858974c.

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

Walkthrough

normalizeRegionName now maps the Malaysia, Thailand, Calgary, and Central Mexico display names to their AWS region codes. Tests cover the new mappings and check for collisions with selected existing names.

Changes: AWS region name mappings

Layer / File(s) Summary
Add and verify region mappings
providers/aws/recommendations/converters.go, providers/aws/recommendations/converters_test.go, CHANGELOG.md
The normalizer adds four region-name mappings. Tests check the expected codes and verify that the tested names map to distinct codes. The changelog records the additions.

Priority: Normal

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

Change: Bug fix

Possibly related PRs

Suggested labels: priority/p2, severity/medium, triaged, urgency/this-quarter, impact/few, effort/s, type/bug

Merge Risk: Minimal · up to 85897

The region normalization update is ready to merge with no identified production risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding mappings for new AWS region display names.
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 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 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 535d81b into main Oct 25, 2026
15 checks passed
@cristim
cristim deleted the fix/53-region-aliases branch October 25, 2026 18:35
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