Skip to content
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

Azure-Core Migration Recipes #44494

Draft
wants to merge 32 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9855faf
Type changes for azure.core.annotation
jairmyree Feb 24, 2025
0b06dc0
Type changes for azure.core.credential
jairmyree Feb 24, 2025
795a8d5
Type changes for azure.core.cryptography
jairmyree Feb 24, 2025
1648d89
Type changes for azure.core.annotation
jairmyree Feb 24, 2025
2cd6d14
Type changes for azure.core.annotation
jairmyree Feb 24, 2025
2d8a263
Type changes for azure.core.client.traits
jairmyree Feb 24, 2025
499cf31
Updates to recipes
jairmyree Feb 24, 2025
734edaa
Type changes for azure.core.exception
jairmyree Feb 24, 2025
3531163
Type changes for azure.core.exception
jairmyree Feb 24, 2025
7797e3c
Type changes for azure.core.http
jairmyree Feb 24, 2025
51ab971
Type changes for azure.core.http.policy
jairmyree Feb 24, 2025
7ab7111
Type changes for azure.core.http.policy
jairmyree Feb 24, 2025
c8dcb8a
Type changes for azure.core.http.rest
jairmyree Feb 24, 2025
2bf7a96
Add files for models and utils packages
jairmyree Feb 24, 2025
5f213fe
Type changes for azure.core.annotation
jairmyree Feb 24, 2025
717f570
Type changes for azure.core.credential
jairmyree Feb 24, 2025
b94979f
Type changes for azure.core.cryptography
jairmyree Feb 24, 2025
15e56c1
Type changes for azure.core.annotation
jairmyree Feb 24, 2025
ce0a1d8
Type changes for azure.core.annotation
jairmyree Feb 24, 2025
06455da
Type changes for azure.core.client.traits
jairmyree Feb 24, 2025
a5c4ef8
Updates to recipes
jairmyree Feb 24, 2025
582204f
Type changes for azure.core.exception
jairmyree Feb 24, 2025
476b4a5
Type changes for azure.core.exception
jairmyree Feb 24, 2025
b9a5b39
Type changes for azure.core.http
jairmyree Feb 24, 2025
ed1fef7
Type changes for azure.core.http.policy
jairmyree Feb 24, 2025
e136bf2
Type changes for azure.core.http.policy
jairmyree Feb 24, 2025
b4f00c7
Type changes for azure.core.http.rest
jairmyree Feb 24, 2025
6150126
Add files for models and utils packages
jairmyree Feb 24, 2025
3a02150
Updates to core migration PR
jairmyree Mar 4, 2025
4a525a4
Merge remote-tracking branch 'origin/openrewrite/azure-core-migration…
jairmyree Mar 4, 2025
f529b76
Updates to core migration PR
jairmyree Mar 4, 2025
63aed7d
Updates to core migration PR
jairmyree Mar 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions sdk/tools/azure-openrewrite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,7 @@
<artifactId>rewrite-maven</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
<version>1.55.2</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-test</artifactId>
Expand Down Expand Up @@ -121,6 +116,20 @@
<scope>provided</scope>
</dependency>

<!-- Library Test dependencies -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
<version>1.55.2</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.clientcore</groupId>
<artifactId>core</artifactId>
<version>1.0.0-beta.5</version>
</dependency>

<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-ai-translation-text</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ recipeList:
oldFullyQualifiedTypeName: com.azure.core.http.policy.KeyCredentialPolicy
newFullyQualifiedTypeName: io.clientcore.core.http.pipeline.KeyCredentialPolicy


# Before: import com.azure.core.credential.KeyCredential;
# After: import io.clientcore.core.credential.KeyCredential;
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: com.azure.core.credential.KeyCredential
newFullyQualifiedTypeName: io.clientcore.core.credential.KeyCredential


# Before: import com.azure.core.client.traits.KeyCredentialTrait;
# After: import io.clientcore.core.models.traits.KeyCredentialTrait;
- org.openrewrite.java.ChangeType:
Expand Down Expand Up @@ -75,27 +67,27 @@ recipeList:
newFullyQualifiedTypeName: io.clientcore.core.http.pipeline.HttpPipelinePolicy
ignoreDefinition: false

# Before: import com.azure.core.exception.ClientAuthenticationException;
# Before: import com.azure.core.exception.yml.ClientAuthenticationException;
# After: import com.azure.core.v2.exception.ClientAuthenticationException;
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: com.azure.core.exception.ClientAuthenticationException
oldFullyQualifiedTypeName: com.azure.core.exception.yml.ClientAuthenticationException
newFullyQualifiedTypeName: com.azure.core.v2.exception.ClientAuthenticationException

# Before: import com.azure.core.exception.ResourceModifiedException;
# Before: import com.azure.core.exception.yml.ResourceModifiedException;
# After: import com.azure.core.v2.exception.ResourceModifiedException;
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: com.azure.core.exception.ResourceModifiedException
oldFullyQualifiedTypeName: com.azure.core.exception.yml.ResourceModifiedException
newFullyQualifiedTypeName: com.azure.core.v2.exception.ResourceModifiedException
# Before: import com.azure.core.exception.ResourceNotFoundException;
# Before: import com.azure.core.exception.yml.ResourceNotFoundException;
# After: import com.azure.core.v2.exception.ResourceNotFoundException;
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: com.azure.core.exception.ResourceNotFoundException
oldFullyQualifiedTypeName: com.azure.core.exception.yml.ResourceNotFoundException
newFullyQualifiedTypeName: com.azure.core.v2.exception.ResourceNotFoundException

# Before: import com.azure.core.exception.HttpResponseException;
# Before: import com.azure.core.exception.yml.HttpResponseException;
# After: import io.clientcore.core.http.exception.HttpResponseException;
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: com.azure.core.exception.HttpResponseException
oldFullyQualifiedTypeName: com.azure.core.exception.yml.HttpResponseException
newFullyQualifiedTypeName: io.clientcore.core.http.exception.HttpResponseException
# End azure-core-exception change type Recipes

Expand Down Expand Up @@ -142,7 +134,3 @@ recipeList:
matchOverrides: false
ignoreDefinition: false

- com.azure.openrewrite.core.ResponseRecipe
- com.azure.openrewrite.core.RetryOptionsConstructorRecipe
- com.azure.openrewrite.TypeReferenceRecipe
- com.azure.openrewrite.RemoveFixedDelayRecipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------
# Migration Recipes for azure.core.annotation
# --------------------------------------------------------------------
type: specs.openrewrite.org/v1beta/recipe
name: com.azure.openrewrite.migration.azure.core.annotation
displayName: Migrate from azure.core.annotation to next generation stack
description: This recipe migrates the azure.core.annotation package to the next generation stack.
recipeList:

# --------------------------------------------------------------------
# BodyParam
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# Delete
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# ExpectedResponses
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# Fluent
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# ForumParam
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# Generated
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# Get
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# Head
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# HeaderCollection
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# HeaderParam
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# Headers
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# Host
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# HostParam
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# Immutable
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# JsonFlatten
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# Options
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# Patch
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# PathParam
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# Post
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# Put
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# QueryParam
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# ResumeOperation
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# ReturnType
# --------------------------------------------------------------------

- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: com.azure.core.annotation.ReturnType
newFullyQualifiedTypeName: io.clientcore.core.annotations.ReturnType

# TODO: Migrate Methods and Fields

# --------------------------------------------------------------------
# ReturnValueWireType
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# ServiceClient
# --------------------------------------------------------------------

- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: com.azure.core.annotation.ServiceClient
newFullyQualifiedTypeName: io.clientcore.core.annotations.ServiceClient

# TODO: Migrate Methods and Fields

# --------------------------------------------------------------------
# ServiceClientBuilder
# --------------------------------------------------------------------

- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: com.azure.core.annotation.ServiceClientBuilder
newFullyQualifiedTypeName: io.clientcore.core.annotations.ServiceClientBuilder

# TODO: Migrate Methods and Fields

# --------------------------------------------------------------------
# ServiceClientProtocol
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# ServiceInterface
# --------------------------------------------------------------------

- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: com.azure.core.annotation.ServiceInterface
newFullyQualifiedTypeName: io.clientcore.core.annotations.ServiceInterface

# TODO: Migrate Methods and Fields

# --------------------------------------------------------------------
# ServiceMethod
# --------------------------------------------------------------------

- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: com.azure.core.annotation.ServiceMethod
newFullyQualifiedTypeName: io.clientcore.core.annotations.ServiceMethod

# TODO: Migrate Methods and Fields

# --------------------------------------------------------------------
# UnexpectedResponseExceptionType
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement

# --------------------------------------------------------------------
# UnexpectedResponseExceptionTypes
# --------------------------------------------------------------------

# TODO: Removed API. Triage replacement


Loading
Loading