Skip to content

Conversation

@XiaofeiCao
Copy link
Contributor

Description

address #45597 (comment) and #45597 (comment)

interfaces in efccdba
implementation in 8aeb40d
test in 6627203

Follow-up be, update revapi rule and add default methods of these new interfaces.

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.

add tests

test

test
implementation
recording
format
@github-actions github-actions bot added the Mgmt This issue is related to a management-plane library. label Jun 17, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jun 17, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

com.azure.resourcemanager:azure-resourcemanager-network
com.azure.resourcemanager:azure-resourcemanager-resources

@XiaofeiCao XiaofeiCao marked this pull request as ready for review June 17, 2025 08:48
Copilot AI review requested due to automatic review settings June 17, 2025 08:48
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 adds Context overloads to resource management and networking operations, ensuring Context is propagated through async calls, and updates tests and implementations accordingly.

  • Introduced Context-accepting overloads for delete and get methods in ResourceGroups, Deployments, and various network resource interfaces.
  • Updated implementations in *Impl classes to wire Reactor contexts via FluxUtil.toReactorContext(context).readOnly().
  • Enhanced compute tests (VirtualMachineOperationsTests) to verify Context propagation and added a getPrimaryNetworkInterface(Context) method in VirtualMachineImpl.

Reviewed Changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroups.java Added beginDeleteByName overloads with Context.
sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Deployments.java Added beginDeleteById and beginDeleteByResourceGroup overloads with Context.
sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupsImpl.java Implemented new delete methods with proper Context.NONE defaults and Reactor wiring.
sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsImpl.java Implemented new delete methods, added ClientLogger, and Reactor context propagation.
sdk/resourcemanager/azure-resourcemanager-resources/CHANGELOG.md Documented newly supported beginDelete methods.
sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/* Added Context overloads to various model interfaces (e.g., getByResourceGroup, listByResourceGroup).
sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/* Implemented Context overloads in network *Impl classes using FluxUtil.toReactorContext.
sdk/resourcemanager/azure-resourcemanager-network/CHANGELOG.md Documented new network Context-supporting methods.
sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java Enhanced test to verify Context passing and pipeline ordering.
sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImpl.java Added getPrimaryNetworkInterface(Context) overload.
sdk/resourcemanager/azure-resourcemanager-compute/assets.json Updated asset tag.
Comments suppressed due to low confidence (1)

sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImpl.java:1740

  • This method is missing an import for FluxUtil, which will cause a compile error, and the contextWrite call replaces rather than merges the Reactor context. Update it to:
import com.azure.core.util.FluxUtil;
...
return this.getPrimaryNetworkInterfaceAsync()
    .contextWrite(ctx -> ctx.putAll(FluxUtil.toReactorContext(context).readOnly()))
    .block();
return this.getPrimaryNetworkInterfaceAsync().contextWrite(c -> FluxUtil.toReactorContext(context)).block();

Copy link
Member

@weidongxu-microsoft weidongxu-microsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please

@XiaofeiCao
Copy link
Contributor Author

Please

Guess there's something left to be said here ;)

@weidongxu-microsoft
Copy link
Member

Guess there's something left to be said here ;)

Not much, just a nit whether we need a changelog in compute. Only 1 method though.

@XiaofeiCao
Copy link
Contributor Author

Not much, just a nit whether we need a changelog in compute. Only 1 method though.

Nice catch.. The method is added in parent interface, though exposed through VirtualMachine.

@XiaofeiCao
Copy link
Contributor Author

/check-enforcer override

@XiaofeiCao XiaofeiCao merged commit 609c4d0 into Azure:main Jun 18, 2025
18 of 20 checks passed
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.

2 participants