Skip to content

AppConfig OpenRewrite Recipes and Samples #45145

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

Draft
wants to merge 4 commits into
base: openrewrite/azure-core-migration
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------
# Library Migration Recipes for azure-data-appconfiguration
# --------------------------------------------------------------------
type: specs.openrewrite.org/v1beta/recipe
name: com.azure.openrewrite.migration.azure.data.appconfiguration
displayName: Migrate Track 2 Library azure-data-appconfiguration to Track 3
description: This recipe migrates the Track 2 library azure-data-appconfiguration to the next generation stack (Track 3).
recipeList:
- com.azure.openrewrite.recipes.azure.data.appconfiguration
- com.azure.openrewrite.recipes.azure.data.appconfiguration.models
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------
# Module Migration Recipes for azure.data.appconfiguration.models
# --------------------------------------------------------------------
type: specs.openrewrite.org/v1beta/recipe
name: com.azure.openrewrite.recipes.azure.data.appconfiguration.models
displayName: Migrate module azure.data.appconfiguration.models to next generation stack
description: This recipe migrates the azure.data.appconfiguration module to the next generation stack.
recipeList:

- org.openrewrite.java.ChangePackage:
oldPackageName: com.azure.data.appconfiguration.models
newPackageName: com.azure.v2.data.appconfiguration.models
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------
# Module Migration Recipes for azure.data.appconfiguration
# --------------------------------------------------------------------
type: specs.openrewrite.org/v1beta/recipe
name: com.azure.openrewrite.recipes.azure.data.appconfiguration
displayName: Migrate module azure.data.appconfiguration to next generation stack
description: This recipe migrates the azure.data.appconfiguration module to the next generation stack.
recipeList:

- org.openrewrite.java.ChangePackage:
oldPackageName: com.azure.data.appconfiguration
newPackageName: com.azure.v2.data.appconfiguration

Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ recipeList:

- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: com.azure.core.http.rest.PagedIterable
newFullyQualifiedTypeName: com.azure.v2.core.http.rest.PagedIterable
newFullyQualifiedTypeName: io.clientcore.core.http.paging.PagedIterable

# TODO: Migrate Methods and Fields

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------
# Library Migration Recipes for azure-identity
# --------------------------------------------------------------------
type: specs.openrewrite.org/v1beta/recipe
name: com.azure.openrewrite.migration.azure.identity
displayName: Migrate the Track-2 library azure-identity to next generation (Track-3) stack
description: This recipe migrates the azure-identity library to the next generation stack.
recipeList:

- com.azure.openrewrite.recipes.azure.identity
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------
# Module Migration Recipes for azure.identity
# --------------------------------------------------------------------
type: specs.openrewrite.org/v1beta/recipe
name: com.azure.openrewrite.recipes.azure.identity
displayName: Migrate module azure.identity to next generation stack
description: This recipe migrates the azure.identity module to the next generation stack.
recipeList:

- org.openrewrite.java.ChangePackage:
oldPackageName: com.azure.identity
newPackageName: com.azure.v2.identity
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ displayName: Migrate Azure SDKs to Next-Generation Library Stack
description: This recipe migrates the Azure SDKs to the next-generation library stack.
recipeList:
- com.azure.openrewrite.recipes.AzureCore
- com.azure.openrewrite.migration.azure.data.appconfiguration

- org.openrewrite.java.format.TabsAndIndents


Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,12 @@ public void assertFullMigration(Map<String,String> fileMap, String name) throws
Assumptions.abort("Migration samples are identical. No migration detected.");
}

try {
rewriteRun(
spec -> spec
.parser(JavaParser.fromJavaVersion().classpath("azure-core", "core").styles(getStyles()))
.recipeFromResources(RECIPE_NAME),
sourceSpecs.toArray(new SourceSpecs[sourceSpecs.size()])
);
} catch (AssertionError e) {
String message = e.getMessage();
throw new AssertionError("Migration failed for sample directory: " + name + "\n" + e.getLocalizedMessage());
}
rewriteRun(
spec -> spec
.parser(JavaParser.fromJavaVersion().classpath(JavaParser.runtimeClasspath()).styles(getStyles()))
.recipeFromResources(RECIPE_NAME),
sourceSpecs.toArray(new SourceSpecs[sourceSpecs.size()])
);

}
}

This file was deleted.

This file was deleted.

Loading
Loading