-
Notifications
You must be signed in to change notification settings - Fork 2.1k
mgmt, bug fix on that list in network does not return full items #47226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
mgmt, bug fix on that list in network does not return full items #47226
Conversation
Curious why |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug where list() operations in the network module (LocalNetworkGateways, VirtualNetworkGateways, VirtualNetworkGatewayConnections) only returned resources from the first resource group instead of all resource groups in a subscription. The root cause was using PagedConverter.mapPage() with PagedConverter.mergePagedFlux(), which only retrieved one page due to the .take(1) behavior in mapPage().
Key changes:
- Created
PagedConverterForMergedPagedFluxclass that doesn't limit page retrieval - Updated three implementation classes to use the new converter
- Added documentation warning about the incompatibility
- Added test coverage for the list by subscription scenario
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| PagedConverterForMergedPagedFlux.java | New utility class for mapping pages from merged PagedFlux without .take(1) limitation |
| VirtualNetworkGatewaysImpl.java | Updated to use PagedConverterForMergedPagedFlux for list operations |
| VirtualNetworkGatewayConnectionsImpl.java | Updated to use PagedConverterForMergedPagedFlux for list operations |
| LocalNetworkGatewaysImpl.java | Updated to use PagedConverterForMergedPagedFlux for list operations |
| PagedConverter.java | Added JavaDoc warning about incompatibility with mergePagedFlux |
| PagedConverterTests.java | Added disabled test demonstrating the issue; changed Mono.just to Mono.justOrEmpty |
| VirtualNetworkGatewayTests.java | New test verifying list by subscription returns items from multiple resource groups |
| NetworkManagementTest.java | Added exception handling in cleanup method |
| CHANGELOG.md | Documented the bug fix |
| pom.xml | Updated version to 2.55.1 |
| version_client.txt | Updated version tracking |
| assets.json | Updated asset tag |
.../java/com/azure/resourcemanager/network/implementation/PagedConverterForMergedPagedFlux.java
Outdated
Show resolved
Hide resolved
.../src/test/java/com/azure/resourcemanager/resources/fluentcore/utils/PagedConverterTests.java
Outdated
Show resolved
Hide resolved
...ager-network/src/test/java/com/azure/resourcemanager/network/VirtualNetworkGatewayTests.java
Outdated
Show resolved
Hide resolved
…ure/resourcemanager/network/implementation/PagedConverterForMergedPagedFlux.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…m/azure/resourcemanager/resources/fluentcore/utils/PagedConverterTests.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ure/resourcemanager/network/VirtualNetworkGatewayTests.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Fix #43723
I've done the fix in network module. I've searched the repo, and this is the only module code like this (concat
mergePagedFluxandmapPage).We should never do any new "list by subscription" via manual code. If service does not support a "list by subscription" API, SDK should not do this (main reason is that this is an efficient use of REST API calls). Existing ones are inherited from 1.x of mgmt libs.
For this kind of query,
azure-resourcemanager-resourcegraphwould be the recommended approach.Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines