-
Notifications
You must be signed in to change notification settings - Fork 139
add section for CAP Java OpenRewrite recipes #2194
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1414,3 +1414,24 @@ After rebuilding and restarting your application, your Application Services are | |
| <!-- TODO: Move this to "Development" section --> | ||
|
|
||
| <span id="afterenablingodata" /> | ||
|
|
||
| ## Automatic Java Migrations with Open Rewrite { #open-rewrite } | ||
|
|
||
| Whenever we introduce new versions or replacements of an API version we try make the transition from the old version to the new version as smooth as possible. When possible we introduce a new version in the same major version as the version where deprecate the old version. This is the foundation for having automatic code migrations with [OpenRewrite](https://docs.openrewrite.org). At CAP Java, we aim to provide Open Rewrite Recipes for our API changes. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Grammar error: 'where deprecate' should be 'where we deprecate'. The sentence also needs restructuring for clarity:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Grammar error: 'try make' should be 'try to make'. Also, consider rephrasing for clarity:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Grammar and clarity issues: Missing article 'the' before 'version where' and awkward phrasing. Consider revising:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent terminology: 'Open Rewrite' should be consistently written as 'OpenRewrite' (one word) throughout the document, as shown in the link reference. |
||
|
|
||
| The application of these recipes is done via Maven similarly to calling Maven archetypes these recipes are called as a one-shot operation on a developers laptop. Take this call as an example: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The sentence structure is unclear and contains redundant information. Consider simplifying:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unclear sentence structure and missing punctuation. Consider revising for clarity: Note: 'developers' should be 'developer's' (possessive) and the sentence needs better structure. |
||
|
|
||
| ```bash | ||
| mvn org.openrewrite.maven:rewrite-maven-plugin:run \ | ||
| -Drewrite.recipeArtifactCoordinates=com.sap.cds:cds-services-recipes:4.3.0 \ | ||
| -Drewrite.activeRecipes=com.sap.cds.services.migrations.MigrateStatements \ | ||
| -DskipMavenParsing=true | ||
| ``` | ||
|
|
||
| Here, the *migration* `com.sap.cds.services.migrations.MigrateStatements` in the Maven artifact `com.sap.cds:cds-services-recipes:4.3.0` is called in the given project context. The *migration* is a container for one or more recipes. A recipe is a rule telling Open Rewrite how to come from code A to code B. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent terminology: 'Open Rewrite' should be consistently written as 'OpenRewrite' (one word) throughout the document to match the official product name.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The sentence structure is awkward. Consider rephrasing for better clarity:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent terminology: 'Open Rewrite' should be 'OpenRewrite' to match the established naming convention used in the link reference. |
||
|
|
||
| This is the list of migrations we have released for CAP Java: | ||
|
|
||
| |Name |Description|Available since| | ||
| |--------|-----------|---------------| | ||
| |[com.sap.cds.services.migrations.MigrateStatements](/releases/aug25#typed-query-results)|Prepares applications by migrating CQN statements for typed Query API changes in 4.3.0.|4.3.0| | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar error: 'try make' should be 'try to make'. Also, consider rephrasing for clarity: