Fix region scraper false positives and improve matching logic - #34
Conversation
- Fix regex in parseVaultFAQ to correctly distinguish between "Core" and "Non-Core" regions by using negative lookbehind. - Improve findMatchingRegion logic with a new "same words, any order" priority (e.g., "India Central" matches "Central India"). - Tighten alias matching to exact matches only to prevent false positives like "Australia Southeast" matching "Australia East". - Add regression tests for regex fix and matching logic improvements.
Deploying veeam-data-cloud-services-map with
|
| Latest commit: |
2321a07
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b66fc601.veeam-data-cloud-services-map.pages.dev |
| Branch Preview URL: | https://fix-region-scraper-false-pos.veeam-data-cloud-services-map.pages.dev |
- Fix regex in parseVaultFAQ to correctly distinguish between "Core" and "Non-Core" regions. - Fix parseVaultFAQ to correctly handle asterisk (*) in Core regions (indicating Foundation only). - Improve findMatchingRegion logic with "same words, any order" matching. - Tighten alias matching to prevent false positives. - Add regression tests.
|
I've added the missing aliases ('Africa South 1' and 'South America East 1') to the AWS region YAML files to ensure they match the scraped names correctly. This should resolve the false positives for these regions. |
|
I've also improved the |
There was a problem hiding this comment.
Pull request overview
Fixes false positives in the automated region maintenance scraper (especially Vault tier parsing) and improves region name matching to reduce incorrect discrepancies.
Changes:
- Updated Vault FAQ parsing to prevent “Core Regions” regex from matching inside “Non-Core Regions”, and to handle
*-marked regions with restricted editions. - Improved
findMatchingRegionto match regions with the same words in any order, and tightened alias matching to exact matches only. - Added new scraper regression tests and expanded AWS region aliases to support stricter matching.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| scripts/test-scraper.js | Adds regression tests for Vault parsing and improved matching behavior. |
| scripts/scrape-veeam-regions.js | Fixes Vault regex ambiguity; improves matching logic; tightens alias matching. |
| data/regions/aws/aws_sa_east_1.yaml | Adds a specific alias to support stricter matching. |
| data/regions/aws/aws_af_south_1.yaml | Adds a specific alias to support stricter matching. |
- Rename regionA_Core to regionACore in tests - Update comments to reflect exact alias matching - Update PR description and test counts
|
I've addressed the code review comments:
|
Problem
The automated region maintenance workflow was creating false positive issues for Vault regions.
Solution
parseVaultFAQto use a negative lookbehind(?<!Non-)to ensure "Core Regions" doesn't match "Non-Core Regions".parseVaultFAQto correctly handle asterisk (*) markers in the Veeam Vault documentation, ensuring correct edition/tier detection.Testing
scripts/test-scraper.js(Tests 14-17) covering regex fixes, word-order matching, alias false positive prevention, and asterisk handling.