fix: correct ap-southeast-3 usagetype prefix; drop duplicate registry/seed rows - #221
Merged
Conversation
…/seed rows Three pre-existing issues surfaced during the #208-#211 / #217 handler and pricing work: 1. `_REGION_PREFIX` mapped BOTH ap-southeast-3 and ap-south-1 to "APS3". AWS assigns usage-type region codes by launch order, not name: ap-south-1 (Mumbai) is APS3, ap-southeast-3 (Jakarta) is APS4. The collision meant a sync for ap-southeast-3 would build ap-south-1's usagetype prefix and price the wrong region (and vice-versa) — now feeds the data-transfer region filters, so it matters. Fixed ap-southeast-3 -> APS4. 2. `known_providers` in registry.py listed "rds": "aws" three times (silently collapsed by the dict literal). Deduplicated; keys unchanged in effect. 3. The seed price list carried a duplicate CloudWatch-Log-Storage row. SQLite treats seed rows (purchase_option=NULL) as distinct under the UNIQUE constraint, so a dup loads twice and a single logical price can surface as a spurious multi-tier TieredPrice. Removed the duplicate. Regression tests: region prefixes are all unique (+ explicit AP codes), and the seed list has no duplicate (vendor, service, region, usage_metric, start) rows. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
elecnix
marked this pull request as ready for review
July 3, 2026 15:52
This was referenced Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes three pre-existing issues surfaced during the #208–#211 handler work and #217 pricing work (each flagged in review as pre-existing / out-of-scope at the time).
1.
_REGION_PREFIXcollision (correctness)Both
ap-southeast-3andap-south-1mapped to"APS3". AWS assigns usage-type region codes by launch order, not name:ap-south-1(Mumbai) =APS3,ap-southeast-3(Jakarta) =APS4. The collision meant a sync forap-southeast-3builtap-south-1's usagetype prefix and priced the wrong region — and it now feeds the data-transfer region filters (#219/#220), so it has live impact. Fixedap-southeast-3→APS4.2. Duplicate
known_providerskeys (cleanup)registry.pylisted"rds": "aws"three times (silently collapsed by the dict literal). Deduplicated — behavior unchanged.3. Duplicate seed row (correctness)
The seed price list carried a duplicate
CloudWatch-Log-Storagerow. SQLite treats seed rows (purchase_option=NULL) as distinct under the UNIQUE constraint, so a dup loads twice and a single logical price can surface as a spurious multi-tierTieredPrice. Removed the duplicate.Test plan
_REGION_PREFIXvalues are all unique (+ explicit AP-region code assertions).(vendor, service, region, usage_metric, start_usage_amount)rows.Note:
ap-southeast-3 → APS4is per AWS's documented usage-type region codes; the live API session had expired at fix time, but the codes are canonical (launch-order assignment: APS1 Singapore, APS2 Sydney, APS3 Mumbai, APS4 Jakarta, APS5 Hyderabad).