refactor todo-java template and fix bugs.#1122
Conversation
0ed1448 to
6d08a41
Compare
|
@v-xuto - Can you please run a test pass on all java templates? Thanks! I will generate the templates now... |
|
/azp run azure-dev - repoman |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Started running template tests validation: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=1980514&view=results FYI @jongio |
...do/api/java/src/main/java/com/microsoft/azure/simpletodo/controller/TodoItemsController.java
Outdated
Show resolved
Hide resolved
|
@jdubois Could use you or your team's insights on what might be idiomatic Java or otherwise based on your experiences. Otherwise, code changes looks fine pending validation. |
brunoborges
left a comment
There was a problem hiding this comment.
We should strongly consider the removal of the Lombok dependency.
IDEs don't support this out of the box and developers would have to install extra plugins/extensions to be able to work on this code.
Please let's keep the template simple and with minimal dependencies.
|
@brunoborges you are right, Lombok is removed. |
|
Can you make sure they also work fine on Linux? You may use WSL |
We have tested the java templates in |
|
/azp run azure-dev - repoman |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Re-running repoman after latest repoman CI changes |
|
/azp run azure-dev - repoman |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Repoman Generation ResultsRepoman pushed changes to remotes for the following projects: Project: todo-csharp-cosmos-sqlRemote: azure-samples-stagingBranch: pr/1122You can initialize this project with: azd init -t Azure-Samples/todo-csharp-cosmos-sql -b pr/1122View Changes | Compare Changes Project: todo-csharp-sql-swa-funcRemote: azure-samples-stagingBranch: pr/1122You can initialize this project with: azd init -t Azure-Samples/todo-csharp-sql-swa-func -b pr/1122View Changes | Compare Changes Project: todo-csharp-sqlRemote: azure-samples-stagingBranch: pr/1122You can initialize this project with: azd init -t Azure-Samples/todo-csharp-sql -b pr/1122View Changes | Compare Changes Project: todo-java-mongo-acaRemote: azure-samples-stagingBranch: pr/1122You can initialize this project with: azd init -t Azure-Samples/todo-java-mongo-aca -b pr/1122View Changes | Compare Changes Project: todo-java-mongoRemote: azure-samples-stagingBranch: pr/1122You can initialize this project with: azd init -t Azure-Samples/todo-java-mongo -b pr/1122View Changes | Compare Changes Project: todo-nodejs-mongo-acaRemote: azure-samples-stagingBranch: pr/1122You can initialize this project with: azd init -t Azure-Samples/todo-nodejs-mongo-aca -b pr/1122View Changes | Compare Changes Project: todo-nodejs-mongo-swa-funcRemote: azure-samples-stagingBranch: pr/1122You can initialize this project with: azd init -t Azure-Samples/todo-nodejs-mongo-swa-func -b pr/1122View Changes | Compare Changes Project: todo-nodejs-mongoRemote: azure-samples-stagingBranch: pr/1122You can initialize this project with: azd init -t Azure-Samples/todo-nodejs-mongo -b pr/1122View Changes | Compare Changes Project: todo-nodejs-mongo-terraformRemote: azure-samples-stagingBranch: pr/1122You can initialize this project with: azd init -t Azure-Samples/todo-nodejs-mongo-terraform -b pr/1122View Changes | Compare Changes Project: todo-python-mongo-acaRemote: azure-samples-stagingBranch: pr/1122You can initialize this project with: azd init -t Azure-Samples/todo-python-mongo-aca -b pr/1122View Changes | Compare Changes Project: todo-python-mongo-swa-funcRemote: azure-samples-stagingBranch: pr/1122You can initialize this project with: azd init -t Azure-Samples/todo-python-mongo-swa-func -b pr/1122View Changes | Compare Changes Project: todo-python-mongoRemote: azure-samples-stagingBranch: pr/1122You can initialize this project with: azd init -t Azure-Samples/todo-python-mongo -b pr/1122View Changes | Compare Changes Project: todo-python-mongo-terraformRemote: azure-samples-stagingBranch: pr/1122You can initialize this project with: azd init -t Azure-Samples/todo-python-mongo-terraform -b pr/1122View Changes | Compare Changes |
|
@weikanglim @jongio is there anything I should fix? |
|
@wangmingliang-ms No, the test failures are unrelated to your changes. We were in the middle of a release. Overall, the changes look good to me, and I'll merge it at the next appropriate window. |
weikanglim
left a comment
There was a problem hiding this comment.
@wangmingliang-ms Can you verify what additional changes we might need so that running ./mvnw -P openapigen compile doesn't result in a huge diff in the java files?
The huge diff you mentioned should be mainly caused by 2 reasons:
|
|
The code style issue can be solved by some maven plugins e.g. |
|
For formatting, please have a look at https://github.com/jhipster/prettier-java (it’s under JHipster, to be transparent). |
|
@wangmingliang-ms The formatting from So I opted for using prettier which has a much better result: After these changes, I can see the minimal codegen diff of only the intended, modified changes to our model classes, so I think we're in a good spot. |
|
@jdubois @wangmingliang-ms One final thing to check about Which seems like it's a hardcoded and opinionated import format according to their readme. I don't have a concern here as long as we have a consistent format. But do you feel strongly otherwise? I just wanted to get to a point where the user using the sample could understand the openapigen diff easily, so if they wanted to use the template as a starting point for their application, it would make total sense. I think that's accomplished here but let me know otherwise. Would love to get this merged sooner than later. |
|
I think it's OK, no style can satisfy all users, sections or not does not affect readability actually. What's more, google code style is almost the most popular. |

This PR refactored code and fixed some issues (including those in comments of PR #799 and several others) of SimpleTodo templates for Java AppService and Container Apps.