Support regions/vpc-availability endpoints#880
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for VPC availability endpoints in regions, enabling clients to query which regions support VPCs and their available IPv6 prefix lengths.
Changes:
- Added
RegionVPCAvailabilitystruct and two new API methods:ListRegionsVPCAvailabilityandGetRegionVPCAvailability - Implemented comprehensive unit tests with fixture data for both list and get operations
- Added integration tests with recorded API responses
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| regions_availability.go | Implements new RegionVPCAvailability struct and API methods with caching support |
| test/unit/region_test.go | Adds unit tests for listing and retrieving VPC availability data |
| test/unit/fixtures/regions_vpc_availability_list.json | Fixture data for list VPC availability endpoint |
| test/unit/fixtures/region_vpc_availability_get.json | Fixture data for get VPC availability endpoint |
| test/integration/regionsavailability_test.go | Integration tests for VPC availability endpoints |
| test/integration/fixtures/TestRegionsVPCAvailability_List.yaml | Recorded API response for list operation |
| test/integration/fixtures/TestRegionVPCAvailability_Get.yaml | Recorded API response for get operation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b2109d6 to
80e4f55
Compare
There was a problem hiding this comment.
The output of those fixtures were recorded in the devcloud env rather than prod. This is because I don't have the token yet. But if I understand correctly, if someone run make fixtures for those tests, the output would differ greatly. That's why @mgwoj generated those output fixtures for production (as he has access) so I could use them here already, and future make fixtures would not generate such big diffs.
Should I use the fixtures obtained from prod env by Michał already?
There was a problem hiding this comment.
I have gained the access to the prod env and regenerated test data based on that env.
80e4f55 to
2aa4f20
Compare
466841d to
c0448b4
Compare
…c-availability-endpoints
* Add support for region vpc availability and regions vpc availability endpoints * Add integration tests for new endpoints * Execute gofumt to fix formatting issue * Adjust integration test data to the production API * Remove caching from vpc endpoints * Add dots to the comments --------- Co-authored-by: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com>
* Add option to upload test report on demand only for manual run * Include pull_request in TOD reports upload * Fix invalid syntax: @Always() -> always() * Set test_upload_report to choice type in ci.yml as it is unequivocal * Fixed issues flagged by gosec (#893) * Fixed issues flagged by gosec * Remove redundant and causing integration test failure * Removed `v4beta` notices from Maintenance Policy (#889) * Removed v4beta notices from Maintenance Policy fields/structs/methods * Address PR feedback * Support regions/vpc-availability endpoints (#880) * Add support for region vpc availability and regions vpc availability endpoints * Add integration tests for new endpoints * Execute gofumt to fix formatting issue * Adjust integration test data to the production API * Remove caching from vpc endpoints * Add dots to the comments --------- Co-authored-by: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> * Drop support for DBaaS V1 (#894) * fix: exclude gosec G117 for golangci-lint > 2.9 (#898) * fix: exclude gosec G117 for golangci-lint > 2.9 * improve comment --------- Co-authored-by: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> --------- Co-authored-by: Erik Zilber <ezilber@akamai.com> Co-authored-by: Dawid <56120592+dawiddzhafarov@users.noreply.github.com> Co-authored-by: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> Co-authored-by: Glenn Pratt <gpratt@akamai.com>
📝 Description
Add support for region vpc availability endpoints
✔️ How to Test
To run all unit and integration tests:
make test-unitmake test-intTo run only newly added unit and integration tests:
make TEST_ARGS="-run TestListRegionsVPCAvailability" test-unitmake TEST_ARGS="-run TestGetRegionVPCAvailability" test-unitmake TEST_ARGS="-run TestRegionsVPCAvailability_List" test-intmake TEST_ARGS="-run TestRegionVPCAvailability_Get" test-int