Skip to content

Conversation

@weidongxu-microsoft
Copy link
Member

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 mergePagedFlux and mapPage).

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-resourcegraph would 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:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@weidongxu-microsoft weidongxu-microsoft marked this pull request as ready for review November 11, 2025 06:19
Copilot AI review requested due to automatic review settings November 11, 2025 06:19
@github-actions github-actions bot added the Mgmt This issue is related to a management-plane library. label Nov 11, 2025
Copilot finished reviewing on behalf of weidongxu-microsoft November 11, 2025 06:21
@haolingdong-msft
Copy link
Member

For this kind of query, azure-resourcemanager-resourcegraph would be the recommended approach.

Curious why azure-resourcemanager-resourcegraph is recommended? Does it have all the list by subscription APIs?

Copy link
Contributor

Copilot AI left a 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 PagedConverterForMergedPagedFlux class 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

weidongxu-microsoft and others added 4 commits November 11, 2025 15:25
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Mgmt This issue is related to a management-plane library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PagedResult doesn't return full response

3 participants