Skip to content

[AutoPR azure-resourcemanager-chaos]-generated-from-SDK Generation - Java-6292130#49171

Open
azure-sdk wants to merge 5 commits into
mainfrom
sdkauto/azure-resourcemanager-chaos-6292130
Open

[AutoPR azure-resourcemanager-chaos]-generated-from-SDK Generation - Java-6292130#49171
azure-sdk wants to merge 5 commits into
mainfrom
sdkauto/azure-resourcemanager-chaos-6292130

Conversation

@azure-sdk
Copy link
Copy Markdown
Collaborator

@azure-sdk azure-sdk commented May 13, 2026

Configurations: 'specification/chaos/resource-manager/Microsoft.Chaos/Chaos/tspconfig.yaml', API Version: 2026-05-01-preview, SDK Release Type: beta, and CommitSHA: 'fba0ddc48535c777a154e285a0708f27c188f081' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6292130 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. Release plan link: https://apps.powerapps.com/apps/821ab569-ae60-420d-8264-d7b5d5ef734c?release-plan-id=c532e936-dc4e-f111-bec7-000d3a5a7aa2 Submitted by: renzopretto@microsoft.com

Release Plan Details

…/Chaos/tspconfig.yaml', API Version: 2026-05-01-preview, SDK Release Type: beta, and CommitSHA: 'fba0ddc48535c777a154e285a0708f27c188f081' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6292130 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
@github-actions github-actions Bot added the Mgmt This issue is related to a management-plane library. label May 13, 2026
RenzoPrettoMS and others added 2 commits May 13, 2026 09:37
Run tsp-client update and codesnippet:update-codesnippet to
regenerate the Java SDK code for the chaos service to match
the latest TypeSpec definition.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Regenerated from spec commit 01b99ba99f (fix-chaos-versions-enum-ordering branch)
which fixes:
- Versions enum ordering so 2026-05-01-preview is the latest api-version
- KeyValuePair doc comment from 'map' to 'key-value pair'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@RenzoPrettoMS RenzoPrettoMS marked this pull request as ready for review May 13, 2026 16:46
Copilot AI review requested due to automatic review settings May 13, 2026 16:46
Copy link
Copy Markdown
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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Comment on lines +16 to +24
/*
* The Location property.
*/
private final String location;

/*
* The Retry-After property.
*/
private final Integer retryAfter;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same problem as #49072 (comment)

Comment on lines +16 to +24
/*
* The Location property.
*/
private final String location;

/*
* The Retry-After property.
*/
private final Integer retryAfter;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment on lines +16 to +24
/*
* The Location property.
*/
private final String location;

/*
* The Retry-After property.
*/
private final Integer retryAfter;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This likely just a response of GET of scenario runs. Why it also have location and retry-after?

@weidongxu-microsoft
Copy link
Copy Markdown
Member

weidongxu-microsoft commented May 14, 2026

@RenzoPrettoMS
Copy link
Copy Markdown

RenzoPrettoMS commented May 14, 2026

Hey, thank you for your thorough review on our SDK PR [AutoPR azure-resourcemanager-chaos]-generated-from-SDK Generation - Java-6292130 by azure-sdk · Pu…!

I think the core issue our team is facing is that we were told that an operation endpoint can be used in lieu of the OperationResults endpoint to fulfill the polymorphic nature of these endpoints (202 + no body while non-terminal, 200 + exact resource response body when terminal). azure-resource-manager-rpc/v1.0/async-api-reference.md at master · Azure/azure-resource-manager-rpc.

"If the operation is complete, return the exact same response that would have been returned had the operation been executed synchronously."

Our GET scenarioRun effectively services as the OperationResults endpoint for this resource but with the exact same response caveat defined by the RPC.

This was discussed in our azure-rest-api-specs PR Azure/azure-rest-api-specs#41486 (comment)

"Although not following the common pattern in ARM RPC, this serves as the operation result endpoint. Most RPs don't include such endpoints in public API documentation. I can approve with exception; but will leave it to your whether you want to include this new one or not in this PR (my understanding is that you already have similar endpoints documented publicaly, so you may want to be consistent)."

We had a few other scenarios where we chose to remove the endpoint entirely, but for this resource we opted to keep it as we deemed it would be leveraged by customers in the SDK and it is a standard pattern we are support in prview. If there is a supported way to manage this pattern, then we can make the swap, but as far as I know that doesn't exist. Hence, we needed the custom operation.

@weidongxu-microsoft
Copy link
Copy Markdown
Member

weidongxu-microsoft commented May 18, 2026

@RenzoPrettoMS

The most critical part is not on the GET. It is on the LRO that uses the GET.

All the comments are not on how your REST API structure (whether it polls via URL to Azure-AsyncOperation or not) -- it is owned by ARM dev, and he approves the exception, and we have no suggestion to change.

All comments are on how you write TypeSpec.

@RenzoPrettoMS
Copy link
Copy Markdown

@RenzoPrettoMS

The most critical part is not on the GET. It is on the LRO that uses the GET.

All the comments are not on how your REST API structure (whether it polls via URL to Azure-AsyncOperation or not) -- it is owned by ARM dev, and he approves the exception, and we have no suggestion to change.

All comments are on how you write TypeSpec.

Got it, that makes sense. Thank you for the clarification! Ill work on this then.

Addresses PR review feedback on #49171:

After updating the TypeSpec source to use @useFinalStateVia instead of
@extension (and removing @pollingOperation from execute/cancel), the
SDK generator now correctly detects these as LRO operations:

- ScenarioConfigurations.execute is now beginExecute /
  beginExecuteAsync returning SyncPoller<PollResult<ScenarioRunInner>,
  ScenarioRunInner>.
- ScenarioRuns.cancel is now beginCancel / beginCancelAsync returning
  SyncPoller<PollResult<ScenarioRunInner>, ScenarioRunInner>.
- ScenarioRuns.get now uses the standard ArmResourceRead template and
  returns Response<ScenarioRunInner> without the synthetic ...Headers
  class. ScenarioRunsGetHeaders, ScenarioRunsCancelHeaders, and
  ScenarioConfigurationsExecuteHeaders (and Response counterparts) are
  removed. Mock tests that asserted plain non-LRO behaviour for these
  operations are removed.

The remaining ...Inner / Impl / Sample / model changes are routine
fallout from regeneration with the corrected TypeSpec.

Verified: mvn compile and mvn test-compile both BUILD SUCCESS.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… polling

The Location-header polling pattern (final-state-via: location) requires
the polling endpoint to return 202 while the operation is in progress and
200 when it completes. The previous simplification of GET to return only
200 would have caused the LRO client to terminate polling on the first
poll attempt regardless of ScenarioRunProperties.status (status is only
used by the status-monitor pattern, not Location-header polling).

This regenerates the SDK from the updated TypeSpec where GET returns
both ArmResponse<ScenarioRun> (200) and a 202 in-progress response
with Location/Retry-After headers and the current ScenarioRun body.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@weidongxu-microsoft
Copy link
Copy Markdown
Member

SDK LTGM. We need a final regen after specs PR merge.

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.

4 participants